How to run a cron job every 5 minutes: the */5 syntax explained

Running a cron job every 5 minutes uses the step operator in the minute field: */5 * * * *. The */5 means every 5th minute. At the top of each hour the job fires at :00, :05, :10, and so on. This is the standard pattern for health checks, metric collection, and near-real-time polling.

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

How this is calculated

The slash operator divides the range (0-59 for minutes) into steps. */5 is shorthand for 0,5,10,15,20,25,30,35,40,45,50,55. If you need offset timing (e.g. :02, :07, :12), list the values explicitly: 2,7,12,17,22,27,32,37,42,47,52,57. Be aware that running a job every 5 minutes means 288 executions per day. If the job takes more than 5 minutes to complete, overlapping runs can cascade. Add a lock file or use flock to prevent concurrent execution.

Verdict

*/5 * * * * is correct for most every-5-minute use cases. Add locking if the job runtime might exceed the interval. For sub-minute scheduling, cron is the wrong tool. Use a daemon or systemd timer instead.

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'.