Cron job every 6 hours
The crontab line for a job every 6 hours is 0 */6 * * *. It runs 4 times a day, 1,460 times a year. Edit it below to see the next runs in your time zone.
How 0 */6 * * * reads
The five fields are minute, hour, day of month, month and day of week. A star means every value.
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | minute 00 |
| Hour | */6 | every 6th hour: 0, 6, 12, 18 |
| Day of month | * | every day of month |
| Month | * | every month |
| Day of week | * | every day of week |
For example, from Wednesday 6 January 2027 at 10:07 the next runs are: Wed 6 Jan 2027, 12:00; Wed 6 Jan 2027, 18:00; Thu 7 Jan 2027, 00:00; Thu 7 Jan 2027, 06:00; Thu 7 Jan 2027, 12:00.
What a job every 6 hours is for
Four times a day is a common rhythm for off-site backups, certificate and domain checks, and cleaning temporary files: often enough to limit what you lose, rare enough to run heavy work.
Common mistakes
- The runs are at 00:00, 06:00, 12:00 and 18:00 on the server’s clock. If the server is on UTC, that is a different time for you, and it moves by an hour when your summer time starts and ends.
- «0 */6» and «0 0,6,12,18» are the same schedule; the second is easier to read and to change.
The same schedule as a systemd timer
On systems with systemd, a timer can replace the crontab line: OnCalendar=0/6:00. Check it with systemd-analyze calendar "0/6:00", which prints the next run.
Know when it didn’t run
Cron doesn’t tell you when a job stops running. Add a heartbeat monitor with a period of 6 hours and end the line with a call to its URL, for example 0 */6 * * * /path/job.sh && curl -fsS -m 10 <ping URL>. If a ping is late by more than the grace time you set, you get an alert, and a call to the URL with /fail reports a failure at once.
What is the cron expression for a job every 6 hours?
0 */6 * * *. It runs 4 times a day, 1,460 times a year, on the server’s clock.
How do I run a job every 6 hours with systemd instead?
Create a timer with OnCalendar=0/6:00 next to a service that runs the job, then enable it with systemctl enable --now name.timer. Persistent=true also runs a run that was missed while the machine was off.