Cron: Weekly
The cron expression for "weekly", what each field means, and the next run times on your clock.
What is the cron expression for once a week?
0 0 * * 0 runs once a week, at midnight on Sunday. Minute 0 and hour 0 set the time, the two wildcards cover day of month and month, and the final 0 selects Sunday. Change that last field to 1 for Monday, matching @weekly's Sunday default in crontab(5).
0 0 * * 0At 12:00 AM, only on Sunday
- …
- …
- …
- …
- …
Day-of-week numbering, the field everyone second-guesses
POSIX cron numbers the week 0 through 6 starting at Sunday, and Vixie cron additionally accepts 7 as a second spelling of Sunday, so 0 0 * * 0 and 0 0 * * 7 are interchangeable on Linux. Three-letter names work too: 0 0 * * SUN reads better in a crontab that other engineers will maintain. For a Monday schedule use 1 or MON, and 1-5 covers the working week.
The numbering trips people coming from other ecosystems. ISO 8601 calls Monday day 1 and Sunday day 7, while Quartz numbers Sunday as 1 through Saturday as 7, so a schedule copied between systems can silently land on the wrong day.
What belongs on a weekly cadence
Weekly is the natural interval for work that summarizes or resets: Monday-morning digest emails queued the night before, full database backups that anchor a week of incrementals, dependency-audit and vulnerability scans, and repacking or vacuuming storage that fragments slowly. Sunday midnight is popular precisely because traffic is at its weekly floor for most B2B systems.
One structural warning applies when you extend this pattern. In Vixie cron, filling in both day of month and day of week makes them a logical OR, so 0 0 1 * 0 fires on the 1st and on every Sunday, not only on Sundays that fall on the 1st. Keep one of the two fields as * and the schedule stays unambiguous.
Frequently asked
- Does 7 mean Sunday too?
- In Vixie cron and its descendants, yes: both 0 and 7 select Sunday in the day-of-week field. Strict POSIX only specifies 0 through 6, so if a crontab must be portable to older System V crons, write Sunday as 0.
- How do I run weekly on Monday at 9am?
- Use 0 9 * * 1. Minute 0 and hour 9 set the time to 09:00 local, and day-of-week 1 selects Monday. The name form 0 9 * * MON is equivalent in Vixie cron and easier to read at a glance.
- Which day does @weekly run on?
- Sunday. The crontab(5) man page defines @weekly as 0 0 * * 0, midnight at the start of Sunday. If your team's week starts on Monday, skip the nickname and write 0 0 * * 1 explicitly.
More in this series
// The subscription desk
The Inference Report
The weekly briefing for AI engineers: model releases, pricing moves, benchmarks, and the news that changes what you should build with and what it costs. Every Tuesday, 5-minute read. No fluff.
Join AI engineers who stopped overpaying for tokens. Unsubscribe anytime.