System Clock keeps showing the wrong time/date

System Clock keeps showing the wrong time/date

Post by Christopher Brown » Sun, 04 Aug 2002 08:06:15




Quote:> Thank you for responding to my request for help.  I took your
> suggestion(s).  First, I checked the hardware clock and found it wrong.
> I changed it to July 24 and 15:36:00.  I then booted up Linux only to
> find that the date was right but the time was 10:36:xx AM!  I did a
> hwclock and got exactly that time again.  I exited, rebooted and checked
> the hardware clock.  The date and time were right!  So, now what?

Next step: Install ntp, and sync your time against some nearby
servers.  It'll sync up any time you're connected, and should be quite
helpful.
--

http://cbbrowne.com/info/internet.html
Rules of the Evil Overlord #206. "When my Legions of Terror park their
vehicle  to do  reconnaissance on  foot,  they will  be instructed  to
employ The Club." <http://www.eviloverlord.com/>
 
 
 

System Clock keeps showing the wrong time/date

Post by Michael Lee Yoh » Sun, 04 Aug 2002 10:16:43


Quote:> Next step: Install ntp, and sync your time against some nearby servers.
> It'll sync up any time you're connected, and should be quite helpful.

Here's a script that I run as a nightly root cron job just to make sure
the clock always stays where it needs to - quick and easy.

#!/bin/bash

TIMESERVER=time-A.timefreq.bldrdoc.gov
/usr/bin/rdate -s $TIMESERVER || {
  echo "could not run /usr/bin/rdate -s $TIMESERVER" >&2 ; exit 1

Quote:}

/sbin/clock -w  || {
  echo "could not run clock -w" >&2 ; exit 1

Quote:}

exit 0

--


QUIPd 1.03: (168 of 951)
-> And if it's brown and stinks, we should ask ourselves whether we
-> can put a saddle on its hump.
-> - Larry Wall

 
 
 

System Clock keeps showing the wrong time/date

Post by oh_h.. » Sun, 04 Aug 2002 16:59:06


Note: followups to c.o.l.networking (since this is a networking-related
issue).

In comp.os.linux.networking Michael Lee Yohe


> Here's a script that I run as a nightly root cron job just to make sure
> the clock always stays where it needs to - quick and easy.

I think that running ntpd is better, since every few moments re-syncs
the time (and also keeps a drift file, which rdate does not (IIRC)).

However, if time is wildly out of sync then running ntpdate prior to
starting ntpd is prudent.

--

GeekCode ver 3: GU>CC d s-: a--- C++ UL(+)$>+++$ P+>+++ L++(+) E- W++ N++
o? K? w O M- V- PS PE Y+ PGP+ t 5++ X R tv- b++(++++) DI+ D G e- h! r !y

 
 
 

System Clock keeps showing the wrong time/date

Post by Michael Lee Yoh » Sun, 04 Aug 2002 18:12:17


Quote:> I think that running ntpd is better, since every few moments re-syncs
> the time (and also keeps a drift file, which rdate does not (IIRC)).

I have found that my system generally loses about 3 seconds per week.
Re-syncing the time every few moments is a waste of bandwidth on this
system.  The solution I posted was merely one that was "quick and easy".

--


QUIPd 1.03: (720 of 951)
-> There is a single light of science, and to brighten it anywhere
-> is to brighten it everywhere.
-> - Isaac Asimov

 
 
 

System Clock keeps showing the wrong time/date

Post by oh_h.. » Mon, 05 Aug 2002 01:14:23




Quote:> I have found that my system generally loses about 3 seconds per week.
> Re-syncing the time every few moments is a waste of bandwidth on this
> system.  The solution I posted was merely one that was "quick and easy".

I still think that, at least in Debian, ntpd is still quicker and
easier:

apt-get install ntp
(answer 'y')
(enter space-delimited list of ntp servers)
done.

--

GeekCode ver 3: GU>CC d s-: a--- C++ UL(+)$>+++$ P+>+++ L++(+) E- W++ N++
o? K? w O M- V- PS PE Y+ PGP+ t 5++ X R tv- b++(++++) DI+ D G e- h! r !y

 
 
 

System Clock keeps showing the wrong time/date

Post by Eric P. McC » Mon, 05 Aug 2002 05:10:10



Quote:> > I think that running ntpd is better, since every few moments re-syncs
> > the time (and also keeps a drift file, which rdate does not (IIRC)).
> I have found that my system generally loses about 3 seconds per week.

Consistent time loss or gain like that is extremely common.

Quote:> Re-syncing the time every few moments is a waste of bandwidth on this
> system.  The solution I posted was merely one that was "quick and easy".

ntpd is not a stupid program.  It attempts to determine your system
clock's drift rate - how fast and in what direction away from the
actual time it is moving - and provides that information to the
kernel.  The kernel can then use it to keep the clock more accurate,
instead of just blindly updating it every few days.

Oh, and according to iptables, I waste about 26KB of bandwidth per day
keeping my small LAN's clocked synched.  That's trivial even if you're
on 56k (although you obviously don't want it dialing every time ntpd
thinks your clock is wrong).

--

"Last I checked, it wasn't the power cord for the Clue Generator that
was sticking up your ass." - John Novak, rasfwrj

 
 
 

1. System date and file dates not showing in same time zone

Hi,

My Redhat 6.2 system has a peculiar configuration, the system date is
set for EST, but the file dates on "ls -l" appear to have UTC by
default. Look what happens when I do the following (I have edited this
slightly to avoid username info):

-------

$ date
Fri Jan 19 13:06:09 EST 2001
$ touch here
$ ls -l here
-rw-rw-r--   1 xxxx xxxxxx       0 Jan 19 18:06 here
$ date -u
Fri Jan 19 18:06:24 UTC 2001

-------
I have tried changing the UTC=true and UTC=false in
the /etc/sysconfig/clock with no improvement (the file dates and the
default "date" dates are always off by the timezone difference between
UTC and EST).

I have set my "TZ" environement variable in my shell, and that doesn't
seem to help either.

Intuitively the "ls -l" dates should show up in the time zone of the
system, right? How can I set Redhat do be this way.

Thanks,

-Cris

Sent via Deja.com
http://www.deja.com/

2. superusers

3. 'date' and 'clock' show different times

4. Why are there two dtlogin processes running?

5. Why does my system clock keep changing time?

6. Printing to a network HP 4M?

7. License problem - wrong system date/time

8. DOS-emulators w/ commercial UNIX's

9. How to convert time/date info into unix clock time

10. SMB mount of NT filesystem shows wildly wrong dates

11. Date shows wrong timezone (zoneinfo set right!)

12. Clock starts up with wrong date.

13. smbmount shows wrong dates