[SWLUG] Crontab difficulties

Terry John terry.john at bbc.co.uk
Mon Jan 10 16:06:17 UTC 2005


>On 21 Dec 2004, at 21:12, Neil Jones wrote:

>>
>> I am trying to get a program to run every minute using crontab. using

>> crontab -e I have set up the following.
>>
>> * * * * * /programpath etc.
>>
>> The program simply waits a random number of extra seconds and saves
>> the time
>> before the wait and after to a file.
>>
>> Running it from the command line. It works.
>> However nothing seems to happen from the crontab.

>Tried getting it to write to a log file?

>* * * * * /programpath >>/home/nat/log.1 2>>/home/nat/log.2

>You can see what error messages might be appearing then.
>Could be path related.
>nat,


I'm guessing "random no of seconds" is how often cron is ready to do a
job. The correct entry should be something like

1,2,3,4,5,6,7,8,9,10,11,12(etc) * * * * /programpath etc

I'm not sure if there is a short-form way of writing it.
I've looked at man cron and in there is says that cron checks the
crontab file every minute to see if there are changes. That is not the
same as the first "*" which says at all times.

Terry

http://www.bbc.co.uk/

This e-mail (and any attachments) is confidential and may contain
personal views which are not the views of the BBC unless specifically
stated.
If you have received it in error, please delete it from your system. 
Do not use, copy or disclose the information in any way nor act in
reliance on it and notify the sender immediately. Please note that the
BBC monitors e-mails sent or received. 
Further communication will signify your consent to this.




More information about the Swlug mailing list