Question about cron timing - BSD
This is a discussion on Question about cron timing - BSD ; Hello,
Before I begin, if this is not of general interest please feel free
to e-mail your suggestions to me. Reply-To: is properly set to
facilitate that.
I have a question about cron's timing. Some strange things have
been happening ...
-
Question about cron timing
Hello,
Before I begin, if this is not of general interest please feel free
to e-mail your suggestions to me. Reply-To: is properly set to
facilitate that.
I have a question about cron's timing. Some strange things have
been happening lately as far as timing is concerned.
I've looked in /var/log/cron and find that the time stamps are
really strange. If I edit with crontab -e, the log entry shows th
proper time stamp but for anything that cron runs, it shows a time
stamp for the hour before. Here's a short snippet from the log file:
Mar 23 14:50:00 sorsby /usr/sbin/cron[30592]: (crs) CMD /home/crs/bin/getmail
Mar 23 15:52:56 sorsby crontab[30613]: (root) BEGIN EDIT (root)
Mar 23 15:53:23 sorsby crontab[30613]: (root) REPLACE (root)
Mar 23 15:53:23 sorsby crontab[30613]: (root) END EDIT (root)
Mar 23 14:54:00 sorsby /usr/sbin/cron[131]: (root) RELOAD (tabs/root)
Mar 23 14:55:00 sorsby /usr/sbin/cron[30618]: (root) CMD (/usr/libexec/atrun)
Mar 23 14:55:00 sorsby /usr/sbin/cron[30619]: (crs) CMD (/home/crs/bin/getmail
Notice that cron ran getmail at what it thinks is 14:50. A couple
minutes later, I edited root's crontab and it shows that event at
the correct time, 51:52:56. Then, after my edit, it reverts back
to the incorrect time. It's as though all of the system except
cron is on Daylight Saving Time but cron is on standard time.
Does cron *not* use the same clock as the rest of the system?
I tried looking in _Unix System Administration Handbook_ by Nemeth,
et al. but couldn't find anything about how cron is actually timed.
How does one tell cron that we're on daylight saving time now?
(And, yes, I did fetch the time-zone configuration file from
ftp://elsie.nci.nih.gov/pub/tzdata2007b.tar.gz and perform the
steps per:
http://articles.techrepublic.com.com...7-6163042.html
and, as far as I can tell, everything is running on DST -- *except*
cron.
What must I do to tell cron to run at the same time as the rest of
the system? Surely it isn't necessary to reboot the system to
convince cron that the time's really an hour later than it thinks
it is... Would that even do it?
For what it's worth I'm running freeBSD 4.11 (don't ask) as
distributed on the CDROM.
Many thanks for any help and kindest regards,
Charlie
--
Charlie Sorsby
crs@swcp.com
Edgewood, NM 87015
USA
-
Re: Question about cron timing
In article <0m1ed4-s8u.ln1@sorsby.org>, Charlie Sorsby wrote:
>Hello,
>
>Before I begin, if this is not of general interest please feel free
>to e-mail your suggestions to me. Reply-To: is properly set to
>facilitate that.
>
>I have a question about cron's timing. Some strange things have
>been happening lately as far as timing is concerned.
>
>I've looked in /var/log/cron and find that the time stamps are
>really strange. If I edit with crontab -e, the log entry shows th
>proper time stamp but for anything that cron runs, it shows a time
>stamp for the hour before. Here's a short snippet from the log file:
>
>Mar 23 14:50:00 sorsby /usr/sbin/cron[30592]: (crs) CMD /home/crs/bin/getmail
>Mar 23 15:52:56 sorsby crontab[30613]: (root) BEGIN EDIT (root)
>Mar 23 15:53:23 sorsby crontab[30613]: (root) REPLACE (root)
>Mar 23 15:53:23 sorsby crontab[30613]: (root) END EDIT (root)
>Mar 23 14:54:00 sorsby /usr/sbin/cron[131]: (root) RELOAD (tabs/root)
>Mar 23 14:55:00 sorsby /usr/sbin/cron[30618]: (root) CMD (/usr/libexec/atrun)
>Mar 23 14:55:00 sorsby /usr/sbin/cron[30619]: (crs) CMD (/home/crs/bin/getmail
>
>Notice that cron ran getmail at what it thinks is 14:50. A couple
>minutes later, I edited root's crontab and it shows that event at
>the correct time, 51:52:56. Then, after my edit, it reverts back
>to the incorrect time. It's as though all of the system except
>cron is on Daylight Saving Time but cron is on standard time.
>
>Does cron *not* use the same clock as the rest of the system?
>I tried looking in _Unix System Administration Handbook_ by Nemeth,
>et al. but couldn't find anything about how cron is actually timed.
>
>How does one tell cron that we're on daylight saving time now?
>(And, yes, I did fetch the time-zone configuration file from
>ftp://elsie.nci.nih.gov/pub/tzdata2007b.tar.gz and perform the
>steps per:
>http://articles.techrepublic.com.com...7-6163042.html
>and, as far as I can tell, everything is running on DST -- *except*
>cron.
>
>What must I do to tell cron to run at the same time as the rest of
>the system? Surely it isn't necessary to reboot the system to
>convince cron that the time's really an hour later than it thinks
>it is... Would that even do it?
>
>For what it's worth I'm running freeBSD 4.11 (don't ask) as
>distributed on the CDROM.
>
>Many thanks for any help and kindest regards,
>
>Charlie
>--
>Charlie Sorsby
> crs@swcp.com
> Edgewood, NM 87015
> USA
Have you run /usr/ports/misc/zoneinfo to take of care of the
new time zones that went into effect a week or so ago?
It's a really quick fix.
Bill
--
Bill Vermillion - bv @ wjv . com
-
Re: Question about cron timing
In article <0m1ed4-s8u.ln1@sorsby.org>, Charlie Sorsby wrote:
>Hello,
>
>Before I begin, if this is not of general interest please feel free
>to e-mail your suggestions to me. Reply-To: is properly set to
>facilitate that.
>
>I have a question about cron's timing. Some strange things have
>been happening lately as far as timing is concerned.
>
>I've looked in /var/log/cron and find that the time stamps are
>really strange. If I edit with crontab -e, the log entry shows th
>proper time stamp but for anything that cron runs, it shows a time
>stamp for the hour before. Here's a short snippet from the log file:
>
>Mar 23 14:50:00 sorsby /usr/sbin/cron[30592]: (crs) CMD /home/crs/bin/getmail
>Mar 23 15:52:56 sorsby crontab[30613]: (root) BEGIN EDIT (root)
>Mar 23 15:53:23 sorsby crontab[30613]: (root) REPLACE (root)
>Mar 23 15:53:23 sorsby crontab[30613]: (root) END EDIT (root)
>Mar 23 14:54:00 sorsby /usr/sbin/cron[131]: (root) RELOAD (tabs/root)
>Mar 23 14:55:00 sorsby /usr/sbin/cron[30618]: (root) CMD (/usr/libexec/atrun)
>Mar 23 14:55:00 sorsby /usr/sbin/cron[30619]: (crs) CMD (/home/crs/bin/getmail
>
>Notice that cron ran getmail at what it thinks is 14:50. A couple
>minutes later, I edited root's crontab and it shows that event at
>the correct time, 51:52:56. Then, after my edit, it reverts back
>to the incorrect time. It's as though all of the system except
>cron is on Daylight Saving Time but cron is on standard time.
>
>Does cron *not* use the same clock as the rest of the system?
>I tried looking in _Unix System Administration Handbook_ by Nemeth,
>et al. but couldn't find anything about how cron is actually timed.
>
>How does one tell cron that we're on daylight saving time now?
>(And, yes, I did fetch the time-zone configuration file from
>ftp://elsie.nci.nih.gov/pub/tzdata2007b.tar.gz and perform the
>steps per:
>http://articles.techrepublic.com.com...7-6163042.html
>and, as far as I can tell, everything is running on DST -- *except*
>cron.
>
>What must I do to tell cron to run at the same time as the rest of
>the system? Surely it isn't necessary to reboot the system to
>convince cron that the time's really an hour later than it thinks
>it is... Would that even do it?
>
>For what it's worth I'm running freeBSD 4.11 (don't ask) as
>distributed on the CDROM.
>
>Many thanks for any help and kindest regards,
*SOME* applications get the timezone info at program _start-up_ only.
they don't expect the 'zoneinfo' file to change out from under them.
They _do_ adjust time translation, according to the specifications they
read in, at program start-up.
Shut down the daemon and re-start it -- this should fix the problem.
Re-boot _not_ required.
-
Re: Question about cron timing
On Fri, 23 Mar 2007, in the Usenet newsgroup comp.unix.bsd.freebsd.misc, in
article <0m1ed4-s8u.ln1@sorsby.org>, Charlie Sorsby wrote:
> If I edit with crontab -e, the log entry shows th
>proper time stamp but for anything that cron runs, it shows a time
>stamp for the hour before. Here's a short snippet from the log file:
Yes - they are different processes - as the log shows
>Mar 23 14:54:00 sorsby /usr/sbin/cron[131]: (root) RELOAD (tabs/root)
Reloading the _crontab_
>Does cron *not* use the same clock as the rest of the system?
Yes
>How does one tell cron that we're on daylight saving time now?
Same way everyone else does - by computing the time plus the offset.
>(And, yes, I did fetch the time-zone configuration file from
>ftp://elsie.nci.nih.gov/pub/tzdata2007b.tar.gz and perform the
>steps per:
>http://articles.techrepublic.com.com...7-6163042.html
>and, as far as I can tell, everything is running on DST -- *except*
>cron.
Ah, one of the joys of living in Arizona where I don't have to put
up with this crap. Anyway, when did you replace the files, compared
to when did the cron daemon _start_ (not reload, but start)? Some
processes only look at the tzset information when they start. As a
shot, try sending cron a -HUP (kill 30592 -HUP) and see if that
cures it - and if not, try stopping and starting the daemon.
Old guy