Cron Every Weekend
The 6,0 list in the day-of-week field means Saturday (6) and Sunday (0). With 0 0 in the minute and hour fields, the job runs at midnight on both weekend days and skips weekdays.
Cron Expression
0 0 * * 6,0Field Breakdown
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | At minute 0 |
| Hour | 0 | At midnight (00:00) |
| Day of Month | * | Every day of the month |
| Month | * | Every month (1-12) |
| Day of Week | 6,0 | Saturday and Sunday |
Variations
0 0 * * 6,0Every Saturday and Sunday at midnight0 3 * * 6,0Every weekend day at 3 AM (maintenance window)0 0 * * 6-7Saturday and Sunday using a range (7 = Sunday)Common Use Cases
- Heavy maintenance that should only run on low-traffic days
- Weekend-only batch processing and large backups
- Catch-up jobs that defer to the weekend
Tips & Best Practices
Saturday is 6 and Sunday is 0 (or 7), so the weekend is 6,0 or 6-7.
Weekends are ideal for resource-intensive jobs that would slow weekday traffic.
Names also work: 0 0 * * SAT,SUN.