Cron Expression: 0 2 * * 0
0 2 * * 0
Run every Sunday at 2am
Field Breakdown
| Value | Field | Meaning |
|---|---|---|
| 0 | minute | at minute 0 |
| 2 | hour | at 2am |
| * | day | any day |
| * | month | every month |
| 0 | weekday | Sunday (0 or 7) |
Sunday 2am is the classic maintenance window — low traffic, full week ahead to monitor the results. This pattern is commonly used for weekly database maintenance, full system backups, and OS update runs.
# Weekly full backup, Sunday 2am: 0 2 * * 0 flock -n /tmp/weekly-backup.lock /usr/local/bin/full-backup.sh # Weekly vacuum on PostgreSQL: 0 2 * * 0 psql -U postgres -c "VACUUM ANALYZE;" # Weekly OS security updates (unattended): 0 2 * * 0 /usr/bin/unattended-upgrade
Related Expressions
0 2 * * 0
Sunday 2am
0 2 * * 6
Saturday 2am
0 3 * * 0
Sunday 3am
0 2 * * 0,6
Weekend 2am
0 2 * * 7
Sunday 2am (7 also = Sunday)
Common Use Cases
- Weekly full backups
- Database VACUUM/ANALYZE
- Log archive and rotation
- OS security updates
- Weekly reports
Paste your crontab to visualise every job on a 24-hour timeline — detect overlaps, collisions, and get flock-safe versions.
Open Cron Visualiser →Frequently Asked Questions
Is 0 in the weekday field Sunday or Monday?
0 is Sunday. The weekday numbering is: 0=Sunday, 1=Monday, 2=Tuesday, 3=Wednesday, 4=Thursday, 5=Friday, 6=Saturday, 7=Sunday (7 is also accepted as Sunday for compatibility).
Why is 2am the standard maintenance window?
2am is typically the lowest traffic window for sites serving US and European timezones. It also gives time for maintenance to complete before business hours. For Asia-Pacific primary audiences, adjust to local off-peak hours.