Variations
| Schedule | Expression |
|---|---|
| Every hour, on the hour | 0 * * * * |
| Every hour at 30 minutes past | 30 * * * * |
| Every 2 hours | 0 */2 * * * |
| Every 3 hours | 0 */3 * * * |
| Every 6 hours (00:00, 06:00, 12:00, 18:00) | 0 */6 * * * |
| Every hour from 09:00 to 17:00 | 0 9-17 * * * |
| Every hour on weekdays | 0 * * * 1-5 |
The * */1 trap
* */1 * * * looks like "every hour", but the * in the minute field means every minute, so it runs 60 times an hour. Always set the minute field to a number when you want hourly runs.
Pick a minute other than 0
Hourly jobs on shared systems pile up at minute 0. A random-looking minute such as 23 * * * * spreads the load, and on GitHub Actions makes delayed runs less likely.
Frequently asked questions
Is 0 * * * * the same as @hourly?
Yes. @hourly is a shortcut for 0 * * * * in Vixie cron, cronie and Kubernetes. GitHub Actions doesn't accept shortcuts, so use the five-field form there.
Does */2 in the hour field count from when I added the job?
No. It means every hour divisible by 2: 00:00, 02:00, 04:00 and so on, regardless of when the job was created.
How do I run a job every 90 minutes?
One cron expression can't do it, because 90 doesn't divide an hour or a day evenly in a way cron can express. Use two lines, 0 0-21/3 * * * and 30 1-22/3 * * *, which together run every 90 minutes from midnight.