[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cron time is not same as system time



On Wed, Aug 22, 2007 at 10:08:52AM +0100, Chris Buckley wrote:
> 
> A very strange problem has cropped up on our Debian GNU/Linux 3.1 box 
> this morning.
> 
> We have a crontab for a user scheduled to run at:
> 
> 45 4 * * *      /path/to/utils/script-executed.pl 
> 2>/path/to/logs/stdout-foobar.log
> 
> The cron.log shows this file running at "04:45".
 
> HOWEVER, the cron does not actually run until 09:45.
> I have witnessed this first hand this morning, tailing the cron.log and 
> seeing at 09:45 the process run, but the time being recorded as 04:45.
> 
> I can't immediately see a problem.
> 
> cbuckley@hermes:/var/log$ tzconfig
> Your current time zone is set to Europe/London
> 
> The box is one which, unfortunately, I do not have root rights on - we 
> outsource a lot of our servers.  What checks would I need to perform 
> (given my limited user rights) to assess and help diagnose what the 
> problem is?

Is the system clock set to UTC? 
$ cat /etc/default/rcS

You should see a line
UTC=yes.

I don't know if this matters, and with a tz of London it shouldn't
account for 5 hrs.

Is 09:45 the time the process starts or the time it completes and mails
output?  Perhaps add a line to the script that prints the date at the
beginning and the end, e.g.

echo "Script starting"
date
...
echo "Script ending"
date

Then check the headers on the email message.  

Doug.



Reply to: