Cron expression for weekends at 9 AM
Runs the job at 9 AM on Saturday and Sunday, and never on a working day.
0 9 * * 0,6
At 09:00 AM, only on Sunday and Saturday
Field by field
- Minute · 0–59
0only at minute 0 - Hour · 0–23
9only at 09:00 - Day of month · 1–31
*every day of the month - Month · 1–12 or JAN–DEC
*every month - Day of week · 0–7 or SUN–SAT
0,6only on Sunday and Saturday
Next runs in your local time
Why this schedule, and when it bites
Weekend maintenance is a scheduling decision as much as a syntax one: the cheapest window is when nobody is using the system and everyone is awake to notice if something went wrong. 0 9 * * 0,6 gives Saturday and Sunday morning runs, exactly the slot where a failed job can still be fixed before Monday.
0,6 and 6,7 are not the same list. 0 and 6 are Sunday and Saturday; 6 and 7 are Saturday and Sunday again, because 7 is Sunday's alias. Both lists work, but mixing them, as in 0,7, silently names one day twice.
A weekend failure waits two days for an audience. Saturday and Sunday runs fail into a quiet channel. Route weekend alerts to a phone, or accept that the Monday morning run is the first retry, which is fine for cleanup and not for billing.
Public holidays blur the edges. A company that gives a Monday off has three quiet days, not two. If the window matters, treat holidays inside the job; the cron expression cannot know the calendar.
Where this cron expression shows up
- Maintenance windows at a company that works Monday to Friday
- Digest emails that should land when the work queue is empty
- Cleanup jobs that must not compete with weekday traffic
Common variations
-
Weekends at noon instead
0 12 * * 0,6 At 12:00 PM, only on Sunday and Saturday
-
Weekdays at 9 AM, the other half of the week
0 9 * * 1-5 At 09:00 AM, Monday through Friday
-
Every day at 9 AM
0 9 * * * At 09:00 AM
Sunday answers to both 0 and 7 in the day-of-week field, so 0,6 and 7,6 name the same two days. Names travel better: SAT,SUN needs no memory of the numbering, and a crontab accepts them.
Ranges, steps, and names are spelled out on the cheat sheet.
Questions this schedule raises
Is Sunday 0 or 7 in this expression?
Both work: 0 9 * * 0,6 and 0 9 * * 7,6 name the same two days. Write the pair you read fastest; names such as SAT,SUN are also accepted by common crontabs.
Can I run on Saturdays only?
Yes: 0 9 * * 6, or 0 9 * * SAT. One list entry, one day, and the Sunday job stays absent, which is usually the point of a separate Saturday window.