1

I have a linux box, running Fedora Core 10, and the clock gets screwy after a few days of uptime. It keeps time just as one would expect, but then I notice the timestamps on incoming email are from the recent past. I log in to the machine, and if I run the date command repeatedly every 1 second (more or less), it takes 4-10 seconds for the output from date to change by 1 second.

4
  • Thanks, giving that a try. I am puzzled though that it keeps time correctly for a random period of, uh, time.
    – originalgeek
    Sep 15, 2009 at 3:04
  • is this system running under any kind of virtualization, such as xen or vmware? that can greatly affect what time/clock issues you experience, and the best solutions.
    – jeff
    Sep 15, 2009 at 3:44
  • No, it's not. And NTP didn't solve the problem either.
    – originalgeek
    Sep 16, 2009 at 5:16
  • Can you post the output of dmesg? That may show any problems with clock frequencies etc. Oct 5, 2009 at 21:31

2 Answers 2

6

Your system's clock is running slow. Run NTP on the machine, and it will be fine. I've had good experiences with chrony.

Since running NTP by itself didn't fix things, you should investigate whether your system's power source and the supply hardware are in good condition. An unusual ripple on that could cause weirdness. A dying CMOS battery could also cause the slowdown effect you're seeing, though I don't usually expect that on a system that's powered on (normally, it would lose time while off).

2
  • You can also set a cron job to sync the clocks to your favourite NTP server.
    – sybreon
    Sep 15, 2009 at 1:41
  • 3
    Running a cron job to sync the clock is exactly poor the approach that NTP was invented to replace. That approach would jump the clock every time interval, and run slow otherwise. Events would appear to 'bunch' in time around the syncs. Sep 15, 2009 at 1:44
0

I'm using sync_date_time.sh from http://quamis.evonet.ro/new/index.php/path=Proiecte_Proiectevechi_System_scripts.html from time to time on a sistem that drifts about 5 seconds a week, but NTP is better than that:)

You must log in to answer this question.