Accurate Timekeeping

Craig Johnson vince at tc.fluke.COM
Thu Dec 1 11:27:37 AEST 1988


I have gotten tired of my 7300 keeping inaccurate time.

A long time ago there was a program floating around which caused a
daemon to start up which applied periodic adjustments to the system
time.  Was this ever posted here or was it a commercial product?  If
it is public domain could someone send me a copy or repost it?  Does
anyone know if this program updates the real time clock hardware, or
only the system time kept in software?

If this doesn't show up, there may be a way to easily improve your
system's timekeeping anyway.  It turns out that the system time is only
set (read from the real time clock hardware) on boot-up.  This is
performed by "date -" being executed by root.  From that time forward
until the next reboot, the system time is based on a different clock
source.  I haven't looked at the hardware manual yet to figure out if
it is the microprocessor clock or yet another clock (for time slice
interrupts?), but it is definitely different from what the RTC hardware
sees.

If your Unix-pc has been up for a while, login as someone other than
root and type,

	$ date -; date

"Date -" cannot change your system time since you are not root, but it
will print out the time found in the real time clock hardware.  If the
hardware clock and the system clock (software) were keeping the same
time you would expect the second date command to spit out a time which
follows the first time by a couple of seconds.  On my 7300 the time is
considerably different, and it is the RTC value which tracks reality
closest.

So here is the proposal:  If I can't get the time correction daemon
program I'm looking for, I propose to add a line to my crontab which
will execute "date -" once a day, thereby setting the system time to
the RTC value daily.  This should make life more tolerable for me,
perhaps it will help others also.  I'm making the assumption here that
crontab is executed by smgr or cron which has root privileges.

We'll see if this is good enough.  If not, I will look into writing
my own time correction daemon.  I'll let you know if it comes to that.


	Craig V. Johnson		...!fluke!vince
	John Fluke Mfg. Co.
	Everett, WA



More information about the Unix-pc.general mailing list