Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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?
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!
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.