Tools › Cron examples › every Sunday at midnight
Cron expression for every Sunday at midnight
The cron expression for every Sunday at midnight is:
What it does
Runs at 00:00 on Sunday. Both 0 and 7 mean Sunday.
Field by field
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | exactly 0 |
| Hour | 0 | exactly 0 |
| Day of month | * | every value |
| Month | * | every value |
| Day of week | 0 | exactly 0 |
Typical uses
Weekly maintenance, full backups, or log archival.
Watch out for
Midnight 'on Sunday' means the very start of Sunday, which is the end of Saturday evening in people's minds.
Add it to your crontab
crontab -e, then add:
0 0 * * 0 /path/to/command >> /var/log/myjob.log 2>&1