Cron Expression for the First Day of the Month
The cron expression for the first day of the month is 0 0 1 * *, which runs at 00:00 on the 1st of every month. To run later that day, change the time fields — 0 8 1 * * runs at 08:00 on the 1st.
At 12:00am on day 1 of the month.
0 0 1 * *Standard 5-field crontab syntax. Day of month and day of week are OR'd when both are set.
What it does
The 1 sits in the third field, the day of month. Cron runs the job when the minute, hour, day of month and month all match, and with the month and day of week left as *, the 1st of every month qualifies. It's the same expression as the every-month schedule; the difference is how you think about it — a date on the calendar rather than a frequency.
The 1st is when a new period starts, so it's when jobs that close the old one run: rolling over accounting periods, creating a new partition or table for the month, archiving the previous month's data, sending monthly usage emails, or rotating API keys on a fixed calendar. Running at 00:00 means the new month's first records land in the right place.
Businesses often want the first working day rather than the 1st, and it's tempting to write 0 9 1-3 * 1-5. Because both day fields are restricted, cron treats them as OR — that runs on the 1st to the 3rd and on every weekday of the month. Instead, run on the 1st to the 3rd and let the command decide whether today is the first weekday.
How 0 0 1 * * works, field by field
| FIELD | VALUE | MEANING |
|---|---|---|
| Minute | 0 | minute 0 |
| Hour | 0 | hour 0 (midnight) |
| Day of month | 1 | day 1 of the month |
| Month | * | every month |
| Day of week | * | every day of the week |
Put together, cron reads 0 0 1 * * as: “At 12:00am on day 1 of the month.”
To see further ahead, paste the expression into the cron calculator, which lists the next ten run times and counts how many times the schedule runs in a year.
Frequently asked questions
How do I run a cron job on the first weekday of the month?
Schedule 0 9 1-3 * * and let the command continue only when today is a weekday and is either the 1st or a Monday. The first weekday is always the 1st, 2nd or 3rd, and it's only the 2nd or 3rd when that day is a Monday.
Is 0 0 1 * * the same as @monthly?
Yes. @monthly is shorthand for 0 0 1 * *, midnight at the start of each month.
Can I run a job on the 1st and the 15th of every month?
Yes — list both days: 0 0 1,15 * * runs at midnight on the 1st and on the 15th, a common schedule for twice-monthly payroll or reports.