Cron expression for every 6 hours
Every 6 hours, on the hour, every day.
Five fields for Linux, GitHub Actions and Kubernetes (minute hour day month weekday). Six or seven for Quartz. Nothing you type leaves your device.
What it means and when to use it
Four runs a day make a gentle schedule for tasks that people expect to be "fresh enough": rebuilding a search index, running a data export, renewing a short-lived token, or sending a four-times-a-day summary. Since 24 divides evenly by 6, the pattern is exactly six hours apart all day and night.
Watch out for this
The hours are in the time zone of the machine that runs cron, not in yours. A cloud server set to UTC fires at 00:00, 06:00, 12:00 and 18:00 UTC, which in India is 05:30, 11:30, 17:30 and 23:30. If you want runs at fixed local times, either set the time zone for the job (see the time zone guide on this site) or work the hours out in server time yourself. For example, to have the four runs at 00:00, 06:00, 12:00 and 18:00 India time on a server that is on UTC, write 30 0,6,12,18 * * *, because 00:30 UTC is 06:00 in India and the pattern repeats every six hours. GitHub Actions runs scheduled workflows in UTC unless you set a timezone.
What each field says
| Field | Written | Means |
|---|---|---|
| Minute | 0 | 0 |
| Hour | */6 | 0, 6, 12, 18 |
| Day of month | * | every day of the month |
| Month | * | every month |
| Day of week | * | every day of the week |
An example of the next runs
If it were Friday 13 November 2026 at 10:20 UTC, the next six runs would be these. Times are shown in UTC and in India time (UTC+5:30).
| UTC | India time |
|---|---|
| Fri 13 Nov, 12:00 | Fri 13 Nov, 17:30 |
| Fri 13 Nov, 18:00 | Fri 13 Nov, 23:30 |
| Sat 14 Nov, 00:00 | Sat 14 Nov, 05:30 |
| Sat 14 Nov, 06:00 | Sat 14 Nov, 11:30 |
| Sat 14 Nov, 12:00 | Sat 14 Nov, 17:30 |
| Sat 14 Nov, 18:00 | Sat 14 Nov, 23:30 |
The same schedule in other places
Quartz
Quartz has a seconds field in front, uses ? in one day field, and counts Sunday as 1:
0 0 */6 * * ?GitHub Actions
Scheduled workflows run in UTC unless you add a time zone. In the workflow file:
on:
schedule:
- cron: '0 */6 * * *'Kubernetes CronJob
In a CronJob manifest the schedule goes in spec.schedule. Without spec.timeZone, it is read in the time zone of the cluster's controller:
spec:
schedule: "0 */6 * * *"
timeZone: "Etc/UTC"A crontab line to copy
The command is made up. Replace it with your own and use full paths:
0 */6 * * * /home/me/bin/export-data.sh >> /home/me/export.log 2>&1Questions
Can I run at 3, 9, 15 and 21 hours instead?
Yes: 0 3-23/6 * * * starts the range at hour 3 and takes every sixth hour.
This is an independent guide and tool. It is not connected with crontab.guru, Quartz, GitHub, Kubernetes, Spring or the Linux projects named here. Product names belong to their owners.