Crontab run every weekends at 1 am

This post will guide you setup a crontab to run every weekends (Saturday & Sunday) at 1 am.

Cmd:*1**0,6/cfg9/app.sh
minute(s)hour(s) in
24h format
day(s) of
month
month (s)weekdaysapplication path
Value0-590-231-311-12
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-6
0: Sunday
1: Monday
2: Tuesday
3: Wednesday
4: Thursday
5: Friday
6: Saturday

Final command: * 1 * * 0,6 /cfg9/app.sh

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.

CommandMeaningNotes
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:  How to copy to clipboard with X11?

Leave a Reply

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