buildcron

Cron Expression for Every Saturday

To run a cron job every Saturday, use 0 0 * * 6. It runs once a week at 00:00 on Saturday — day 6, the last day of cron's Sunday-first week.

CRON → ENGLISH
0 minute0 hour* day of month* month6 day of week
VALID EXPRESSION

At 12:00am on Saturday.

0 0 * * 6

Standard 5-field crontab syntax. Day of month and day of week are OR'd when both are set.

NEXT 5 RUN TIMES · local time

What it does

The expression fixes the time at midnight with 0 0, leaves the day of month and month open, and restricts the day of week to 6. Only one minute a week matches all five fields: the moment Friday night becomes Saturday.

Saturday is the quietest day for many business systems, so it's the traditional slot for long-running maintenance: full database backups with integrity checks, rebuilding indexes, compacting or vacuuming tables, re-encrypting data with a rotated key, or running a full vulnerability scan. A job that would slow production during the week can take hours on a Saturday without anyone noticing.

That quiet has a cost: if a Saturday job fails, nobody may see the alert until Monday. Make sure failures reach someone — set [email protected] at the top of the crontab so cron emails any output, if the server can send mail — and choose a time like 0 2 * * 6 that leaves room to rerun the job the same weekend.

If several weekly maintenance tasks share the night, stagger them rather than starting them all at 00:00 — 0 1 * * 6 for the backup and 0 3 * * 6 for the index rebuild, say — so each one has the machine to itself and a slow backup can't leave the rebuild fighting it for disk.

How 0 0 * * 6 works, field by field

FIELDVALUEMEANING
Minute0minute 0
Hour0hour 0 (midnight)
Day of month*every day of the month
Month*every month
Day of week6Saturday

Put together, cron reads 0 0 * * 6 as: “At 12:00am on Saturday.

To see further ahead, paste the expression into the cron calculator, which lists the next ten run times and counts how many times the schedule runs in a year.

Frequently asked questions

When does “Saturday midnight” run in cron?

0 0 * * 6 runs at the very start of Saturday, straight after 23:59 on Friday. If you mean the end of Saturday, schedule 00:00 on Sunday instead: 0 0 * * 0.

Is Saturday 6 or 7 in cron?

Saturday is 6. The day of week field starts at 0 for Sunday; 7 is an alternative number for Sunday, not for Saturday.

How do I stop a long Saturday job from hanging all weekend?

Put a time limit on it with coreutils' timeout: 0 2 * * 6 timeout 6h /path/to/job stops the job if it's still running after six hours, so a hung run can't block the rest of the weekend.