Tools › Cron examples › every Sunday at midnight

Cron expression for every Sunday at midnight

The cron expression for every Sunday at midnight is:

0 0 * * 0

What it does

Runs at 00:00 on Sunday. Both 0 and 7 mean Sunday.

Field by field

FieldValueMeaning
Minute0exactly 0
Hour0exactly 0
Day of month*every value
Month*every value
Day of week0exactly 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

Related schedules

every minuteevery 5 minutesevery 10 minutesevery 15 minutesevery 30 minutesevery hourevery 2 hoursevery day at midnightevery day at 3amevery weekday at 9amevery 15 minutes during business hoursevery Mondayon weekendson the first day of every monthon the last day of the monthevery quartertwice a day
Copied to clipboard