0 0 * * 0Fields
| Minute | 0 | 0 |
|---|---|---|
| Hour | 0 | 0 |
| Day of month | * | any |
| Month | * | any |
| Day of week | 0 | 0 |
Where to use it
| crontab | 0 0 * * 0 /path/to/script.sh |
|---|---|
| GitHub Actions | - cron: "0 0 * * 0" (on.schedule) |
| Kubernetes CronJob | schedule: "0 0 * * 0" |
crontab runs in the server’s time zone; GitHub Actions always uses UTC.
Good to know
0 0 * * 0 runs at midnight at the start of Sunday, right after Saturday ends. If you meant Sunday evening, the end of the week, use 0 23 * * 0, or 0 0 * * 1 for Monday 00:00. Both 0 and 7 mean Sunday in Vixie cron and cronie, and @weekly equals 0 0 * * 0. Quartz-based schedulers number days 1 to 7 with Sunday as 1, so check before copying.
Weekly jobs fail quietly: if the server was down at midnight on Sunday, cron doesn’t catch up and you wait another week, whereas anacron or a systemd timer with Persistent=true runs missed jobs after boot. Weekly maintenance often runs long, so use flock -n, log output, and add a heartbeat monitor. For every other Sunday, check the week number from date +\%V inside the command.