Cron every month
0 0 1 * * — Midnight on the 1st of every month, twelve runs a year. @monthly is the shorthand in Linux cron, Kubernetes and Spring.
Runs
Try one
The same schedule in every dialect
| Where | Expression | |
|---|---|---|
| Linux / Unix crontab, Kubernetes, GitHub Actions | 0 0 1 * * | explain |
| Quartz Scheduler | 0 0 0 1 * ? | explain |
| AWS EventBridge | cron(0 0 1 * ? *) | explain |
Spring @Scheduled | 0 0 0 1 * * | explain |
| Jenkins | 0 0 1 * * | H calculator |
systemd timer OnCalendar= | monthly | test |
Things to know
- Day 31 is skipped in the five months that do not have one — cron does not move it to the last day. Quartz, AWS and Spring have
Lfor "last day of the month"; Linux cron needs a guard in the command:0 0 28-31 * * [ "$(date -d tomorrow +\%d)" = 01 ] && …(GNU date; the%must be escaped in a crontab). - Jenkins'
@monthlyisH H H * *— a per-job day between the 1st and 28th, not the 1st.
Variations
| Expression | Runs |
|---|---|
| 0 9 1 * * | the 1st of every month at 09:00 |
| 0 0 1,15 * * | the 1st and 15th |
| 0 0 1 */3 * | quarterly: 1 January, April, July, October |
How to use this schedule
- Open your crontab with
crontab -e(or the scheduler's config file). - Add a line with the expression followed by the command:
0 0 1 * * /usr/local/bin/job.sh. Use absolute paths — cron runs with a minimalPATH. - Save. cron picks the change up automatically; check the next run times above, in the time zone your server uses.
- Redirect output if you want to keep it: append
>> /var/log/job.log 2>&1. The crontab line builder assembles the whole line.
FAQ
Is "0 0 1 * *" the same on every server?
The five-field form means the same thing in Linux cron, Kubernetes, GitHub Actions and most libraries. The clock it follows differs:
a Linux server uses its own time zone (or CRON_TZ on cronie), GitHub Actions and AWS EventBridge rules use UTC unless a time zone is configured, and Kubernetes uses the controller's zone unless .spec.timeZone is set.
Why do Quartz and AWS need a "?"
Both require exactly one of day-of-month and day-of-week to be ?, meaning "no specific value"; they refuse an expression that restricts both, or leaves both as *.
How do I check it will run when I expect?
The widget above lists the next runs in the time zone you choose, and flags any run that lands in a daylight-saving gap or a repeated hour. For a whole crontab, paste it into the crontab viewer.