Pages

Wednesday, November 18, 2009

Automate Tasks periodically

One may be aware of scheduler program in windows which is used to automate certain tasks.

We can do that with crontab equivalent in linux

from the "root"'s crontab add the following lines

Execute the command "crontab -e" from terminal as root user then add the following lines
0 */4 * * * /usr/local/bin/someactivity.sh
0 13 * * *  /usr/local/bin/anotheractivity.sh
They cause someactivity.sh to be run every four hours on the hour and anotheractivity.sh to be run every day at 13:00 (that is, 1:00 PM).

No comments:

Post a Comment