Cron Howto

cron deamon can be utilized to run applications,scripts,commnds at a specified time.To check whether cron is currently active in your system run

$ ps ax | grep cron

3203 ? Ss 0:00 /usr/sbin/cron

4329 pts/0 S+ 0:00 grep cron

If yes it will show PID along with the cron binary location.

We have to edit the crontab file to specify the schedule of running applications. For this the following command is used

$ crontab -e

The parameters to be given are as shown in figure.

5 4 * * sun echo "run at 5 after 4 every sunday"

If the following line is given, then at 4:5 AM every sunday, "run at 5 after 4 every sunday" will be printed on screen. You could give command,script... at the part starting with echo.

For running GUI application, command part should be replaces as follows

env DISPLAY=:0 gui_appname

The env DISPLAY=:0 portion will tell cron to use the current display (desktop) for the program "gui_appname".

For example for running torrent client Deluge, it should be like this

47 09 18 11 * env DISPLAY=:0 deluge

For running terminal based programs like rtorrent, It should be given as follows

47 09 18 11 * env DISPLAY=:0 gnome-terminal -e rtorrent

Form a more detailed description of cron, try running

$ man 5 crontab