Field-by-Field Breakdown of `*/5 * * * *`
| Position | Field Name | Allowed Values | Value in `*/5 * * * *` | Evaluation Meaning |
|---|---|---|---|---|
| 1 | Minute | 0 – 59 | */5 | */5 (Every 5th minute: 0, 5, 10... 55) |
| 2 | Hour | 0 – 23 | * | * (Every hour: 0-23) |
| 3 | Day of Month | 1 – 31 | * | * (Every day of the month: 1-31) |
| 4 | Month | 1 – 12 | * | * (Every month: 1-12) |
| 5 | Day of Week | 0 – 6 (Sun-Sat) | * | * (Every day of the week: 0-6) |
How Step Values Work in POSIX Cron
In standard POSIX cron syntax, the expression `*/5` in the minute position is a step specification. It evaluates the full wildcard range (0 through 59) and fires only when the minute value modulo 5 equals zero. This ensures execution begins precisely at the top of the hour (:00) rather than offsetting from server startup time.
A common alternative is the explicit comma-delimited list `0,5,10,15,20,25,30,35,40,45,50,55 * * * *`. While functionally identical, step notation is universally preferred in production sysadmin environments because it reduces human configuration errors and produces compact, readable crontab files.
Because `*/5 * * * *` triggers 12 times per hour (288 times in a 24-hour cycle), tasks scheduled on this cadence must be lightweight and idempotent. Any process exceeding a 300-second execution window will overlap with the subsequent invocation unless protected by a lockfile mechanism like `flock`.
Common Production Scenarios for `*/5 * * * *`
API Health Check & Heartbeat Ping
Monitors upstream microservices or publishes health check metrics to uptime services like Better Stack or Pingdom.
curl -fsS --retry 3 https://api.fasttools.me/health > /dev/nullMessage Queue & Task Worker Polling
Checks Redis or RabbitMQ dead-letter queues for orphaned consumer jobs requiring automated retry or alerting.
/usr/bin/php /var/www/artisan queue:restartLightweight SSL / DNS Cache Warming
Pre-warms edge CDN caching proxies to ensure fast TTFB on frequently requested programmatic API endpoints.
/usr/local/bin/warm-cache.sh >> /var/log/warm-cache.log 2>&1Production Gotchas When Running `*/5 * * * *`
- Job Overlap: If the task takes longer than 5 minutes, concurrent instances will spawn simultaneously. Use `flock -n /var/lock/myjob.lock /path/to/script.sh` to prevent stampeding.
- Time Drift: Cron checks scheduled tasks at second 00 of each minute. Heavy system load can delay invocation by 1-3 seconds.
- Log File Growth: At 288 executions daily, logging standard output without rotation will fill disk space rapidly. Always pipe to `logrotate` or write only errors.
Frequently Asked Questions About `*/5 * * * *`
Does `*/5 * * * *` run at minute 0?
Yes. Step notation always evaluates starting from the minimum valid boundary of the field (minute 0). The schedule triggers at :00, :05, :10, :15, :20, :25, :30, :35, :40, :45, :50, and :55.
What is the difference between `*/5 * * * *` and `5 * * * *`?
`*/5 * * * *` runs 12 times per hour (every 5 minutes). In contrast, `5 * * * *` runs only once per hour, exactly at minute 5 (e.g. 01:05, 02:05, 03:05).
How do I prevent a 5-minute cron job from overlapping if it runs slow?
Wrap your crontab command with the Linux utility `flock`. For example: `*/5 * * * * /usr/bin/flock -n /tmp/job.lock /usr/local/bin/my-task.sh`. If the previous run is still active, subsequent runs exit immediately.