Cron expression for every Sunday at noon
Runs the job once a week, on Sunday at 12:00 PM.
0 12 * * 0
At 12:00 PM, only on Sunday
Field by field
- Minute · 0–59
0only at minute 0 - Hour · 0–23
12only at 12:00 - Day of month · 1–31
*every day of the month - Month · 1–12 or JAN–DEC
*every month - Day of week · 0–7 or SUN–SAT
0only on Sunday
Next runs in your local time
Why this schedule, and when it bites
Sundays at noon is the classic weekly maintenance slot: traffic is at its lowest, a failure has hours to be noticed before Monday, and a long-running job can borrow the afternoon. 0 12 * * 0 is also the expression where the day-of-week numbering trips people twice: 0 is Sunday, 7 is Sunday again, and the field is the fifth one, not the third.
0 and 7 are both Sunday, but not everywhere. Vixie cron and most modern daemons accept 0-7 with both ends naming Sunday. Some minimal implementations treat 7 as an error. Pick one form for your fleet and keep it; 0 is the safer default.
A Sunday run that fails has no audience. Nobody reads alerts on Sunday morning, so a failed digest quietly waits until Monday. Route failures to a channel that pings the on-call phone, or move the run to Saturday evening where a failure still has a workday to recover in.
DST can move the wall-clock hour. Twice a year the local time shifts; a noon schedule stays at noon on the wall clock, which is right for people and wrong for anything measuring exactly seven days between runs. If the job must run exactly weekly, compare timestamps inside the job instead of trusting the calendar.
Where this cron expression shows up
- Weekly digests
- Retention jobs that should not touch a workday
- Rebuilding derived data while traffic is low
Common variations
-
The same Sunday run written with 7
0 12 * * 7 At 12:00 PM, only on Sunday
-
Saturdays at noon
0 12 * * 6 At 12:00 PM, only on Saturday
Ranges, steps, and names are spelled out on the cheat sheet.
Questions this schedule raises
Is 0 12 * * 0 Sunday or Monday?
Sunday. The fifth field counts days from Sunday: 0 Sunday, 1 Monday, through 6 Saturday, with 7 as an alias for Sunday. To run Monday at noon, write 1.
How do I run every Sunday at noon in a specific timezone?
Set the host timezone, or CRON_TZ on daemons that support it, then 0 12 * * 0 fires at noon local. Remember the schedule follows the wall clock: during daylight saving the UTC moment shifts by an hour, and that is usually what a weekly digest wants.