NV ToolkitFormat · Validate · Convert

Cron example

Cron Twice a Day

0 0,12 * * *

At 12:00 AM and 12:00 PM, every day

Open in the cron expression generator

A comma-separated list in the hour field: run at hour 0 and again at hour 12, every day. Two runs, twelve hours apart. Lists are the most under-used piece of cron syntax and the cleanest way to express a schedule whose times are not evenly spaced.

By NaveenKumar T · Updated · 5-field crontab expression

What each field means

Minute, hour, day of month, month, day of week — read left to right.
FieldValueMeaning
Minute0Minute 0
Hour0,12Hours 0 and 12
Day of month*Every day
Month*Every month
Day of week*Every day of the week

Next 5 run times

Computing the next runs in your timezone…

Lists, and why they beat two crontab lines

Any field accepts a comma-separated list, and cron fires when the current value matches any entry. Here that is hours 0 and 12; it could just as easily be 0 6,14,22 * * * for three runs or 0 9,13,17 * * * for a working-day rhythm. The entries do not have to be evenly spaced, which is exactly what a step value cannot express.

Writing one line with a list instead of two lines with the same command means one place to edit, one place to change the script path, and no chance of the two copies drifting apart during a refactor. It also makes the intent obvious to the next reader: this is one job with two run times, not two jobs that happen to share a command.

Evenly spaced? Use a step instead

When the times are evenly spaced and start at zero, the step form is shorter and self-documenting: 0 */12 * * * is the same midnight-and-noon schedule as the list. The list wins the moment the times are irregular, or when the reader benefits from seeing the actual hours rather than doing arithmetic.

Combining the two is legal and occasionally useful. 0 0,12 * * 1-5 keeps both daily runs but only on weekdays; 0 0,12 1,15 * * runs twice a day on the 1st and 15th only. Each field narrows the schedule independently, and the job fires when every field matches.

Picking the two hours

Midnight and noon are conventional but rarely optimal. If the job is a sync, one run should land just after your upstream publishes and the other should give you a recovery window before the working day ends — something like 0 5,15 * * * often fits reality better.

Whatever pair you choose, keep both runs idempotent. Twice-daily jobs are usually catch-up jobs, and the second run of the day will frequently reprocess what the first one already handled. If that is unsafe, the schedule is not the problem — the job is.

Build a variant of this schedule with dropdowns and check the next ten runs before you install it.

Open the cron generator

Related cron examples

Browse every schedule on the cron expression generator, read the cron expression syntax guide for the rules behind the five fields, or the developer tools guides for the longer explanations.