DevToolPal
EN

Cron expression

First Monday of every month

The job runs at 09:00 on days 1–7, and a shell test keeps only the day that is a Monday.

0 9 1-7 * * Open in Cron Expression Parser

Writing 0 9 1-7 * 1 does not work: when both day fields are set, cron runs if either matches, so it would run on days 1–7 and on every Monday. Quartz and Spring support MON#1.

Field by field

Field Value Matches
Minute 0 0
Hour 9 9
Day of month 1-7 1, 2, 3, 4, 5, 6, 7
Month * Every value
Day of week * Every value

Next run times

Example: the first 6 runs after January 1, 2026 (UTC).

  1. Mon, Jan 5, 2026, 09:00
  2. Mon, Feb 2, 2026, 09:00
  3. Mon, Mar 2, 2026, 09:00
  4. Mon, Apr 6, 2026, 09:00
  5. Mon, May 4, 2026, 09:00
  6. Mon, Jun 1, 2026, 09:00

Ready-to-use versions

crontab
0 9 1-7 * * [ "$(date +\%u)" = 1 ] && /path/to/command

Add the line with crontab -e. It runs in the server's time zone unless CRON_TZ or TZ is set.

Kubernetes CronJob
apiVersion: batch/v1
kind: CronJob
metadata:
  name: first-monday-of-month
spec:
  schedule: "0 9 1-7 * *"
  timeZone: "Etc/UTC"
  concurrencyPolicy: Forbid
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: OnFailure
          containers:
            - name: job
              image: busybox:1.36
              command: ["/bin/sh", "-c", "date; echo run"]

Set spec.timeZone (Kubernetes 1.27+); without it the schedule follows the controller manager's time zone, usually UTC.

GitHub Actions
on:
  schedule:
    - cron: '0 9 1-7 * *'
  workflow_dispatch:

GitHub Actions always uses UTC, accepts intervals of 5 minutes or more, and may start scheduled runs late under load.

Quartz
0 0 9 ? * MON#1

Quartz puts seconds first and needs ? in either day-of-month or day-of-week. Days are 1–7 from Sunday, so names are safer.

Spring
@Scheduled(cron = "0 0 9 * * MON#1")

Spring @Scheduled(cron = …) takes six fields: seconds, then the usual five.

FAQ

› Why does 0 9 1-7 * 1 run too often?

Cron ORs the day-of-month and day-of-week fields when both are restricted, so it runs on the 1st to the 7th and also on every Monday.

› Which time zone does 0 9 1-7 * * run in?

Cron uses the time zone of the machine or service that runs it. On Linux that is the system time zone unless CRON_TZ or TZ is set; Kubernetes CronJobs accept spec.timeZone; GitHub Actions always uses UTC.

› How can I check this schedule before deploying it?

Open 0 9 1-7 * * in the Cron Expression Parser on this site. It explains each field and lists the upcoming runs in your local time or UTC, right in your browser.