LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Time keeps slowing (https://www.linuxquestions.org/questions/slackware-14/time-keeps-slowing-420324/)

Crobat 02-28-2006 11:03 AM

Time keeps slowing
 
For some reason, I've just noticed this, but the time on my system keeps slowing down. I use it pretty often, and I happened to be late for work 15 minutes one day. A week later, it was 20 minutes behind. I manually set it back to the right time, but it continues to slow down. Any ideas?

SaintsOfTheDiamond 02-28-2006 11:07 AM

Do you leave it running all the time? If you turn it off you may need to replace the battery on the motherboard (I forget the fancy name for it :D)

edM 02-28-2006 01:38 PM

check in the BIOS for the system and see if its running behind as well, reset the time and switch it for 30 mins, check the BIOS again. if it is 9/10 then the CMOS bat is dying.

*keep a note of all your important BIOS settings before going onto the next step*

open the case and check the battery is seated properly, or there isnt lots of dust lying over the battery.

then do the time test again.

if you still have the same problem as final test you even check that the polarity of the bat has come mis-aligned. check your mobo book for the polarity for the bat on the mobo. it may just have a + sign on the direction. make sure the + on your bat is aligned that way.

i have come across all 3 of those problems when fixing PCs in the past.


replacement CMOS button batteries cost nothing can be picked up at any computer specialists.

Jeebizz 02-28-2006 06:17 PM

Quote:

(I forget the fancy name for it )
I think the technical term would be CMOS battery, but its just nomenclature. Battery for the bios gets the point across as well. :D

lodragan 02-28-2006 10:27 PM

You should think about loading/activating ntpd (network time protocol daemon).

You can use that to syncronize with another machine on your network, and ideally a machine on your network can sync with a stratum clock periodically to keep everything ship-shape.

Most computer clocks drift to some extent - ntp corrects the drift - and allows you to have piece of mind (and correct time-stamps across your network).

Widgeteye 03-01-2006 10:54 AM

Here's what I do and is a great way to keep perfect time on your system.

I have a script called "Time" :)

in that script I have the following 2 lines.

/usr/sbin/ntpdate time-a.nist.gov
/sbin/hwclock -w

The first line gets the time from the governemts atomic clock
the next line writes it to cmos.

I set this little script up to be called once a day from the crontab and my
computer's time is always perfect.

Has to be root owned and run.

Have fun

Crobat 03-02-2006 09:31 AM

Ahh there we go. That two liner script worked.

How would I go about setting that up to run automatically? Would I use the daemon that lodragon suggested?

Thanks again for the help. :D

dsojat10 03-02-2006 03:27 PM

Time keeps slowing
 
Quote:

Originally Posted by Crobat
Ahh there we go. That two liner script worked.

How would I go about setting that up to run automatically? Would I use the daemon that lodragon suggested?

Thanks again for the help. :D

To answer the question;
Save the script in /root with chmod of 700 then as root enter the command crontab -e.

Now the best method though is;
edit the file /etc/ntp.conf with something like;

server whatever.com

It is best to have at least one stratum 1 server and a couple of stratum 2 servers. Find a time server near you at the following url http://ntp.isc.org/bin/view/Servers/WebHome

Then create the following script;

#!/bin/sh
#
# /etc/rc.d/rc.ntpd
#
# Start/stop/restart the Network Time Protocol Service.
#
# To make Apache start automatically at boot, make this
# file executable: chmod 755 /etc/rc.d/rc.httpd
#

case "$1" in
'start')
/usr/sbin/ntpd -l /var/log/ntpd.log -p /var/run/ntpd.pid ;;
'stop')
kill -9 `cat /var/run/ntpd.pid ` ;;
'restart')
kill -HUP `cat /var/run/ntpd.pid ` ;;
*)
echo "usage $0 start|stop|restart" ;;
esac

This ntp service will constantly run each time that the server is booted. As a final bonus configure your spouses/kids M$ boxes to obtain the time from your server.

You can check the status of the ntpd periodically by running the command as root; ntpq

You can find additional information about ntp at http://www.cis.udel.edu/~mills/ntp/html/

Ciao

Crobat 03-03-2006 09:08 AM

Alrighty. I'll give it a go. Thanks! :)

odevans 03-03-2006 05:59 PM

Or you could just save Widgeteye's 2 line script in /etc/cron.daily (make sure it's executable)

Crobat 03-05-2006 08:53 PM

I edited cron/daily to include the time script. I'll let you know if it works. Thanks again guys! :D


All times are GMT -5. The time now is 07:09 AM.