3

We run a CentOS release 6.2 (Final) 2.6.32-220.13.1.el6.x86_64 with a stock cronie.x86_64 1.4.4-7.el6.

On Mar 31 we moved to summer time: 03:00 become 04:00.

In crontab we have:

0 4 * * * /usr/bin/php /some_script.php

In log we discovered that this script was executed 12 times:

Mar 31 02:56:01 web CROND[1910]: (root) CMD (/etc/webmin/virtual-server/collectinfo.pl)
Mar 31 04:00:01 web CROND[2492]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Mar 31 04:00:01 web CROND[2496]: (mailman) CMD (/usr/lib/mailman/cron/gate_news)
Mar 31 04:00:01 web CROND[2491]: (root) CMD (/usr/lib64/sa/sa1 600 6 &)
Mar 31 04:00:01 web CROND[2497]: (root) CMD (/etc/webmin/status/monitor.pl)
Mar 31 04:00:01 web CROND[2500]: (some_user) CMD (/usr/bin/php /some_script.php )
Mar 31 04:00:01 web CROND[2509]: (some_user) CMD (/usr/bin/php /some_script.php )
Mar 31 04:00:01 web CROND[2512]: (some_user) CMD (/usr/bin/php /some_script.php )
Mar 31 04:00:01 web CROND[2514]: (some_user) CMD (/usr/bin/php /some_script.php )
Mar 31 04:00:01 web CROND[2534]: (some_user) CMD (/usr/bin/php /some_script.php )
Mar 31 04:00:02 web CROND[2553]: (some_user) CMD (/usr/bin/php /some_script.php )
Mar 31 04:00:12 web CROND[2560]: (some_user) CMD (/usr/bin/php /some_script.php )
Mar 31 04:00:22 web CROND[2670]: (some_user) CMD (/usr/bin/php /some_script.php )
Mar 31 04:00:32 web CROND[2673]: (some_user) CMD (/usr/bin/php /some_script.php )
Mar 31 04:00:42 web CROND[2675]: (some_user) CMD (/usr/bin/php /some_script.php )
Mar 31 04:00:52 web CROND[2678]: (some_user) CMD (/usr/bin/php /some_script.php )
Mar 31 04:01:02 web CROND[2680]: (some_user) CMD (/usr/bin/php /some_script.php )
Mar 31 04:01:02 web CROND[2683]: (root) CMD (run-parts /etc/cron.hourly)
Mar 31 04:01:02 web CROND[2684]: (root) CMD (/etc/webmin/virtual-server/collectinfo.pl)
Mar 31 04:01:02 web run-parts(/etc/cron.hourly)[2683]: starting 0anacron
Mar 31 04:01:02 web anacron[2693]: Anacron started on 2013-03-31
Mar 31 04:01:02 web run-parts(/etc/cron.hourly)[2695]: finished 0anacron
Mar 31 04:01:02 web run-parts(/etc/cron.hourly)[2683]: starting awstats

Any sugestions are higlhy apreciated.

FelixEnescu
  • 197
  • 1
  • 10

2 Answers2

3

It is a known bug:

I've seen it happen on CentOS 6.2 with cronie-1.4.4-7.el6.x86_64 on the 31st of march (CET -> CEST)

0

As I use my servers principally to host web-based services that could be accessed by any timezone in the world, I have my servers operating on UTC (which does not experience DST). Any public facing interface converts to the user's local time (as configured by their preferences).

It should be noted that some services do not gracefully handle being thrown into the future (or the past).

Ahrotahntee
  • 146
  • 4
  • That is a very good ideea. Still, according to man page CRON should handle DST corectly and avoid executing same job more than once, not to mention 12 times. :-) – FelixEnescu Apr 02 '13 at 18:18
  • What timezone are you set for? does `date -u` show the correct UTC time? – Ahrotahntee Apr 02 '13 at 18:53
  • Date show correct time, both local and UTC: `[root@web ~]# date -u Wed Apr 3 07:31:42 UTC 2013 [root@web ~]# date Wed Apr 3 10:31:45 EEST 2013` – FelixEnescu Apr 03 '13 at 07:33