Using ntp for date correction

I have a tendency to slap things together the first time I try them, and not really take the time to work out how they’re supposed to be done, in the correct, classical *nix sense of things.

That’s the case too for this extremely old Pentium which has some of the worst clock lag I have ever seen on a computer. Over the course of a day (in other words, for every 24-hour span), the machine’s clock usually falls behind by at least a minute. The more I use it, the worse it gets, too. At one point, this machine lagged behind the others by as much as a day and a half. How embarrassing. :oops:

Personally I solved the problem in a way that’s probably less than ideal, but seems to be working. ntp from the contrib repo for Crux can sync the time with a remote server across a network, and without any configuration file editing or fancy footwork.

I inserted the ntp command into /etc/rc.local, and set it to sync against a distant server, and that way the clock is corrected each time the machine boots. ntp seems smart enough to wait for the network to be brought up (via /etc/rc.d/net) before doing its thing.

I read elsewhere that it’s possible to use ntp as a daemon and have it sync repeatedly while the machine is in use. To be honest, this machine has so little resources to work with that I’m not inclined to add something else to the mix. Once at startup gets me within striking distance of “correct,” and that’s good enough for now.

I suppose there is a better, or more orthodox way of setting up ntp, but for my purposes, this is satisfactory. Anyway, it keeps the clock from falling behind by days. :roll:

About these ads

3 thoughts on “Using ntp for date correction

  1. IceBrain

    My laptop also “lags” (although only a minute per week :| ), so I’ve set up anacron to run it every three days, seems to work fine.

    Reply
  2. steve

    PC clocks are notoriously bad at keeping time, as are any non-purpose-built electronic devices. All a PC cares about is its own clock cycles, not if said cycles fit into any greater scheme.That’s why all PC clocks will lag.

    Great blog BTW! ;o)

    Reply
  3. Pingback: Three weeks with the Pentium « Motho ke motho ka botho

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s