0 0 1 * *Fields
| Minute | 0 | 0 |
|---|---|---|
| Hour | 0 | 0 |
| Day of month | 1 | 1 |
| Month | * | any |
| Day of week | * | any |
Where to use it
| crontab | 0 0 1 * * /path/to/script.sh |
|---|---|
| GitHub Actions | - cron: "0 0 1 * *" (on.schedule) |
| Kubernetes CronJob | schedule: "0 0 1 * *" |
crontab runs in the server’s time zone; GitHub Actions always uses UTC.
Good to know
0 0 1 * * runs at midnight on the 1st of every month, the same as @monthly. Billing, invoices and monthly reports usually live here, so decide which time zone defines “the 1st”: on a UTC server it is still the last day of the previous month in the Americas. A report covering last month should compute its date range from the run date, never assume 30 or 31 days.
Vixie cron and cronie have no syntax for the last day of the month; run at 0 0 28-31 * * and test inside the command, for example test $(date -d tomorrow +\%d) = 01 && /path/to/script.sh. Quartz and some cloud schedulers support L instead. Beware the OR rule: 0 0 1 * 1 runs on the 1st and on every Monday, not on Mondays that fall on the 1st.