The Real-Time-Clock (RTC) chips used on PC motherboards (and even expensive workstations) are notoriously inaccurate, usually gaining or losing a consistent amount of time each day. Linux provides a simple way to correct for this in software, which can make the clock *very* accurate, even without an external time source. But most people don't know how to set it up, for several reasons:
man clock
" you may get
the man page for clock(3)
, which is not what you
want (try "man 8 clock
" or
"man 8 hwclock
"-- some distributions
search in numerical order if you don't give a section
number, others search in the order specified in
/etc/man.config
).This mini-HOWTO describes the low-tech approach (which can be
very accurate by itself), and provides pointers to several more
sophisticated options. In most cases the documentation is well
written, so I'm not going to repeat that information here, but
I've included detailed instructions for the old clock(8)
program at the end for anyone still running an older system.
You must be logged in as "root" to run any program that affects the RTC or the system time. Keep this in mind when setting up any of the programs described here.
If you run more than one OS on your machine, you should only let one of them set the CMOS clock, so they don't confuse each other. This includes the twice-a-year adjustment for Daylight Savings Time.
If you run a dual-boot system that spends a lot of time running Windows, you may want to check out some of the clock software available for that OS instead. Follow the links on the NTP website at http://www.eecis.udel.edu/~ntp/software.html. Many of the radio clocks mentioned here include software for Windows.