The contents on this site are being moved to Highlander Nexus
ConfigureCrontab
Configuring Crontab
Running a cron job consists of a schedule and command. The schedule being the minute, hour, day of the month, month, and day of the week the command should be executed.
Min |Hour |Day of the Month |Month |Day of Week
* * * * *
0 4 * * *
crontab -e
30 15 * * 5 echo “Hello”
Note: Cron uses 24-hour format starting from 0.
Min |Hour |Day of the Month |Month |Day of Week
00 00 1 * * /home/rick/script.sh
Names can also be used in cron.
For example, to run a backup of /home/rick/ every weekday at 10:30PM: 30 22 * * Mon,Tue,Wed,Thu,Fri /usr/local/backup
More shortcuts available in cron include @hourly, @daily, @weekly, @monthly, @yearly and @reboot.
For example, to have a job run on startup: @reboot echo “System On”