Wednesday, January 25, 2012

Scheduling a regular job in Linux

To execute the shell script myjob.sh every Friday and Saturday of July at 0,20 and 40 minutes past 10pm, do
crontab -e 
In the editor that opens up, enter
0,20,40 22-23 * 7 fri-sat /absolute/path/to/myjob.sh 
and save. You are done!
The format is for specifying jobs is
Min Hour DoM MoY DoW Cmd.
See Ian's article for more.

No comments:

Post a Comment