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

Re: system and bios time doubt (hwclock)



On Sun, Aug 22, 1999 at 12:13:24AM +0200, J Horacio MG wrote:
> Hi,
> 
> just reviewing a script I was given which I have in /etc/ppp/ip-up.d/
> to set the system clock from a server, 

> and then the HARDWARE CLOCK > (bios clock?) SET FROM THE SYSTEM'S:

Why this part?  There's no real harm in having hardware clock that has
the incorrect time.  I could see if you wanted to keep them in the
same neighborhood, but since (almost) nothing USES the hardware clock,
there's no great reason to set it frequently.

> ----------
> #!/bin/sh
> 
> # set the system clock from slug
> /usr/sbin/rdate -s slug.ctv.es
> 
> # set the hardware clock from the system's
> /sbin/hwclock --systohc
> ----------
> 
> I noticed that the `--systohc' option, according to `man hwclock', means:
> Set the System Time from the Hardware Clock.

I think you made a typo.  Pasting from the manpage:
_________________________________________________________________
       --hctosys
              Set the System Time from the Hardware Clock. This is a good
              option to use in one of the system startup scripts.

       --systohc
              Set the Hardware Clock to the current System Time.

> ie., it does just the opposite I want it to do, or doesn't it?
> Shouldn't it be:
> 
> /sbin/hwclock --set
> 
> instead?  

"hwclock --set"  is not used (I'm not sure why hwclock has such wacky
syntax, but anyway).  The "--set" option is used with "--date" as in
'hwclock --set --date="9/22/96 16:45:05"'

> Also, since I have a dial on demand connection, I connect 1+
> times a day, therefore the hardware clock is set times accordingly...
> could that cause any damage?

I REALLY doubt that you're going to cause any physical damage, but it
is a bit traumatic for a linux box to have it's system time adjusted
while running.  (rdate may do it nicely, I'm not sure).  I've seen
some wacky things happen, but nothing "bad" happened (no program
crashes or lost data).

					-Michael

-- 
  Michael Stenner			Office Phone: 919-660-2513
  Duke University, Dept. of Physics	  mstenner@phy.duke.edu
  Box 90305, Durham N.C. 27708-0305


Reply to: