How to run a cron job once a week, on Sunday or any other day
By TechCompare · Updated · How we check
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.
Calculator
Next runs of 0 0 * * 0
Example from Mon, Nov 9, 2026 at 8:00 AM.
- Sun, Nov 15, 2026 at 12:00 AM
- Sun, Nov 22, 2026 at 12:00 AM
- Sun, Nov 29, 2026 at 12:00 AM
- Sun, Dec 6, 2026 at 12:00 AM
- Sun, Dec 13, 2026 at 12:00 AM
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.
How this is calculated
Different cron implementations number weekdays differently. Some schedulers use 1-7 where 1 is Monday, so use 0 for Sunday when writing portable expressions.
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
Use 0 for Sunday, which avoids relying on the optional 7 alias across mixed systems. Vixie cron, cronie, and BusyBox map both 0 and 7 to Sunday, while some schedulers start at Monday=1. Listing Monday through Friday as 1-5 reads cleanly. Testing the expression on the target daemon is still a good check.
More Cron scenarios
Related guides
Frequently asked questions
How do I run a cron job once a week?
Is Sunday 0 or 7 in cron?
How do I run a cron job on weekdays only?
Related tools
Unix Timestamp
Convert between Unix timestamps and human-readable dates.
Use toolCHMOD Configurator
Calculate Linux file permissions using checkboxes or octal numbers, then view the matching symbolic notation.
Use toolText Encoding Converter
Convert text to Base64, binary, hex, URL encoding and HTML entities, and back again.
Use tool