Cron Expression for Every 5 Minutes
Run a cron job every 5 minutes using */5 * * * *. A popular interval for monitoring, cache refreshing, and queue processing.
Expression
*/5 * * * * Every 5 minutes
Use Cases
- • Refreshing API data caches
- • Checking for new emails or notifications
- • Syncing data between two systems
- • Running lightweight analytics aggregation
Code Examples
Crontab
# Every 5 minutes
*/5 * * * * /path/to/your/script.sh GitHub Actions
name: Scheduled Job
on:
schedule:
- cron: '*/5 * * * *'
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo "Running Every 5 Minutes" systemd Timer
[Unit]
Description=Every 5 Minutes timer
[Timer]
OnCalendar=*-*-* *:*:00
Persistent=true
[Install]
WantedBy=timers.target Tips
- ✓ This is the most popular cron interval for monitoring tasks
- ✓ Use */5 in the minute field to divide the hour evenly into 12 runs
- ✓ Pair with a timeout to kill tasks exceeding 5 minutes
- ✓ Consider staggering multiple jobs to avoid resource spikes
Frequently Asked Questions
What does */5 mean in cron?
The */ syntax means "every nth value." */5 in the minute field means every 5th minute: 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55.
Can I use 0,5,10,15,20,25,30,35,40,45,50,55 instead of */5?
Yes, both produce the same result. */5 is shorthand for listing every 5th minute and is easier to read.