How 0 */12 * * * Works
In standard five-field POSIX Cron, 0 */12 * * * breaks down as follows:
- Minute (0): Exactly at minute 0 (on the hour).
- Hour (*/12): Starting from hour 0, every 12 hours (matching hours 0 and 12 in 24-hour time).
- Day of Month (*): Every day of the month.
- Month (*): Every month of the year.
- Day of Week (*): Every day of the week (Sunday through Saturday).
Because the minute field is set to 0, the job executes exactly twice per 24-hour day: at 00:00 (12:00 AM midnight) and 12:00 (12:00 PM noon).
How to Run Every 12 Hours Starting at a Specific Time
Standard step syntax */12 always anchors at hour 0. If you need a 12-hour cadence that starts at a specific hour to avoid peak traffic or align with business shifts, specify the exact hour pair in the hour field:
0 6,18 * * *Runs at 6:00 AM and 6:00 PM0 1,13 * * *Runs at 1:00 AM and 1:00 PM0 9,21 * * *Runs at 9:00 AM and 9:00 PM0 3,15 * * *Runs at 3:00 AM and 3:00 PM