Cron Every 5 Minutes
Run a job every 5 minutes using the cron expression:
*/5 * * * *
Runs at minutes 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55
Understanding the Expression
| Field | Value | Meaning |
|---|---|---|
| Minute | */5 | Every 5th minute |
| Hour | * | Every hour |
| Day of month | * | Every day |
| Month | * | Every month |
| Day of week | * | Every day of the week |
Example Usage
Basic crontab entry
*/5 * * * * /path/to/your/script.sh
With logging
*/5 * * * * /path/to/script.sh >> /var/log/script.log 2>&1
With monitoring
*/5 * * * * /path/to/script.sh && curl -fsS https://api.cronsignal.io/ping/YOUR_CHECK_ID
Common Use Cases
- Health checks: Ping external services or run connectivity tests
- Queue processing: Process pending jobs from a queue
- Cache updates: Refresh frequently-changing data
- Metrics collection: Gather system stats for monitoring
- Sync jobs: Keep data synchronized between systems
Variations
Every 5 minutes during business hours
*/5 9-17 * * 1-5
Runs every 5 minutes from 9 AM to 5 PM, Monday through Friday.
Every 5 minutes, offset by 2
2-57/5 * * * *
Runs at minutes 2, 7, 12, 17, 22, etc. Useful to avoid the "thundering herd" at minute 0.
Monitoring Tips
Jobs that run every 5 minutes are high-frequency and critical to catch early if they fail. Set your monitoring with:
- Schedule: Every 5 minutes
- Grace period: 2-3 minutes
This way you'll know within minutes if something breaks, not hours later.
Platform Equivalents
The same schedule expressed across common platforms and schedulers:
| Platform | Syntax |
|---|---|
| Linux crontab | */5 * * * * |
| GitHub Actions | - cron: '*/5 * * * *' |
| systemd timer | OnCalendar=*:0/5 |
| Kubernetes CronJob | schedule: "*/5 * * * *" |
| AWS EventBridge | cron(0/5 * * * ? *) |
Timezone Considerations
Every-5-minute jobs run regardless of timezone, but verify your server clock is synced with NTP — a drifting clock means your intervals drift too.
Common Mistakes
- */5 vs 0/5: Both work in standard cron, but AWS EventBridge requires
0/5syntax in its 6-field format. - High-frequency alert fatigue: Set a grace period of 2–3 minutes in your monitoring, not 0 — otherwise a 10-second delay triggers a false alarm.
- Thundering herd: If multiple servers run
*/5 * * * *, they all fire simultaneously. Stagger with1-56/5,2-57/5, etc.
Monitor your 5-minute jobs
High-frequency jobs fail frequently. Get alerted within minutes when they stop running.
Sign up with Google3 checks free. No credit card required.