Cron Expression for Every 12 Hours
To run a cron job every 12 hours, use 0 */12 * * *. It runs twice a day — at 00:00 and 12:00 — exactly like writing 0 0,12 * * *.
At minute 0 of every 12th hour.
0 */12 * * *Standard 5-field crontab syntax. Day of month and day of week are OR'd when both are set.
What it does
In the hour field, */12 keeps every twelfth hour from 0–23, which leaves just 0 and 12; the 0 in the minute field makes both runs happen on the hour. Because the result is only two values, many people find the explicit list 0 0,12 * * * easier to read, and it makes changing the times obvious.
A twice-daily rhythm works well for jobs tied to the start and middle of the day: sending a morning and afternoon summary, reconciling payments from a provider that settles twice a day, refreshing a price list, or checking disk usage and warning before a volume fills up. It halves the load of a six-hourly job while still catching problems the same day.
The two runs don't have to be at midnight and noon. Any pair of hours 12 apart keeps the spacing even — 0 7,19 * * * runs at 7am and 7pm, which is often a better fit for jobs whose output people read at the start and end of the working day.
How 0 */12 * * * works, field by field
| FIELD | VALUE | MEANING |
|---|---|---|
| Minute | 0 | minute 0 |
| Hour | */12 | every 12 hours (0 and 12) |
| Day of month | * | every day of the month |
| Month | * | every month |
| Day of week | * | every day of the week |
Put together, cron reads 0 */12 * * * as: “At minute 0 of every 12th hour.”
To see further ahead, paste the expression into the cron calculator, which lists the next ten run times and counts how many times the schedule runs in a year.
Frequently asked questions
How do I run a cron job twice a day?
List the two hours in the hour field: 0 9,21 * * * runs at 9:00 and 21:00. 0 */12 * * * is a special case of the same idea that always uses midnight and noon.
Does 0 */12 * * * run 12 hours after the job starts?
No. It always runs at 00:00 and 12:00 on the server's clock. If you need runs 12 hours apart counted from a start time, use a systemd timer with OnUnitActiveSec=12h.
What does 0 0 */12 * * mean?
That's a different schedule: the step is in the day of month field, so it runs at midnight on days 1, 13 and 25 of each month. Check which field the */12 sits in before copying an expression.