Cron: Weekends Only
0 0 * * 0,6 runs only on Saturday and Sunday — the comma-separated list 0,6 in the day-of-week field selects exactly those two days, skipping the entire work week. It's useful for jobs that should specifically avoid weekday business hours, or for weekend-specific features and promotions.
0 0 * * 0,6
Examples & Variations
Common Mistakes
- Using a range (6-0) instead of a list (0,6) — ranges in cron don't wrap around the week boundary, so 6-0 is invalid or behaves unexpectedly depending on the implementation; a comma-separated list is the correct, portable way to select non-contiguous days.
- Assuming weekends are automatically low-traffic — for consumer, gaming, and e-commerce apps, weekends are frequently peak usage windows, the opposite of typical B2B patterns.
- Forgetting on-call coverage for weekend-only jobs — if the team's usual support rhythm is weekday-focused, a Saturday failure might not get attention until Monday.
Best Practices
- Use the explicit list form (0,6) rather than trying to express 'Saturday through Sunday' as a range, since cron ranges don't wrap.
- If the job is meant to run specifically because weekday hours should be avoided (e.g. heavy migrations), weekends-only is exactly the right pattern.
- Double check your actual weekend traffic profile before assuming it's a safe low-load window — verify with real usage data rather than convention.
Frequently Asked Questions
- Why 0,6 instead of 6,0 or a range?
- Order doesn't matter in a comma-separated list (0,6 and 6,0 are equivalent), but a range like 6-0 is problematic since cron ranges don't wrap from the end of the week back to the start — always use a list for non-contiguous day selections like this.
- Can I run a job every hour but only on weekends?
- Yes — combine an hour wildcard or range with the weekend day list: 0 * * * 0,6 runs hourly, but only Saturday and Sunday.
- How is this different from 'every Saturday' or 'every Sunday' alone?
- Those use a single day-of-week value (0 0 * * 6 or 0 0 * * 0), firing once a week on just that day. Weekends-only (0,6) fires on both days, twice as often overall.