Cron expression for once a year on January 1
Runs the job at midnight on January 1, once a year.
0 0 1 1 *
At 12:00 AM, on day 1 of the month, only in January
Field by field
- Minute · 0–59
0only at minute 0 - Hour · 0–23
0only at 00:00 - Day of month · 1–31
1only on day 1 - Month · 1–12 or JAN–DEC
1only in January - Day of week · 0–7 or SUN–SAT
*every day of the week
Next runs in your local time
Why this schedule, and when it bites
A date pinned to both the day and the month fires once: 0 0 1 1 * is midnight on January 1, the annual rollover slot. Year-end jobs are rare and consequential, so the schedule has to be boring and the job has to be idempotent: if the run fires twice because someone re-ran it by hand, the second pass should change nothing.
Day and month together pin the date. 1 in the day field and 1 in the month field intersect: only January 1 matches. Change either one and the schedule widens: a star in the month field makes it monthly, 0 0 1 1 * stays annual. Read both fields before editing.
Timezones decide which year. At 00:00 on January 1 in UTC, it is still December 31 in New York. A year-end job that must close the local year should run in local time or a few hours later, and the report should state which year it covers.
Nobody is watching on New Year's night. The run happens when the team is off. Make it self-verifying: write a completion marker with the year, and a January 2 check job that alerts if the marker for the new year is missing.
Where this cron expression shows up
- Year-end rollovers
- Annual archive snapshots
- Resetting quotas that last twelve months
Common variations
-
Quarterly, on the first day of each quarter
0 0 1 1,4,7,10 * At 12:00 AM, on day 1 of the month, only in January, April, July, and October
-
Twice a year, January 1 and July 1
0 0 1 1,7 * At 12:00 AM, on day 1 of the month, only in January and July
Ranges, steps, and names are spelled out on the cheat sheet.
Questions this schedule raises
How do I run something once a year on a different date?
Set the day and the month: 0 0 15 3 * for March 15. Keep both restricted fields; a star in the month field makes it monthly, not annual.
Does 0 0 1 1 * run in every timezone at once?
No. Cron runs on one host in one timezone. If the business day starts in several zones, run the job per zone or anchor it to UTC and document which calendar the report uses.