cronjobs

hi

How can I add a cronjob to the crontab file?
to execute a shel script named testScript.sh every day at 00:00.

Thanks

[Edited by tamer on 01-22-2001 at 09:37 AM]

Add the following line to the /var/spool/cron/crontabs/owner of testScript.sh file using the vi editor:

0 0 * * * /absolute Path/testScript.sh

The format of this file is six fields: minute (0-59); hour (0-23); day of month (1-31); month (1-12); weekday (0-6,0=Sunday); command to execute. I am not certain of the command syntax.

The crontab search path for can be set in /etc/default/cron file PATH= for user's, SUPATH= for root cronjobs.

Access to the crontab command (used to execute/delete/list cronjobs) is controlled by /etc/cron.d/cron.allow or the /etc/cron.d/cron.deny files (one user per line). Basically a user will be able to use the crontab command if the account is listed in the cron.allow file. By default all initial non-admin accounts are listed in the cron.deny file. If the cron.allow file does not exist users will be allowed access to the crontab command as long as they are not listed in the cron.deny file. Mardio

It is better (and easier) to use the 'crontab -e' command to edit your crontab file.

Not necessarily true for all Unix flavors...

The only thing I would like to add is that it is sometimes necesary to set the $EDITOR variable before executing `crontab -e`
To do this, type
EDITOR=vi;export EDITOR
Otherwise it will open your crontab file with ed (unfriendly line editor)