Cron expression for once a year
At 00:00, on 1 January.
Five fields for Linux, GitHub Actions and Kubernetes (minute hour day month weekday). Six or seven for Quartz. Nothing you type leaves your device.
What it means and when to use it
Day 1 of month 1 gives a once-a-year job: the manual lists @yearly and @annually as 0 0 1 1 *. Use it for annual archives, a new-year reset of counters or a yearly reminder. Change the two date fields for another day: 0 9 15 8 * is 15 August at 09:00 every year.
Watch out for this
Yearly jobs are the ones you forget about. A server may be rebuilt twice before the next run, so the line disappears, and nobody notices for a year. Keep the yearly task in the project documentation as well as in cron, and ideally run it with an alert if it does not report success. A leap-day schedule, 0 0 29 2 *, only fires in leap years: the tool shows the next dates, which are 29 February 2028 and 29 February 2032.
What each field says
| Field | Written | Means |
|---|---|---|
| Minute | 0 | 0 |
| Hour | 0 | 0 |
| Day of month | 1 | 1 |
| Month | 1 | Jan |
| Day of week | * | every day of the week |
An example of the next runs
If it were Friday 13 November 2026 at 10:20 UTC, the next six runs would be these. Times are shown in UTC and in India time (UTC+5:30).
| UTC | India time |
|---|---|
| Fri 1 Jan, 00:00 | Fri 1 Jan, 05:30 |
| Sat 1 Jan, 00:00 | Sat 1 Jan, 05:30 |
| Mon 1 Jan, 00:00 | Mon 1 Jan, 05:30 |
| Tue 1 Jan, 00:00 | Tue 1 Jan, 05:30 |
| Wed 1 Jan, 00:00 | Wed 1 Jan, 05:30 |
| Thu 1 Jan, 00:00 | Thu 1 Jan, 05:30 |
The same schedule in other places
Quartz
Quartz has a seconds field in front, uses ? in one day field, and counts Sunday as 1:
0 0 0 1 1 ?GitHub Actions
Scheduled workflows run in UTC unless you add a time zone. In the workflow file:
on:
schedule:
- cron: '0 0 1 1 *'Kubernetes CronJob
In a CronJob manifest the schedule goes in spec.schedule. Without spec.timeZone, it is read in the time zone of the cluster's controller:
spec:
schedule: "0 0 1 1 *"
timeZone: "Etc/UTC"A crontab line to copy
The command is made up. Replace it with your own and use full paths:
0 0 1 1 * /home/me/bin/new-year-archive.sh >> /home/me/archive.log 2>&1Questions
Is @yearly supported by Quartz?
No. In Quartz write the fields: 0 0 0 1 1 ? runs at midnight on 1 January.
This is an independent guide and tool. It is not connected with crontab.guru, Quartz, GitHub, Kubernetes, Spring or the Linux projects named here. Product names belong to their owners.