Cron Expression: 0 0 * * *

0 0 * * * Run once a day at midnight

Field Breakdown

ValueFieldMeaning
0minuteat minute 0
0hourat hour 0 (midnight)
*dayevery day
*monthevery month
*weekdayevery weekday

Midnight is the most overloaded minute in any server's cron schedule. Backups, cleanups, reports, cache clears — they all default to 0 0 * * *. A server with five midnight jobs experiences a simultaneous I/O and CPU spike at 00:00 every night.

The load spike fix

# Spread midnight jobs across 30 minutes:
0  0 * * * flock -n /tmp/backup.lock    /usr/local/bin/backup.sh
5  0 * * * flock -n /tmp/cleanup.lock   /usr/local/bin/cleanup.sh
15 0 * * * flock -n /tmp/report.lock    /usr/local/bin/report.sh
25 0 * * * flock -n /tmp/db-dump.lock   /usr/local/bin/db-dump.sh

Timezone note

Cron runs in the server's local timezone. If your server is UTC and your users are in a different timezone, "midnight" may not be the quiet window you expect. Check with timedatectl.

Related Expressions

0 0 * * *
Midnight every day
0 1 * * *
1am every day
0 2 * * *
2am every day (common for backups)
0 0 * * 0
Midnight every Sunday
30 23 * * *
11:30pm every day

Common Use Cases

Paste your crontab to visualise every job on a 24-hour timeline — detect overlaps, collisions, and get flock-safe versions.

Open Cron Visualiser →

Frequently Asked Questions

Why do all my cron jobs run at midnight?
It's the most common default. When setting up a job without a specific time requirement, developers choose 0 0 * * *. When multiple jobs pile up at the same minute, the server CPU and disk I/O spike simultaneously. Stagger jobs by at least 5 minutes.
How do I run a cron job at a random time around midnight?
Cron doesn't support randomisation natively. Use: 0 0 * * * sleep $((RANDOM % 1800)) && /path/to/script.sh to add a random 0–30 minute delay. This spreads load across servers in a fleet.