Cron example
Cron Every Weekend
Two runs a week, at midnight on Saturday and again at midnight on Sunday. The weekend is the one common schedule that cannot be written as a range, because it wraps around the end of cron's week — which starts at Sunday and ends at Saturday, putting the two weekend days at opposite ends of the field.
By NaveenKumar T · Updated · 5-field crontab expression
What each field means
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | Minute 0 |
| Hour | 0 | Hour 0 |
| Day of month | * | Every day |
| Month | * | Every month |
| Day of week | 6,0 | Saturday and Sunday |
Next 5 run times
Computing the next runs in your timezone…
Why 6-0 does not work
Ranges in cron must ascend. Saturday is 6 and Sunday is 0, so the weekend spans the wrap point of the field and 6-0 is either rejected outright or silently interpreted as an empty or nonsensical set, depending on the parser. The list form 6,0 sidesteps the problem entirely by naming both days.
Some implementations accept 6-7, exploiting the fact that 7 is an alias for Sunday, and that does produce Saturday and Sunday. It is clever and portable to roughly nowhere. Prefer the explicit list, or the named form 0 0 * * SAT,SUN, which no reader can misinterpret.
What runs on the weekend
Weekend-only schedules are for work that needs an idle system and does not need supervision: full backups, deep integrity checks, rebuilding search indexes, archiving cold data, compacting logs, and testing that your restore procedure actually restores. Two runs a week also gives a failed Saturday attempt a second chance on Sunday.
The inverse pattern is just as useful. If a job should skip the weekend, restrict the weekday field to 1-5 instead — that is the difference between weekday-only schedules and this one, expressed in the same field.
Adjusting the pattern
For a single weekend run instead of two, pick Saturday or Sunday alone. For a different hour, change the second field: 0 2 * * 6,0 waits until the small hours when Friday and Saturday evening traffic has drained.
For weekend coverage at intervals rather than once a day, combine the list with a stepped minute or hour field, as in 0 */4 * * 6,0 for six runs on each weekend day. Every field narrows the schedule independently, so the weekend restriction composes with anything else you need.
Build a variant of this schedule with dropdowns and check the next ten runs before you install it.
Open the cron generatorRelated cron examples
Browse every schedule on the cron expression generator, read the cron expression syntax guide for the rules behind the five fields, or the developer tools guides for the longer explanations.