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.

  1. Sun, Nov 15, 2026 at 12:00 AM
  2. Sun, Nov 22, 2026 at 12:00 AM
  3. Sun, Nov 29, 2026 at 12:00 AM
  4. Sun, Dec 6, 2026 at 12:00 AM
  5. 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.

Schedule pattern
Weekly schedule
weekly
Category
Common Patterns
Standard cron expression patterns

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

Every 5 minutes
Running a cron job every 5 minutes uses the step operator in the minute field: */5 * * * *.
View details
Every hour
To run a job at the top of every hour, use 0 * * * *.
View details
Daily at midnight
0 0 * * * runs a job at exactly midnight (00:00) every day.
View details

Frequently asked questions

How do I run a cron job once a week?
Use 0 0 * * 0 for Sunday at midnight. The fifth field is the day of week, numbered 0-6 (or 0-7 on many Linux crons, where both 0 and 7 mean Sunday). Monday is 1, Saturday is 6. Weekly reports, SSL certificate renewal checks, and full backups are the typical weekly jobs.
Is Sunday 0 or 7 in cron?
Vixie cron and cronie accept both 0 and 7 for Sunday. BusyBox crond maps 7 to 0 as well. Some schedulers number Monday as 1, so use 0 for Sunday when you need a portable expression.
How do I run a cron job on weekdays only?
Use a range in the day-of-week field: 0 9 * * 1-5 runs at 9 AM Monday through Friday. Multiple specific days work with a comma list, like 0 9 * * 1,3,5 for Monday, Wednesday, and Friday. The day-of-week and day-of-month fields combine with OR logic, so be careful mixing them: 0 0 1 * 1 runs on the 1st of the month and every Monday.