Cron for once a year at midnight on 1 January
0 0 1 1 *At 12:00 AM, on day 1 of the month, only in January
What this schedule does
0 0 1 1 * is New Year’s Day at 00:00. Rotate annual secrets, archive last year’s partitions, or kick a yearly report. Confirm UTC vs local — this expression is famous for running on 31 December afternoon in US timezones.
Next 5 runs (UTC)
Times below are computed for UTC. Open the builder to preview another timezone.
- Fri, 01 Jan 2027, 00:00 UTC
- Sat, 01 Jan 2028, 00:00 UTC
- Mon, 01 Jan 2029, 00:00 UTC
- Tue, 01 Jan 2030, 00:00 UTC
- Wed, 01 Jan 2031, 00:00 UTC
Copy-paste snippets
GitHub Actions
UTC only. Quote the expression so YAML keeps the stars.
on:
schedule:
- cron: '0 0 1 1 *'Kubernetes
CronJob spec.schedule. Kubernetes uses the timezone of the kube-controller-manager unless you set .spec.timeZone.
apiVersion: batch/v1
kind: CronJob
metadata:
name: job
spec:
schedule: "0 0 1 1 *"
jobTemplate:
spec:
template:
spec:
restartPolicy: OnFailure
containers:
- name: job
image: busybox
args: ["echo", "run"]AWS EventBridge
Six fields: minutes hours day-of-month month day-of-week year. Use ? in either day-of-month or day-of-week.
cron(0 0 1 1 ? *)Quartz
Quartz is seconds-first (6 or 7 fields). Day-of-week names are MON, TUE, … and ? is required in one of the day fields.
0 0 0 1 1 *Vercel Cron
{
"crons": [
{
"path": "/api/cron",
"schedule": "0 0 1 1 *"
}
]
}crontab
0 0 1 1 * /usr/local/bin/jobnode-cron
import cron from 'node-cron';
cron.schedule('0 0 1 1 *', () => {
// job
});Spring @Scheduled
Spring uses 6 fields by default (seconds first) unless you set spring.task.scheduling.cron.expression.
@Scheduled(cron = "0 0 0 1 1 *")
public void run() {
// job
}