How to use the cron daemon

If you have some tasks or shell scripts which should run regularly on a automated basis then you can use the cron daemon.

One example for this is the mensa plan at http://gi.cebitec.uni-bielefeld.de/mensa. The page is generated with a shell script update_mensaplaene.sh

To run this script regularly the cron deamon is used. This can be done by entering

crontab -e;

on the console.

If you are not familiar with the vi editor press the escape key followed by :q! to quit. If you have no problem with vi then you can enter which jobs should be started when. E.g.:

#min, hour, day, month, weekday, command
#
# updates the mensaplan, every hour (8-13) on mondays, once a day tue - fri.
0       8-13    *       *       1       /full/path/to/update_mensaplaene.sh
0       9       *       *       2-5     /full/path/to/update_mensaplaene.sh

This would start the shell script in that location Mondays betweeen 8 and 13 o'clock and tuesday to friday at nine. For a detailed description see

man crontab

Any output produced by your script or command will be send to you by email.

Important: Remember the server, where you activated the cron deamon.