TechCompare LogoTechCompare

How to schedule a cron job every hour: the 0 * * * * pattern

0 * * * * is the canonical every-hour pattern. Use the @hourly shortcut if your cron daemon supports it (Vixie cron, cronie, most Linux distributions). For more complex hourly schedules, constrain the hour field rather than trying to do it through the minute field.

To run a job at the top of every hour, use 0 * * * *. The zero fixes the minute to exactly :00, and the asterisk in the hour field means every hour. At 14:00, 15:00, 03:00, the job fires. This is the standard pattern for log rotation, cache warming, and hourly data aggregation.

By TechCompare · Updated

Schedule pattern
Every hour
every-hour
Category
Common Patterns
Standard cron expression patterns

How this is calculated

If you want the job to run at a different minute past the hour (say :30 for half-past), use 30 * * * *. To run only during business hours, constrain the hour field: 0 9-17 * * * runs at the top of every hour from 9 AM to 5 PM. For every 2 hours, use 0 */2 * * *. Most cron daemons also support the @hourly shortcut, which is equivalent to 0 * * * * and runs at the start of each hour.

Verdict

Hourly scheduling has more variants than the canonical form suggests. :30 needs 30 * * * *, business-hours needs an hour range like 9-17, and every other hour drops in */2 on the hour field. @hourly alias works on Vixie cron and cronie, so if you only need the top of each hour it's the cleanest shorthand.

More Cron scenarios

Frequently asked questions

How do I run a cron job every hour?
Use 0 * * * * in your crontab. The zero pins the minute to :00 and the asterisks leave hour, day, month, and weekday open, so the job fires at the top of every hour. Log rotation, cache warming, and hourly data aggregation are the classic use cases.
How do I schedule a cron job at 30 minutes past every hour?
Use 30 * * * *. The minute field alone controls the offset, so any value from 0 to 59 works the same way. For half-hourly, write */30 * * * *, and for every two hours at minute 15, combine them as 15 */2 * * *.
Should I use @hourly or 0 * * * *?
They mean the same thing on Vixie cron and cronie, which cover most Linux distributions, so @hourly is a readable shorthand. Explicit 0 * * * * works everywhere including BusyBox cron in Alpine containers, where the @ shortcuts aren't supported. For anything that lands in a Dockerfile, prefer the numeric form.