Cheat Sheets · Cron Cheat Sheet · Cron Every Sunday at Midnight — Crontab Example
Cron Every Sunday at Midnight — Crontab Example
0 0 * * 0
Runs once a week on Sunday at 00:00 (midnight).
Field by field
| Field | Value | Meaning |
|---|---|---|
Minute | 0 | At minute 0 |
Hour | 0 | At midnight (00:00) |
Day of month | * | Every day of the month |
Month | * | Every month |
Day of week | 0 | Sunday only |
Sunday midnight is the standard timestamp for weekly rollups, log archives, and database vacuuming. The shorthand @weekly expands to this exact schedule.
0 0 * * 0 /usr/local/bin/weekly-maintenance.sh
Related schedules
FAQ
Is 0 0 * * 7 the same as 0 0 * * 0?
Yes, in most implementations both 0 and 7 represent Sunday. However, 0 is the POSIX standard.
Is @weekly identical to 0 0 * * 0?
Yes, @weekly is the standardized shorthand.
What if I want Sunday at 11 PM?
Write 0 23 * * 0.
Stop memorizing — build it interactively
Try this schedule in the Cron EditorFull reference: Cron Cheat Sheet