Crontab run every day from Monday to Friday at 1 am

This post will guide you setup a crontab to run every day from Monday to Friday at 1 am.

minute(s)hour(s) in
24h format
day(s) of
month (s)weekdaysapplication path
1: Jan
2: Feb
3: Mar
4: Apr
5: May
6: Jun
7: Jul
8: Aug
9: Sep
10: Oct
11: Nov
12: Dec
0: Sunday
1: Monday
2: Tuesday
3: Wednesday
4: Thursday
5: Friday
6: Saturday

Final command: * 1 * * 1-5 /cfg9/

Some special characters used in crontab

*Any value
,Value list separator
Range of values
/Step values

What is cron & crontab

cron is a time-based job scheduler in Unix-like computer operating systems. People who set up and maintain software environments use cron to schedule jobs (commands or shell scripts) to run periodically at fixed times, dates, or intervals.

crontab is a UNIX command that creates a table or list of commands, each of which is to be executed by the operating system at a specified time.

Basic crontab command guide

This is some basic crontab commands you’ll use a lot.

crontab -eEdit your crontab file, or create one
if it doesn’t already exist.
crontab -lDisplay/List your crontab file
crontab -rRemove your crontab file
crontab -u usernameDisplay/Modify crontab file
belonging to a specific user if you are root

More detail on crontab command can be found with this command:

man crontab
Related:  What is the use of “-u” option in cat command? [closed]

Leave a Reply

Your email address will not be published. Required fields are marked *