Xerobit

Cron Every 12 Hours: 0 */12 * * *

The cron expression for every 12 hours is 0 */12 * * *. It runs 2 times per day, and the table below explains every field.

  • Cron expression
    0 */12 * * *
  • Schedule
    every 12 hours
  • Runs per day
    2
  • Runs per 30 days
    60
  • systemd OnCalendar
    *-*-* 0/12:00:00
  • AWS EventBridge
    cron(0 0/12 * * ? *)

What 0 */12 * * * means

FieldValueMeaning
Minute0at minute 0
Hour*/12every 12th hour, starting at hour 0
Day of month*every day
Month*every month
Day of week*every day of the week

The five fields of a standard cron expression are, in order: minute, hour, day of month, month and day of week.

When every 12 hours runs

The first run times in a day are: 00:00, 12:00. Over time that is 2 per day, 14 per week, about 60 per 30 days and 730 per year.

Copy-ready syntax for every 12 hours

crontab

0 */12 * * * /path/to/script.sh >> /var/log/job.log 2>&1

GitHub Actions

on:
  schedule:
    - cron: '0 */12 * * *'

GitHub Actions runs scheduled workflows in UTC and may start them a few minutes late when GitHub is busy.

Kubernetes CronJob

apiVersion: batch/v1
kind: CronJob
spec:
  schedule: "0 */12 * * *"
  concurrencyPolicy: Forbid

Setting concurrencyPolicy: Forbid stops a new run from starting while the previous one is still going.

systemd timer

[Timer]
OnCalendar=*-*-* 0/12:00:00
Persistent=true

AWS EventBridge

cron(0 0/12 * * ? *)

EventBridge cron has six fields and needs a ? in either the day-of-month or the day-of-week field. The simpler rate(12 hours) form works for fixed intervals.

When to use every 12 hours

Geographic database mirrors synchronize their full state every twelve hours to maintain disaster recovery readiness. Scientific computing clusters rotate long running simulation checkpoints twice daily to preserve progress without excessive storage costs.

What can go wrong

A failure during one of these infrequent runs means waiting another twelve hours for the next automatic attempt. Manual intervention becomes necessary to avoid extended periods where the backup remains dangerously out of date.

Cron uses the time zone of the machine or service running it, so check whether that is UTC or local time before you rely on the clock times above.

Other common schedules

FAQ

What is the cron expression for every 12 hours?

Use 0 */12 * * *. It is the standard five-field form accepted by Linux crontab, Kubernetes CronJobs and GitHub Actions.

How many times a day does 0 */12 * * * run?

2 times per day, or 60 over 30 days.

How do I test a cron expression?

Build it in the cron builder, which explains each field in plain English and lists the next run times.

More cron