Red Hat Topics - hwclock or adjtimex?

This is Interesting: Free IT Magazines  
Home > Archive > Red Hat Topics > January 2005 > hwclock or adjtimex?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author hwclock or adjtimex?
W. Wat son

2005-01-22, 5:45 pm

I'd like to get the clock on my linux system more accurate. It looks like
hwclock will do this. However, there's this other command, adjtimex, that
seems to do something similar. 1. Does it pre-date the existence of
hwclock? 2. Is it in some way better than hwclock? 3. It looks to me to
protect the accuracy of the clock from a crash that it is necessary to run
a cron job every so often, 1 hour, say, to write the sw clock to the hw
clock, right?

--
Wayne T. Watson (Watson Adventures, Prop., Nevada City, CA)
(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

Most vehicle/deer accidents occur at sunset.
Vehicle deer whistles are ineffective.

Web Page: <home.earthlink.net/~mtnviews>

Sverre Larsson

2005-01-28, 2:45 am

W. Wat son wrote:
> I'd like to get the clock on my linux system more accurate. It looks
> like hwclock will do this. However, there's this other command,
> adjtimex, that seems to do something similar. 1. Does it pre-date the
> existence of hwclock? 2. Is it in some way better than hwclock? 3. It
> looks to me to protect the accuracy of the clock from a crash that it is
> necessary to run a cron job every so often, 1 hour, say, to write the sw
> clock to the hw clock, right?
>

I run this every 3 hour, and the server itself is updated by running ntpd.

#!/bin/sh
if [ -x /sbin/hwclock ]
then
/sbin/hwclock --adjust
/sbin/hwclock --systohc --utc
fi
exit 0
noi

2005-01-29, 5:45 pm

On Fri, 28 Jan 2005 09:40:29 +0100, Sverre Larsson thoughtfully wrote:

> W. Wat son wrote:
> I run this every 3 hour, and the server itself is updated by running ntpd.
>
> #!/bin/sh
> if [ -x /sbin/hwclock ]
> then
> /sbin/hwclock --adjust
> /sbin/hwclock --systohc --utc
> fi
> exit 0


To the root crontab I added:

00 5 1-31/2 * * /sbin/rdate -s time.nist.gov

to set the system clock every other day


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com