Cron Expression for Every 12 Hours
0 */12 * * *At 0 minutes past the hour, every 12 hours. Twice-daily database dumps or dependency vulnerability scans.
Field-by-field breakdown
| Field | Value | Allowed range | Meaning |
|---|---|---|---|
| Minute | 0 | 0–59 | at minute 0 |
| Hour | */12 | 0–23 | every 12 hours |
| Day of month | * | 1–31 | every day of the month |
| Month | * | 1–12 | every month |
| Day of week | * | 0–6 (Sunday = 0) | every day of the week |
Next 5 runs (your time zone)
Calculating upcoming runs…
Cron uses the time zone of the machine or scheduler that runs it, which is often UTC on servers.
How to use this schedule
crontab
0 */12 * * * /path/to/script.sh >> /var/log/job.log 2>&1Kubernetes CronJob
apiVersion: batch/v1
kind: CronJob
metadata:
name: my-job
spec:
schedule: "0 */12 * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: my-job
image: busybox
command: ["sh", "-c", "echo running"]
restartPolicy: OnFailureGitHub Actions
on:
schedule:
- cron: '0 */12 * * *' # UTCFrequently Asked Questions
What is the cron expression for every 12 hours?
Use "0 */12 * * *". In plain English: At 0 minutes past the hour, every 12 hours.
What does "0 */12 * * *" mean?
Minute: at minute 0; Hour: every 12 hours; Day of month: every day of the month; Month: every month; Day of week: every day of the week.