Cron on the first Monday of the month
The first Monday of the month in cron is 0 0 9 ? * MON#1 in Quartz and Spring, not 0 9 1-7 * 1; this page lists the next runs, calculated in your browser.
There's no single Unix expression. Use 0 9 1-7 * * [ "$(date +\%u)" = 1 ] && your-command: run on days 1-7 and let the command check that today is Monday.
0 0 9 ? * MON#1
cron(0 9 ? * 2#1 *)
Read by our parser as: At 9:00 AM, on the first Monday of the month. Open in the cron checker
Next 10 runs
Calculating in your browser...
- 1
- 2
- 3
At a glance
- Accepts
- Nothing to enter - the schedule is preset on the page
- Outputs
- The expression in Unix, Quartz/Spring and AWS form, plus its next 10 run times
- Where it runs
- Entirely in your browser, on your device
- What leaves your device
- Nothing - what you type stays in this tab
- Limits
- Run times use your browser's timezone or UTC; real schedulers can start a run late
- Account
- Not required - there is no sign-up
- Price
- Free, with no watermark and no usage cap
- Made by
- Visrut
What it means
Quartz, Spring and AWS have # for the nth weekday of the month: MON#1 is the first Monday, so 0 0 9 ? * MON#1 runs at 9:00 on it. The tempting Unix version, 0 9 1-7 * 1, is wrong: when both day fields are set, Unix cron runs when either matches, so it fires on the 1st to the 7th and on every Monday.
When this is the right schedule
Use it when you need a monthly meeting reminder, a monthly patch window, or any other "first Monday" rule that people already use on calendars.
When to pick something else
Look elsewhere when you're on crontab, Kubernetes or GitHub Actions, which only have 5-field syntax; use the date check above.
Things to watch
The OR rule, from the man page
crontab(5): "If both fields are restricted (i.e., do not contain the "*" character), the command will be run when either field matches the current time." Its own example 30 4 1,15 * 5 runs on the 1st, the 15th and every Friday. Paste 0 9 1-7 * 1 into the checker to see the extra runs.
AWS uses numbers: 2#1
AWS documents # with numeric days (its example 3#2 is the second Tuesday), and days count from Sunday = 1, so the first Monday is 2#1. AWS also allows only one # expression in the field.
The date check, explained
date +%u prints 1 for Monday through 7 for Sunday. Run the job on days 1 to 7, which always include exactly one Monday, and exit early on other days. Escape % as \% inside a crontab line.
Frequently asked questions
What does 0 9 1-7 * 1 do in cron?
In Unix cron it runs at 9:00 on days 1 to 7 of each month and also on every Monday, because the two day fields are combined with OR.
How do I get the second Tuesday in Quartz?
0 0 9 ? * TUE#2 (or 3#2, since Quartz counts Sunday as 1).
Does Spring support MON#1?
Yes. Spring's documentation lists 0 0 0 ? * MON#1 as "the first Monday in the month at midnight".