Cron expression for every sunday
0 0 * * 0 runs once a week, at 00:00 on Sunday. That is the start of Sunday, the moment Saturday night ends.
This tool runs in your browser. We never send what you type or paste to a server.
The expression
0 0 * * 0 /path/to/commandThe expression has five fields, read left to right:
| Field | Value | Meaning here |
|---|---|---|
| Minute | 0 | at minute 0 |
| Hour | 0 | at hour 0 |
| Day of month | * | every day of the month |
| Month | * | every month |
| Day of week | 0 | Sunday (0) |
When it runs
Starting from Wed 2027-01-06 10:07 UTC, the next runs are:
Sun 2027-01-10 00:00
Sun 2027-01-17 00:00
Sun 2027-01-24 00:00
Sun 2027-01-31 00:00
Sun 2027-02-07 00:00Cron uses the time zone of the machine or service that runs it. The explainer at the top of this page shows the next runs in your own time zone.
Sunday is 0, 7 or SUN
Unix cron accepts both 0 and 7 for Sunday, and the name SUN. Quartz and AWS EventBridge call Sunday 1, so a bare number copied between systems lands on the wrong day; the name is safe.
0 0 * * 0 Sunday 00:00
0 0 * * SUN the same
0 3 * * 0 Sunday 03:00
0 0 * * 1 Monday 00:00
0 22 * * 5 Friday 22:00
@weekly the same as 0 0 * * 0If you mean "Sunday night", you probably want 0 23 * * 0 or Monday's 0 0 * * 1: midnight on Sunday is 24 hours earlier than people tend to expect.
Every other week
Cron cannot express "every second Sunday": there is no week counter. Run weekly and let the command decide, for example by testing whether the week number is even:
0 0 * * 0 [ $(( $(date +\%-V) % 2 )) -eq 0 ] && /path/to/command%-V is the ISO week number without a leading zero (GNU date), so that 08 and 09 are not rejected as bad octal numbers, and the backslash is needed because % is special in a crontab. Years with 53 weeks produce two odd weeks in a row, so for a strict fortnightly cycle compare against a fixed start date instead. Quartz and AWS can target "the first Sunday of the month" with 1#1, which Unix cron cannot.
Quartz adds a seconds field at the front, AWS adds a year at the end, and both need ? in one of the two day fields. See how the syntaxes differ.
The same schedule in other schedulers
| Scheduler | Expression |
|---|---|
| Unix cron, crontab | 0 0 * * 0 or @weekly |
| Kubernetes CronJob | schedule: "0 0 * * 0" |
| GitHub Actions | - cron: '0 0 * * 0' |
| Quartz (Java, Spring) | 0 0 0 ? * SUN |
| AWS EventBridge | cron(0 0 ? * SUN *) |
Questions
Is Sunday 0 or 7 in cron?
Both work in Unix cron. In Quartz and AWS EventBridge Sunday is 1. SUN works in all of them.
What does @weekly do?
It is shorthand for 0 0 * * 0: once a week at midnight at the start of Sunday.
How do I run a cron job every two weeks?
Cron has no fortnightly option. Schedule it weekly and add a test in the command, such as checking that the ISO week number is even, or use a scheduler that supports intervals.