Run a Cron Job Every Sunday

Runs at midnight every Sunday.

crontab -e
00**0
$0 0 * * 0

Field Breakdown

0

Minute

0–59

0

Hour

0–23

*

Day of Month

1–31

*

Month

1–12

0

Day of Week

0–6

How It Works

Setting day-of-week to 0 (Sunday) with hour and minute at 0 creates a weekly schedule. Weekly crons are standard for maintenance windows, summary reports, and cleanup routines that do not need to run daily. Sunday midnight is the most common choice because it falls during the lowest-traffic period for most services.

The minute and hour are both 0 (midnight), and the day-of-week is set to 0, which represents Sunday in standard cron. Day-of-month and month are wildcards. The job fires once per week, specifically at the transition from Saturday night to Sunday morning. Some cron implementations also accept 7 for Sunday.

Platform Usage

Linux: "0 0 * * 0 /opt/maintenance/weekly-cleanup.sh". Kubernetes CronJob with schedule: "0 0 * * 0" and successfulJobsHistoryLimit: 4 to keep the last month of job history. In GitLab CI, configure a pipeline schedule with this cron expression for weekly security scans.

Common Use Cases

1

Weekly database maintenance and optimization

2

Sending weekly summary reports

3

Running full system backups

4

Cleaning up old logs and temp data

try-it

$ crongen --customize "0 0 * * 0"

Want to tweak this schedule or see the next run times?

Open in Generator

Related Examples