Cron Expression for Every Weekday (Mon-Fri)
Run a cron job every weekday (Monday through Friday) at midnight using 0 0 * * 1-5. Perfect for business-day-only schedules.
Expression
0 0 * * 1-5 At 00:00 Monday through Friday
Use Cases
- • Sending daily business reports (skipping weekends)
- • Running weekday-only CI/CD pipelines
- • Processing business-day transactions
- • Generating workday attendance or time reports
Code Examples
Crontab
# At 00:00 Monday through Friday
0 0 * * 1-5 /path/to/your/script.sh GitHub Actions
name: Scheduled Job
on:
schedule:
- cron: '0 0 * * 1-5'
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo "Running Every Weekday" systemd Timer
[Unit]
Description=Every Weekday timer
[Timer]
OnCalendar=*-*-* *:*:00
Persistent=true
[Install]
WantedBy=timers.target node-cron (Node.js)
import cron from 'node-cron'
// At 00:00 Monday through Friday
cron.schedule('0 0 * * 1-5', () => {
console.log('Running Every Weekday')
}) Spring (@Scheduled, Java)
// At 00:00 Monday through Friday
@Scheduled(cron = "0 0 0 * * 1-5")
public void run() {
// your task
} Spring cron has 6 fields (a leading seconds field), so a 0 is prepended to the standard 5-field expression.
Tips
- ✓ 1-5 covers Monday through Friday
- ✓ Combine with business hours: 0 9 * * 1-5 for 9 AM weekdays
- ✓ Saves resources by skipping Saturday and Sunday
- ✓ Ideal for anything tied to business operations
Frequently Asked Questions
What does 1-5 mean in the day-of-week field?
1-5 is a range from Monday (1) to Friday (5). The cron job will run on Monday, Tuesday, Wednesday, Thursday, and Friday but not Saturday or Sunday.
How do I run at 9 AM on weekdays only?
Use 0 9 * * 1-5 to run at 9:00 AM Monday through Friday.