Cron Expression for Hourly During Business Hours
Run a cron job every hour from 9 AM to 5 PM on weekdays using 0 9-17 * * 1-5. Combines hourly frequency with business-day restrictions.
Expression
0 9-17 * * 1-5 Every hour from 09:00 to 17:00, Monday through Friday
Use Cases
- • Sending hourly progress reports during work hours
- • Refreshing analytics dashboards for office use
- • Processing hourly batches during staffed hours
- • Running system checks while IT team is available
Code Examples
Crontab
# Every hour from 09:00 to 17:00, Monday through Friday
0 9-17 * * 1-5 /path/to/your/script.sh GitHub Actions
name: Scheduled Job
on:
schedule:
- cron: '0 9-17 * * 1-5'
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo "Running Hourly During Business Hours" systemd Timer
[Unit]
Description=Hourly During Business Hours timer
[Timer]
OnCalendar=*-*-* *:*:00
Persistent=true
[Install]
WantedBy=timers.target Tips
- ✓ Identical to business-hours-only; included for search discoverability
- ✓ 9 runs per weekday, 45 per week
- ✓ Adjust the range for your local business hours
- ✓ The 0 in the minute field ensures it runs at the top of each hour
Frequently Asked Questions
How do I run hourly only during work hours?
Use 0 9-17 * * 1-5 to run at the top of each hour from 9 AM through 5 PM, Monday to Friday.
Does the range 9-17 include 5 PM?
Yes, cron ranges are inclusive. 9-17 covers hours 9, 10, 11, 12, 13, 14, 15, 16, and 17.