Tutorial

Run a cron job on weekdays.

0 9 * * 1-5 fires at 9:00 AM, Monday through Friday. The 1-5 in the day-of-week field is the range of weekdays — 1 (Monday) through 5 (Friday).

The expression

0 9 * * 1-5 /path/to/your/script.sh

Day-of-week numbers

NumberDay
0 (or 7)Sunday
1Monday
2Tuesday
3Wednesday
4Thursday
5Friday
6Saturday

So 1-5 = Monday through Friday = weekdays.

Variations

ExpressionMeaning
0 9 * * 1-5Weekdays at 9 AM
0 9 * * MON-FRISame, using day names
0 9 * * 1,2,3,4,5Same, explicit list
0 9 * * 1,3,5Mon, Wed, Fri at 9 AM
0 9 * * 0,6Weekends at 9 AM (Sun, Sat)
0 9 * * 1-4Mon-Thu at 9 AM (excludes Friday)

Quartz / AWS gotcha

If you're using Quartz or AWS EventBridge, the day-of-week numbers are offset by one — 1=Sunday, 2=Monday, …, 7=Saturday. So weekdays become 2-6, not 1-5. Use the named version (MON-FRI) to avoid confusion.

# AWS EventBridge
cron(0 9 ? * MON-FRI *)

# Quartz
0 0 9 ? * MON-FRI

Examples by platform

Linux crontab

0 9 * * 1-5 /usr/local/bin/send-daily-report.sh

GitHub Actions

on:
  schedule:
    - cron: '0 9 * * 1-5'   # Note: UTC timezone

Kubernetes CronJob

spec:
  schedule: "0 9 * * 1-5"

Common mistakes

Don't combine day-of-month and day-of-week. Unix cron treats both fields as OR, not AND. So 0 9 15 * 1-5 fires on the 15th of every month AND every weekday at 9 AM, not "the 15th if it's a weekday." To get the AND behavior, gate inside your script:

0 9 15 * * [ $(date +\%u) -le 5 ] && /path/to/script.sh
Related

Continue reading.