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

Re: cronjob executing at wrong time



On Mon, 29 Dec 2003 23:12:14 -0600, Jeff Bauer wrote:

> I've got a server running Debian 3.0 r1.  A job that is
> scheduled to execute at 8:01pm is executing at 2:01pm.
> The cronjob entry runs as non-root user:
> 
>   1 20 * * 1-5  myjob
> 
> I have the server synchronized to a time source with ntpdate
> and I've checked the local timezone.  The 'myjob' script itself
> appears to run fine, just at the wrong time.
> 
> I've written some test scripts to echo `date` to a
> log file via cron. The output agrees with the system
> clock, but the scheduled cronjob runs at the wrong
> time.
> 
> Kernel info:
>   Linux trajan 2.2.20-idepci #1 Sat Apr 20 12:45:19 EST 2002 i686 unknown
> 
> I've been using crontab for many years, but I'm certainly
> overlooking something quite obvious.  Any pointers to clues
> will be most appreciated.  Thanks.
> 
> -Jeff

This is just a couple of suggestions off the top of my head in case they
ring a bell for you... You obviously are experienced, so if this stuff is
obvious, I apologize...

Evidently, cron is running your job in UTC rather than CST, so somehow
your settings related to time conversion are inconsistent.

What is your hardware clock set to (UTC or CST)
What does cat /etc/rcS say
man hwclock
man tzsetup

Also try
/etc/init.d/cron stop
/etc/init.d/cron start

Sorry, it's not much.  But it is apparently related to the relationships
between hardware clock, system time and what time cron thinks it is.  If
'date' gives CST then it must be whatever is different between date and
cron re. getting the time.

-- 
....................paul

It's working as coded.




Reply to: