Cron Expression for Every 5 Minutes During Business Hours
Run a cron job every 5 minutes during business hours (9 AM to 5 PM, Monday to Friday) using */5 9-17 * * 1-5.
Expression
*/5 9-17 * * 1-5 Every 5 minutes from 09:00 to 17:00, Monday through Friday
Use Cases
- • Monitoring production systems during business hours
- • Polling for new orders or support tickets during the workday
- • Refreshing live dashboards for office displays
- • Running frequent data syncs only when staff is active
Code Examples
Crontab
# Every 5 minutes from 09:00 to 17:00, Monday through Friday
*/5 9-17 * * 1-5 /path/to/your/script.sh GitHub Actions
name: Scheduled Job
on:
schedule:
- cron: '*/5 9-17 * * 1-5'
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo "Running Every 5 Minutes (9 AM to 5 PM, Weekdays)" systemd Timer
[Unit]
Description=Every 5 Minutes (9 AM to 5 PM, Weekdays) timer
[Timer]
OnCalendar=*-*-* *:*:00
Persistent=true
[Install]
WantedBy=timers.target Tips
- ✓ Runs 108 times per weekday (12 per hour times 9 hours)
- ✓ Saves resources by not running during nights and weekends
- ✓ Combine multiple constraints: step, range, and weekday
- ✓ A common pattern for business-critical monitoring
Frequently Asked Questions
How many times does this run per week?
It runs 12 times per hour (every 5 minutes) for 9 hours (9 AM to 5 PM) across 5 weekdays, totaling 540 executions per week.
Can I change it to every 10 minutes during business hours?
Yes, replace */5 with */10: */10 9-17 * * 1-5 runs every 10 minutes during the same business hours window.