July 30, 2005 Archives

30.07.2005 17:35

NTP on Gentoo

Well I came home from overseas to see my PC's time in KDE way out of whack. In fact the date was wrong. Thought it might be there whole UTC versus local time for the hardware clock (i triple boot with Mandrake and XP) and may well could of been. In trying to fix it I soon found (and reminded myself) that setting to auto set the time/date based on my location (NTP) in KDE wasn't working. I set the time and then ticked for the system to keep it and it would go out by 2 hours even though the hazed out time ws right. This baffled me. Threw further investigation I found 2 things. 1) my hardware clock was out by 2 hours (duh!) and 2) the symlink Gentoo uses [/etc/localtime] had been destroyed and replaced with a type of binary. So I re-created the symlink and fixed the hardware clock. Then I ticked the box to auto set the time based on location. again the localtime symlink became a binary file of some sort and I believe the hardware clock went out (trying to recall, I did this a week ago, (oops, slow in blogging)). So I did it all again, but didnt check the box. Good, all ok now. But I am going to lose time now without it being updated over the net. So I made a shell script:
#!/bin/bash
ntpdate oceania.pool.ntp.org
exit
I put this in cron.hourly. For some reason cron isn't working on my Gentoo install; never has. I have tried several different types of cron's but all thesame result. So I need to remember to run that script even so often. Running it every few days shows me the clock gets out my about 10 seconds. -----

Posted by DaveQB | Permanent Link | Categories: IT