[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Resetting hw clock



On Sat, Nov 10, 2001 at 09:48:12AM -0700, Karl Pearson wrote:
> Here's how I do it from a cron. The first line sets the OS clock and the
> second line sets the hardware clock:
> 
> 0,30 0-23 * * * /usr/bin/rdate -s clock.psu.edu
> 5,35 0-23 * * * /sbin/clock -w
> 
> That goes out and gets the right time from a timeserver on the campus of
> Penn State University (there are many, many others available, too) every 30
> minutes all day long. That's how I do it on my workstation, which is an
> antique DELL P-166 (RH7.0). You can change the times to once or twice a day
> if your CMOS battery is up and running...

Here are what may be a couple of improvements.

1. I used to use rdate, but one by one, the servers that support this
   have dried up.  Found out they are switching to ntpdate.  So now my
   /etc/cron.daily/syncdate looks like this:

#!/bin/sh
ntpdate -s harbor.ecn.purdue.edu && hwclock --systohc --utc

2. The "hwclock" part of the line does what the "/sbin/clock" does.  I
   like hwclock because it allows for the fact that I run the hwclock
   on GMT instead of local time.  And in this case, it is executed
   only if ntpdate is successful.  For my purposes, syncing once a day
   is sufficient.  If you want razor-sharp accuracy all the time,
   consider installing the ntp daemon.

For those of you interested in setting up such a thing, consult

http://www.eecis.udel.edu/~mills/ntp/clock2.htm

for the nearest server.

Cheers,
-- 
Bob McClure, Jr.            | It's not that life is too short.
Bobcat Open Systems, Inc.   | It's that eternity is sooo looong.
robertmcclure earthlink net |





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]