[NTLUG:Discuss] ntpdate -vs- cron

Egome egome at ticnet.com
Fri Oct 27 12:42:15 CDT 2000


>  hmm.  Try embedding it in a script file and running it that way.  It may
>be some environment variables aren't getting set when run as a cron job.


ok...will try that.

>  BTW, I don't need microsecond accuracy, and run the following:
>rdate -s clock.psu.edu
>hwclock --systohc
>  once a day. that prevents me from tickling psu's clock too much (and
>being cut off), and sets the hardware accordingly so the next time I
>reboot, I'm still correct.


I don't have rdate on my system.

>Why not run xntp as a daemon and then cron just uses the date function
>which has been (roughly) synchronised via xntp?

I've tried to get xntp running...but it never actually updates the clock!
I've set
the date to an incorrect value (well set the time off by 15 minutes anyway)
and
even a day later, I STILL have the wrong time.


>...Unless your application
>needs a fine degree of accuracy and granularity (in which case you may
>want to consider using a gps receiver which provides PPS, which will run
>serveral hundred to several thousand dollars).

no thanks. I don't need the time to be  THAT correct.  I just lose about 20
minutes a day and thought it would be nice to be semi-correct.

> Note that a gps receiver usually needs an extender antenna to work
>indoors, unless it is near  a window. (especially if your building has any
>metal frame or metal roof

WHAT IF I *USE* the metal roof AS the antenna??  HUH HUH??? How's
THAT for an IDEA!

>
>On Fri, 27 Oct 2000, Egome wrote:
>
>> I do not know why these two programs have SUCH a difficult time working
>> together on my Slackware 7.1 server!
>>
>> If I execute /usr/sbin/ntpdate time.nist.gov  from the command line,
>> everything works beautifully!
>>
>> If I try to make a cron job of that command line I get the following
error
>> message emailed to root..
>>
>> ntpdate[3103]: the NTP socket is in use, exiting
>>
>>
>> I've tried sending the output to /dev/null, ( /usr/sbin/ntpdate
>> time.nist.gov >> /var/log/ntpdate.log > /dev/null ) but it still get's
>> emailed to me.
>>
>> Why does the command work from the command line but not as a cron job?





More information about the Discuss mailing list