Run Jobs Every Six Hours at Minute Zero | CronBase

cron expression Standard
$ 0 */6 * * *

At the start of every sixth hour, running four times a day.

The `0 */6 * * *` cron expression schedules a task to run exactly every six hours, specifically at the top of the hour. This means the job triggers four times a day, at midnight, six in the morning, noon, and six in the evening.

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

Next 5 Runs

  • in 3h 20m
  • in 9h 20m
  • in 15h 20m
  • in 21h 20m
  • in 1d 3h

* Tools

Code & Implementations

Bash
#!/bin/bash
# Production deployment script to install a 6-hour maintenance cron job
set -euo pipefail

CRON_JOB="0 */6 * * * /usr/local/bin/backup-cleanup.sh >> /var/log/backup-cleanup.log 2>&1"

# Safely add the job to crontab without duplicating existing entries
(crontab -l 2>/dev/null | grep -Fv "/usr/local/bin/backup-cleanup.sh"; echo "$CRON_JOB") | crontab -
echo "Cron job successfully deployed to crontab."
Setup notes

Save this script as deploy_cron.sh, make it executable with chmod +x, and run it. It safely injects the 6-hour schedule into the current user's crontab while avoiding duplicate entries.

Last verified:

Partner UptimeRobot

Keep this cron job monitored 24/7

UptimeRobot alerts you the moment a scheduled job stops responding. Free plan monitors up to 50 endpoints — no credit card required.

Platform Equivalents

AWS EventBridge

Standard cron expressions often need conversion for AWS EventBridge schedules.

EventBridge Rule
cron(0 */6 * * ? *)

Systemd Timer

OnCalendar*-*-* 00/6:00:00

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

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

[Install]
WantedBy=timers.target

Last verified:

Frequently Asked Questions

At what exact times does this cron schedule execute?

This schedule executes precisely at 12:00 AM, 6:00 AM, 12:00 PM, and 6:00 PM. The execution time is determined by the system clock of the server running the cron daemon.

How does Daylight Saving Time affect this six-hour interval?

During Daylight Saving Time (DST) changes, the interval may temporarily become 5 or 7 hours depending on whether the clock skips forward or falls back. To prevent this, configure your cron environment to use Coordinated Universal Time (UTC) instead of local time.

Can I offset the execution to avoid the top-of-the-hour peak?

Yes, you can shift the execution to run at a specific minute offset, such as fifteen minutes past the hour, by changing the first field. For example, using `15 */6 * * *` will run the job at 12:15, 6:15, 12:15, and 6:15.

What happens if a six-hour job takes longer than six hours to complete?

If a job execution exceeds six hours, a new instance will start while the previous one is still running. This can cause resource exhaustion or database lock contention. You should implement a locking mechanism, such as flock in Bash or a distributed lock manager, to prevent concurrent executions.

Is this schedule suitable for high-priority transaction backups?

While a six-hour interval is excellent for general backups, high-velocity transactional databases typically require a tighter recovery point objective (RPO). For critical financial or user data, a more frequent schedule like hourly or every fifteen minutes is highly recommended.

* Explore

Related expressions you might need

Last verified:

Was this helpful?