LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-03-2002, 10:42 AM   #1
MikHud
Member
 
Registered: Jan 2002
Location: UK
Distribution: Ubuntu
Posts: 45

Rep: Reputation: 15
Question CRON ignores Daylight Saving Time?


Even though most of my Red Hat 7.2 has moved one hour ahead to Daylight Saving Time (DST), cron seems to continue on Standard Time - although its actions are recorded in DST eg: in /var/log/cron. So a job set for 03:00 is recorded as happening at 04:00. This seems rather confusing - jobs which need to happen at an exact local time, will happen an hour 'late' (in local/DST) during summer time!
Is cron supposed to ignore DST and operate at Standard Time only? - or am I missing something?
 
Old 04-03-2002, 11:30 AM   #2
cuauhtemoc
LQ Newbie
 
Registered: Feb 2002
Location: Denver
Distribution: SuSe, RedHat, Mandrake
Posts: 3

Rep: Reputation: 0
Exclamation

Hi,
I'd check the cron script because the time for execution is being pulled from the system. So, if the time in your machine(s) is set correctly, then cron should work fine. At any rate I'll see if I find additional info for you.
 
Old 04-04-2002, 06:12 AM   #3
MikHud
Member
 
Registered: Jan 2002
Location: UK
Distribution: Ubuntu
Posts: 45

Original Poster
Rep: Reputation: 15
Hi cuauhtemoc

Incidentally I'm in the UK so we change earlier than you in the US.

I'm not sure how the cron script can be to blame - what exactly did you have im mind?

I had the following reply from srigler@nospam.houston.rr.com on mailgate:-
-snip-
I found an old thread discussing cron handling DST strangely. The
issue in that case seemed to be with Linux (or just that distribution) not setting the hardware clock with DST.
-snip-

My RH7.2 'date' and 'hwclock' both report the same DST, though the CMOS clock itself is 1 hour behind on Standard Time - I wonder if cron uses the CMOS clock directly, and whether Linux is supposed to change the CMOS clock to DST?

Mike
 
Old 04-04-2002, 11:52 AM   #4
abrakadabra
Member
 
Registered: Apr 2002
Location: Denver
Distribution: SuSe,RedHat,Mandrake,
Posts: 109

Rep: Reputation: 16
Cool

Hi, This is abrakadabra (formerly cuauhtemoc)
About cron not being set correctly see the man on cron. There you'll find the -s flag which is to offset local timezone changes.
This may be the answer.
Good luck!
 
Old 04-04-2002, 09:21 PM   #5
Sixpax
Member
 
Registered: Mar 2002
Distribution: Mandrake 8.1
Posts: 386

Rep: Reputation: 31
/sbin/hwclock -r
shows you the time according to the hardware clock.

/sbin/hwclock --adjust
makes changes the hardware clock adjustment mechanism so that the hardware clock more accurately follows system time.

/sbin/hwclock --systohc
sets the hardware clock to the system time.
 
Old 04-05-2002, 06:02 AM   #6
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
Your system clock is probably running in UTC time. Because you live in england have of the year the UTC time will be the same as Localtime so you probably don't notice a difference then. The cron daemon gets it's time directly from the system clock so it will also be running in UTC time. So technically the cron daemon is still accurate.

For an explanation of UTC read the following:
http://whatis.techtarget.com/definit...213612,00.html
 
Old 04-05-2002, 06:03 AM   #7
MikHud
Member
 
Registered: Jan 2002
Location: UK
Distribution: Ubuntu
Posts: 45

Original Poster
Rep: Reputation: 15
Question Which MAN page - where?

Hi abrakadabra

I can't find the man page you're looking at - can you advise where I can find this man page on the web?

Regards, Mike
 
Old 04-09-2002, 04:46 AM   #8
MikHud
Member
 
Registered: Jan 2002
Location: UK
Distribution: Ubuntu
Posts: 45

Original Poster
Rep: Reputation: 15
Smile CRON/DST problem SOLVED

As Mik advised, cron gets its time directly from the HardWare/RTC/BIOS clock and mine wast set to UTC(GMT).
You're asked at install if you want the clock at UTC but not given any clues to the implications (eg: for cron) of doing it or not. Similarly, <timeconfig> gives no such advice, and imho isn't very clear about:-
a) If the 'HW clock to GMT/UTC' is not checked, then the HW clock is set to the system local timezone by default.
b) The time zone option sets the Linux 'system time', but also, if the 'HW clock to GMT/UTC' is not checked it sets the HW clock too.
As Mik pointed out my problem would be more noticeable outside the GMT/BST timezone because any program using the HW clock directly like cron would always differ from localtime, whereas in the UK our Standard Time Zone is GMT/UTC for half the year, and the problem only becomes apparant when we change to British Summer Time.
Unchecking the 'HW clock to GMT/UTC' set my HW clock by default to localtime (currently BST) so a cron job set for 03:00 is now done at 03:00 BST.
Mike
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Daylight savings time Jeebizz Slackware 13 11-21-2005 08:08 PM
Doub about `net time set` and daylight saving time Thakowbbery Linux - Software 0 10-17-2005 05:23 AM
DO NOT use Daylight Saving Time - how? EcceVery Debian 4 05-28-2005 02:21 PM
How to un-config automatic Daylight Saving Time? davi_cabral Linux - General 2 10-13-2004 02:57 PM
How to setup Daylight Saving Time erick Linux - Software 1 10-15-2003 09:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration