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

Re: Resetting hw clock



On  Sat, 10 Nov 2001 22:16:34 -0800
Rick Stevens <rstevens vitalstream com> wrote:

> > #!/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.

Isn't the proper and more convenient way to set the hardware clock on RH
to use the command 
  setclock

It will save you the hassle to discover the mode in which hardware clock
is running. Is the hardware time configure as local time or as UTC?
Setclock knows automatically. Just replace hwclock with setclock in the
advice above. 

>From manpage:
setclock  sets the hardware clock on the current system to
       the current time stored in the system clock.  /etc/syscon-
       fig/clock  is  read to discover the format the time should
       be converted to before storage. This is  the  same  method
       used  by the standard Red Hat startup scripts and timecon-
       fig(8).

Sincerely,
Ales Kosir





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