How to run a cron job weekly: Sunday midnight and other weekly patterns
0 0 * * 0 runs a job every Sunday at midnight. The fifth field (0-6 or 0-7 depending on the cron implementation) controls the day of the week. Sunday is 0 (and sometimes 7), Monday is 1, Saturday is 6. This is the pattern for weekly reports, SSL certificate renewal checks, and full backups.
How this is calculated
Different cron implementations number weekdays differently. Vixie cron (standard Linux) uses 0-7 where both 0 and 7 are Sunday. BusyBox cron uses 0-6 where 0 is Sunday. Some enterprise schedulers use 1-7 where 1 is Monday. When writing portable cron expressions, avoid relying on 7 for Sunday. For multiple days, list or range them: 0 0 * * 1-5 runs Monday through Friday. For every other day, cron alone can't express that cleanly. Use a wrapper script that checks the date.
Verdict
0 0 * * 0 for weekly Sunday execution is the safest portable choice. If weekday numbering ambiguity matters (containers, embedded systems), test the expression on the target cron daemon before deploying to production.
More Cron scenarios
Frequently asked questions
What is a Cron Job?
What do the 5 parts of a cron expression mean?
What does the asterisk (*) mean in Cron?
How do I run a task every 5 minutes?
Related tools
Unix Timestamp
Convert between Unix timestamps and human-readable dates.
Use tool ➜CHMOD Configurator
Calculate Linux file permissions using checkboxes, octal numbers, or symbolic notation.
Use tool ➜Text Encoding Converter
Convert between Text, Base64, Binary, Hexadecimal, and Decimal formats.
Use tool ➜