Cron Every Weekend
Set up a cron job to run every weekend (Saturday and Sunday) at midnight with 0 0 * * 0,6. Detailed field breakdown and weekend use cases.
Cron Expression
0 0 * * 0,6
Field Breakdown
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | At 0 |
| Hour | 0 | At 0 |
| Day of Month | * | Every day of the month (1–31) |
| Month | * | Every month (1–12) |
| Day of Week | 0,6 | At Sunday, Saturday |
Detailed Explanation
The cron expression 0 0 * * 0,6 schedules a task to run at midnight on both Saturday and Sunday.
Field-by-field breakdown:
0(Minute): At minute 0. The task fires at the start of the hour.0(Hour): At hour 0 (midnight). The task runs at the beginning of each weekend day.*(Day of Month): Every day from 1 through 31. No restriction on the day of the month.*(Month): Every month from January through December. No restriction on the month.0,6(Day of Week): Sunday (0) and Saturday (6). The comma-separated list specifies both weekend days.
This means your task will execute twice per week, once at the start of Saturday and once at the start of Sunday. Weekend scheduling is valuable for maintenance tasks that cannot run during business hours, such as major database migrations, full system backups, or infrastructure updates. With minimal user traffic on weekends, these jobs can use more system resources without impacting the user experience. This expression is supported by standard cron on Linux/macOS, as well as cloud services like AWS CloudWatch, Google Cloud Scheduler, and GitHub Actions.
Use Case
Useful for running intensive database maintenance operations like table reorganization and index rebuilds during low-traffic weekend periods.
Try It — Interactive Builder
Every weekend at 12:00 AM
Next 10 Executions
Ctrl+Shift+C to copy expression