Run Jobs Every Twelve Hours at 6 AM and 6 PM | CronBase

cron expression Standard
$ 0 6,18 * * *

Twice daily at six in the morning and six in the evening.

The `0 6,18 * * *` cron expression schedules a task to execute twice every day at exactly 6:00 AM and 6:00 PM (18:00) in the system's local timezone. This twelve-hour interval is commonly used for morning readiness checks, shift-change reporting, and twice-daily database backups.

Minute
0
Hour
6,18
Day of Month
*
Month
*
Day of Week
*
How it works

Next 5 Runs

  • in 9h 17m
  • in 21h 17m
  • in 1d 9h
  • in 1d 21h
  • in 2d 9h

* Tools

Code & Implementations

Bash
# Add to crontab using: crontab -e
# Runs at 6:00 AM and 6:00 PM daily. Logs output and errors to a file.
0 6,18 * * * /usr/local/bin/backup_script.sh >> /var/log/backup_cron.log 2>&1
Setup notes

Open your system's crontab editor, paste the configuration line, and ensure the script is marked executable with chmod +x.

Last verified:

Partner BetterStack

Monitor this schedule in production

Get alerted the moment this cron job fails, is late, or doesn't run. BetterStack tracks execution, duration, and output — no infrastructure required.

Platform Equivalents

AWS EventBridge

Standard cron expressions often need conversion for AWS EventBridge schedules.

EventBridge Rule
cron(0 6,18 * * ? *)

Systemd Timer

OnCalendar*-*-* 06,18:00:00

my-task.timer
[Unit]
Description=Timer for cron expression: 0 6,18 * * *

[Timer]
OnCalendar=*-*-* 06,18:00:00
Persistent=true

[Install]
WantedBy=timers.target

Last verified:

Frequently Asked Questions

How does Daylight Saving Time (DST) affect this twice-daily schedule?

During DST transitions, the local time jumps. In spring, if the transition occurs at 2 AM, your 6 AM and 6 PM jobs run normally but the interval between them might temporarily be 11 or 13 hours. Ensure your cron daemon (like systemd-cron or cronie) is configured to use UTC to maintain a strict 12-hour interval.

Can I stagger execution to avoid database connection spikes at 06:00 and 18:00?

Yes, you can introduce a random start delay (jitter) within your execution script. For example, in Bash, use `sleep $((RANDOM % 300))` to delay the start by up to 5 minutes, spreading the resource load across your cluster.

How do I run this schedule on AWS ECS or AWS EventBridge?

In AWS EventBridge, standard cron syntax is supported but requires 6 fields. You must convert `0 6,18 * * *` to `cron(0 6,18 * * ? *)` or `cron(0 6,18 ? * * *)` depending on the target resource, specifying UTC explicitly.

What is the best way to monitor if both executions succeeded?

Implement dead man's snitches or heartbeat monitoring (e.g., Healthchecks.io). Configure the monitoring service to expect a ping twice daily with a 12-hour period and a grace period of 15 minutes to account for execution delays.

How can I change this to run every 12 hours starting from midnight instead?

If you want to shift the 12-hour interval to start at midnight and noon, modify the expression to `0 0,12 * * *`. This keeps the same frequency but aligns with traditional calendar day splits.

* Explore

Related expressions you might need

Last verified:

Was this helpful?