Linux Clock

Adam Scheinberg’s profile picture

Linux Clock

I have noticed that over the last two years or so, one of my Linux server's clocks is constantly wrong. Sometimes, it's off by as little as a minute, but sometimes it's up to 20 minutes off. When I check it today, it was nearly an hour off. Since it runs many cron jobs, including sending some "reminder" emails to people to enter data into a database, it's a problem.
Here are the steps I took to fix the problem.
First, I created a script, "clocksync.sh." This is the contents:

ntpdate clock.redhat.com
/sbin/hwclock --systohc

Then I setup a cronjob to run this once a day. Even running it twice within 5 minutes, the time gets adjusted.
This has fixed the issue well enough, but does anyone know why or how the time could get off by so much? It's a Dell 400SC server.
Back to Blog
roeland
2006-08-02 12:02:40
entries we always use in any installation we do:

/usr/sbin/netdate ntp.xs4all.nl > /dev/null
/sbin/hwclock --systohc

in the crontab, pick any time I'd say. can be every day, weekday, minute etc. take your pick ....

there is no general reason why the time drifts. it at least keeps the time correct.
Eugenia
2006-08-02 12:03:10
This is a motherboard issue. Its RTC is broken. I suggest you change the mobo.
Back to Blog