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

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.

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

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.

More Cron scenarios

Frequently asked questions

What is a Cron Job?
A cron job is a scheduled task that runs automatically on a Unix-like operating system (like Linux or macOS) at specific intervals. It is heavily used by developers to run background tasks like database backups, cache clearing, or sending nightly emails.
What do the 5 parts of a cron expression mean?
From left to right, the 5 fields are: Minute (0-59), Hour (0-23), Day of the Month (1-31), Month (1-12), and Day of the Week (0-6, where 0 and 7 are Sunday).
What does the asterisk (*) mean in Cron?
The asterisk acts as a wildcard, meaning 'every'. For example, if the minute field is an asterisk, the task runs every single minute. If the month field is an asterisk, the task runs every single month.
How do I run a task every 5 minutes?
To run a task every 5 minutes, use the slash operator in the minute field like this: */5 * * * *. The */5 means 'every 5th minute'.