Cron every 3 minutes: */3 * * * *
*/3 * * * * runs 20 times an hour, 480 times a day, at minutes 0, 3, 6 through to 57. Three divides 60 exactly, so the gap never varies.
At a glance
- Expression
- */3 * * * *
- Fires
- 480 times a day, 20 times an hour.
- Restricted fields
- Minute only. The other four fields are open.
- Equivalent macro
- None.
- Minutes matched
- 0, 3, 6, 9 ... 57. Twenty values.
- Gap at the hour boundary
- Exactly 3 minutes, because 60 divided by 3 leaves no remainder.
In detail
Three is one of the divisors of 60, so this schedule has the property that a lot of step schedules do not: the interval between the last run of one hour and the first run of the next is the same as every other interval. The final match is minute 57, the next is minute 0 of the following hour, and the gap is three minutes like all the rest. Compare that with a step of 7, where the hour boundary introduces a short gap.
Three minutes is a common choice for health checks that feed an alerting rule needing two or three consecutive failures before it pages. At this rate a genuine outage is confirmed in six to nine minutes, which is usually the right trade between noise and delay. Going to one minute triples the check volume without moving that number much, because the alert rule, not the schedule, sets the floor.
The whole cluster of jobs on this schedule lands on minute 0 of every hour together, along with every hourly job, every */5, every */15 and everything else aligned to the top of the hour. If the run at :00 is consistently the slow one, that pile up is why. Shifting to 1-58/3 keeps twenty runs an hour and moves all of them off the crowded minute.
Nothing about this expression restricts the date, so it also runs through the night, on weekends and on the day you take the service down for maintenance. If the job logs an error when the service is unavailable, a planned outage produces several hundred error lines, which is worth knowing before you set an alert on the log volume.
Examples
*/3 * * * *1-58/3 * * * *Matches 1, 4, 7 ... 58. Still twenty runs an hour, none of them on minute 0.
*/3 * * * * /opt/app/bin/healthcheck.sh || /opt/app/bin/notify.sh >> /var/log/health.log 2>&1Things that catch people out
- */3 in the month field means January, April, July and October, not every third month from whichever month you are in today.
- A three minute schedule and a three minute timeout in the job are a bad pair. Set the timeout below the interval so a hung run is killed before its successor starts.
- Twenty runs an hour is enough to make a chatty script the largest source of lines in your syslog. Redirect the output rather than letting cron mail it.
Try it: Cron Expression Parser
Paste any five or six field expression to get a plain English description, a per field breakdown and the next run times in your local time.
Cron Expression Parser
LOCAL · Browser-OnlyParse cron expressions and see the next scheduled run times
Supports 5-field (minute hour day month weekday), 6-field (with seconds), named values (JAN, MON), and @macros (@daily, @hourly, ...)
Use the dropdowns below to build your cron expression visually, or type a custom value in each field.
Human-Readable Description
Every 5 minutes
Field Breakdown
| Field | Allowed | Value | Meaning |
|---|---|---|---|
| Minute | 0-59 | */5 | every 5 minute(s) |
| Hour | 0-23 | * | every hour |
| Day of Month | 1-31 | * | every day of month |
| Month | 1-12 | * | every month |
| Day of Week | 0-7 | * | every day of week |
Related cron expressions
All cron expressions →Cron every 2 minutes: */2 * * * *
*/2 * * * * fires 720 times a day on even minutes only. How to run on odd minutes instead with 1-59/2, and what the even alignment costs you.
Cron every 5 minutes: */5 * * * *
*/5 * * * * fires 288 times a day at minutes 0, 5, 10 and so on. Why every job on the box lands on the same minute and how 2-59/5 fixes it.
Cron every 15 minutes: */15 * * * *
*/15 * * * * fires 96 times a day on the quarter hours. What happens to the count on the two daylight saving days, and how 7-59/15 spreads the load.
Cron step values: what */n really does
*/n walks a field from its minimum in increments of n. Because it starts at the field minimum, */2 gives even minutes and odd days of the month.
Cron every 10 minutes: */10 * * * *
*/10 * * * * fires 144 times a day at minutes 0, 10, 20, 30, 40 and 50. Run counts, offset variants and the rate limit maths that make it popular.
Cron every 20 minutes: */20 * * * *
*/20 * * * * fires 72 times a day at minutes 0, 20 and 40. Why three runs an hour is the practical floor for jobs with a long startup cost.
Tools for this
- Cron Expression Parser Free online cron expression parser - parse cron expressions and see the next scheduled run times
- Crontab Generator Free online crontab generator - build cron expressions visually with an intuitive interface