| Setting up cron jobs using crontab |
| Written by empty | ||||||||||||
| Friday, 01 August 2008 05:57 | ||||||||||||
|
This guide will show you how to setup a conjob using the crotab. user@UnixBox ~# vi /etc/cron.allow
You should prepend the COMMAND with nice. nice is a program that gives a given command a given priority. The default is 10. The range is from -20 to 20 with -20 being the highest priority. Here is an example of running a nice'd command in the www/cgi-bin directory of a user every day at 11 PM (2300). 0 23 * * * nice ~/www/cgi-bin/command ~/ = current users home directory.. You should not have to, but you can also use ~username/ to further specify the given user. This is useful in case a process is launched by another user. The "nice" option is used to limit the amount of resources that a cronjob can use. In some instances, you do not want to use the nice option. If the user is making calls to the perl library within their script, you would want to replace "nice" with "perl". This is difficult to determine unless you can recognize within their script that they are making calls to the perl library. If in doubt, just leave the cronjob to run as nice, and if the customer reports that their cronjob is not running properly, then change it to "perl". For PHP scripts, you do not want to use nice. It is normally better to specify the path to the php binary before the path to the script. For example, replace "nice" with "/usr/bin/php". |
||||||||||||
| Last Updated on Friday, 29 January 2010 14:55 |
















Comments (0)