LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cron execution problem (https://www.linuxquestions.org/questions/linux-newbie-8/cron-execution-problem-4175508187/)

battles 06-16-2014 02:52 PM

Cron execution problem
 
I reset my server clock using tzselect to Americas/Central. Afterwards I reset all my cron jobs to execute at the new times. The crons were executing ok, but not at the new set times. I couldn't figure when they were triggering. I tries testing a cron by setting it to a time that was a few minutes after it was saved, but it wouldn't fire.

10 14 * * * instruction

When the clock displayed 2:10PM, nothing happened.


This kind of cron fired ok (every minute).

*/1 * * * * instruction

Is there something special you have to do or take into consideration after resetting you time? I eventually gave up and went back to zulu and changed every crons back to GMT. The crons are executing at correct times again.

jlinkels 06-16-2014 06:32 PM

Time zones drive me nuts. I am not even sure if tzselect has side effects, that is if it really changes your system clock, or keeps the absolute time constant.

Whatever, you first have to check your real system time with date. Then you know how your computer interprets time. And then you can check /var/log/syslog. You see soon enough on which clock your cron process runs. Especially with the 1 minute trigger.

No, you do not have to alter anything in crontab definitions if you change the time zone. Not as far as I know. Cron should look at system time, not absolute time.

Recommendation: leave your hardware clock and system clock in UTC. Always and forever. Let only the application which shows time to a human (your desktop) make the translation from UTC to local.

jlinkels

battles 06-16-2014 07:19 PM

I did look at 'date' and it said that the time was CST - what I changed it to. I am used to using GMT from ham radio operations, so I will just stick with it.
Thanks.


All times are GMT -5. The time now is 07:16 PM.