Run a Cron Job Every Day at Midnight
0 0 * * * pins the minute and hour to zero and leaves the rest as wildcards: once a day at 00:00. It's the canonical nightly schedule for backups, log rotation, and daily aggregation — and also the single most congested minute of the day on shared systems.
0 0 * * *In plain English: At 00:00 (midnight), every day.
Field by field
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | 0 |
| Hour | 0 | 0 |
| Day of month | * | every day |
| Month | * | every month |
| Day of week | * | every weekday |
Variations
23 1 * * *nightly at 01:23 — a quieter slot than exactly midnight0 0 * * 1-5midnight on weekdays only0 12 * * *daily at noon insteadTweak any of these in the crontab explainer to see the schedule in plain English and its next run times.
Frequently asked questions
Is 0 0 * * * the same as @daily?
Yes — most cron implementations accept @daily (and @midnight) as an alias for 0 0 * * *. The five-field form works everywhere, including schedulers that don't support @ shortcuts.
What happens during daylight-saving changes?
Midnight usually exists on both DST transition days, but jobs scheduled between 01:00 and 03:00 can be skipped or run twice depending on the direction of the shift and your cron implementation. Keep critical nightly jobs outside the DST window or run them in UTC.
New to cron syntax? Read Cron Expressions Explained, Field by Field.