Cheat Sheets · Cron Cheat Sheet · Cron Midnight and Noon — Crontab Example
Cron Midnight and Noon — Crontab Example
0 0,12 * * *
Runs twice daily — at 00:00 (midnight) and 12:00 (noon).
Field by field
| Field | Value | Meaning |
|---|---|---|
Minute | 0 | At minute 0 |
Hour | 0,12 | At 00:00 and 12:00 |
Day of month | * | Every day |
Month | * | Every month |
Day of week | * | Every day of the week |
The expression 0 0,12 * * * clearly states both target hours in a list. It is identical in execution to 0 */12 * * * but many engineers prefer the explicit hour listing for readability.
0 0,12 * * * /usr/local/bin/half-day-rollup.sh
Related schedules
0 */12 * * * Step syntax (identical)
0 9,18 * * * Twice a day (9 AM & 6 PM)
0 0 * * * Daily at midnight
FAQ
Why use 0,12 instead of */12?
Both work identically. Writing 0,12 makes the exact hours immediately obvious without mental step calculation.
Can I add a third time, like 6 PM?
Yes: simply write 0 0,12,18 * * *.
Can I offset the minutes?
Yes: 15 0,12 * * * fires at 00:15 and 12:15.
Stop memorizing — build it interactively
Try this schedule in the Cron EditorFull reference: Cron Cheat Sheet