Cron job every weekday: expression and example
The cron expression for at 09:00 Monday to Friday is 0 9 * * 1-5. Put it at the start of a crontab line, followed by the command. Below: what each of the five fields does, a sample line you can copy, the mistakes people make with this schedule, and how to get told when the job doesn't run.
The expression
A cron expression has five fields separated by spaces: minute, hour, day of month, month, day of week. An asterisk means "every"; a number means "only this one"; */n means "every nth"; a-b is a range and a,b is a list. For at 09:00 Monday to Friday the fields are:
| Field | Value | Meaning |
|---|---|---|
| Minute (0-59) | 0 | minute 0 |
| Hour (0-23) | 9 | hour 9 |
| Day of month (1-31) | * | every day of the month |
| Month (1-12) | * | every month |
| Day of week (0-7, Sunday is 0 or 7) | 1-5 | days 1 to 5: Monday to Friday |
Example crontab line
Open the crontab with crontab -e and add one line: the expression, a space, then the command exactly as you'd type it in a shell. Business-day reports, syncing with systems that only change on working days, morning stand-up reminders. A typical line looks like this:
0 9 * * 1-5 /srv/app/bin/daily-report >> /var/log/report.log 2>&1
The >> file 2>&1 at the end sends both normal output and errors to a log file. Without it, cron tries to email the output to the user, which usually means it's lost.
Gotchas
- Day of week: 0 is Sunday, 1 is Monday, 6 is Saturday, and 7 is also Sunday in most implementations. 1-5 is Monday to Friday.
- When both day-of-month and day-of-week are set (not *), cron runs on days that match either, not both.
0 9 1 * 1runs on the 1st of the month and every Monday. - Public holidays are not weekends; cron doesn't know about them.
- Timezone: cron uses the server's system timezone, which on most cloud servers is UTC. Run
dateon the server to see what "now" means to cron. - Environment: cron runs with a minimal PATH and no shell profile. Use full paths (
/usr/bin/python3, notpython3) and set any variables at the top of the crontab. - Output: if a job prints anything and there's no redirect or MAILTO, cron tries to send mail. Set
[email protected]at the top of the crontab or redirect output to a log. - Silence: cron does not tell you when a job fails or never starts. A job that errors every run looks exactly like a job that runs fine, unless something is watching for it.
Know when it didn't run
In short: Append && curl -fsS https://heyuptime.com/ping/<token> to the line, create a heartbeat monitor with a 1 day period and 1 hour grace, and you're alerted when the job is late.
A heartbeat monitor in heyUptime is a URL your job calls when it finishes. Because of the &&, the ping is only sent when the command exits successfully, so a crashing job and a job that never started look the same: no ping. The watched line for this schedule is 0 9 * * 1-5 /srv/app/bin/daily-report && curl -fsS https://heyuptime.com/ping/<token>.
Set the heartbeat's period to 1 day and the grace to 1 hour. If a ping doesn't arrive within period plus grace, you get an alert by email, Slack, Discord, Teams or Telegram that says when the job was last seen. A weekday heartbeat with a 1-day period will be "late" on Saturday and Sunday. Options: accept the weekend alert and silence it with a maintenance window every weekend, or give the job a tiny companion line on Saturday and Sunday (0 9 * * 6,0 curl -fsS <ping URL>) so the heartbeat stays quiet.
To try it before signing up, the free cron job tester gives you a temporary URL for 24 hours; add it to the line and watch the ping arrive.
Questions
What is the cron expression for weekdays only?
0 9 * * 1-5 runs at 09:00 Monday to Friday. Change the first two fields for a different time; 1-5 is what makes it weekdays.
Can I use MON-FRI instead of 1-5?
Most cron implementations accept three-letter names in the day-of-week and month fields: 0 9 * * MON-FRI. Ranges with names work on Linux cron; check the man page on other systems.
How do I monitor a weekday job without weekend alerts?
Add a second crontab line that just pings the heartbeat URL on Saturday and Sunday (0 9 * * 6,0 curl -fsS <ping URL>), or schedule a weekly maintenance window over the weekend.
Watch this job for free.
Create a heartbeat with a 1 day period, add one curl to the crontab line, and get told the first time it doesn't run. 14-day trial, no card.
Related
- Cron job monitoring
- Cron job tester
- Cron job every day at 9am
- Cron job every Sunday
- Cron job every minute: expression and example
- Cron job every 5 minutes: expression and example
- Cron job every 10 minutes: expression and example
- Cron job every 15 minutes: expression and example
- Cron job every 30 minutes: expression and example
- Cron job every hour: expression and example
Updated October 8, 2026.