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

FieldValueMeaning
Minute0At minute 0
Hour0At midnight (00:00)
Day of month*Every day of the month
Month*Every month
Day of week0Sunday 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 Editor

Full reference: Cron Cheat Sheet