Re: [chrony-dev] can chrony adjust H/W clock too ?

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


On Tue, 20 Apr 2010, J. Bakshi wrote:

Hello list,

I have a cron which sync the sytem time to H/W clock by hwclock command
by regular interval ( once every hour), to maintain both rtc and system
clock same. I wonder if there is any option in chrony itself to adjust
the H/W clock too. Is there any ?

It is actually "better" than that. chrony can read the rtc regularly and
determine both the offset and the drift rate of the rtc. Then next time it is
used at bootup, it can correct for that drift rate and offset to set the
system time from it. Now it is not perfect, since the drift rate is apt to be
different when the computer is off and cold than when it is on and warm, but
it can at least keep the rtc to withing a few PPM. Your technique does nothing
as far as drift rate is concerned.

chronyc also has a command, trimrtc which will set the rtc to the same time as
the system clock, while still keeping a record of the drift rate and new
offset.  It is a protected command so you would need a script something like

#!/bin/bash
key="`grep commandkey /etc/chrony.conf|awk '{print $2}'`"
keyfile="`grep keyfile /etc/chrony.conf|awk  '{print $2}'`"
password="`grep ^$key $keyfile|awk '{print $2}'`"
chronyc <<EOF
password $password
trimrtc
q
EOF

(I have not tested it)





--
William G. Unruh   |  Canadian Institute for|     Tel: +1(604)822-3273
Physics&Astronomy  |     Advanced Research  |     Fax: +1(604)822-5324
UBC, Vancouver,BC  |   Program in Cosmology |     unruh@xxxxxxxxxxxxxx
Canada V6T 1Z1     |      and Gravity       |  www.theory.physics.ubc.ca/

---
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/