Cron Expression
0 0,12 * * *
Learn how to create a cron expression for 'cron twice a day'. Runs at midnight and noon, 12 hours apart, with our free cron generator tool.
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | At minute 0 |
| Hour | 0,12 | At hours 0,12 |
| Day of Month | * | Any day |
| Month | * | Any month |
| Day of Week | * | Any day of the week |
This cron expression represents: cron twice a day
0 0,12 * * *
Runs twice per day — at midnight (00:00) and noon (12:00) — exactly 12 hours apart. The comma in the hour field is a value list: “at hour 0 and at hour 12.”
Twice-daily is a sweet spot when hourly is wasteful but daily is too stale:
crontab -e
0 0,12 * * * /path/to/your/script.sh
The list syntax takes any pair of hours: 0 6,18 * * * runs at 6am and 6pm; 30 9,21 * * * runs at 9:30am and 9:30pm. The two runs don’t need to be 12 hours apart — 0 8,17 * * * (start and end of the workday) is perfectly valid.
0 */12 * * * — equivalent to 0 0,12 * * *, since */12 selects hours 0 and 120 0,12 * * 1-5
0 0,12 * * * /path/to/script.sh >> /var/log/cron.log 2>&1