[PLUG] time difference

Marvin J. Kosmal lamsokvr at xprt.net
Mon Oct 6 23:13:02 UTC 2003


On Mon, 2003-10-06 at 18:50, Kyle Hayes wrote:
> On Monday 06 October 2003 16:54, Michael Montagne wrote:
> > I just noticed a cron job I set to run at 1AM ran at 4PM.  So I looked
> > in syslog and all the timestamps are 9 hours ahead.  Same as
> > /va/log/messages.  Yet the "date" command yields the expected
> > results and /etc/localtime is a symlink to
> > /usr/share/zoneinfo/America/Los_Angeles.  I'm running Knoppix.
> > This could really mess me up but I'm sure the fix is simple.  If I
> > could only figure it out.
> 
> If it was 7 hours, then I'd say that your system thinks that it is in UTC/GMT, 
> but the hour is really set to PDT timezone.
> 
> I always set the hardware clock to GMT, but then I don't dual boot anything 
> other than other Linux distros.  If you have Windows dual booted, then you'll 
> need to set the hardware clock to the local timezone I think.
> 
> I find that ntpdate is the perfect tool for getting the clock back in sync 
> regardless of how whacked it is.  xntp will fail to sync if the local time is 
> too far off of the reference time server.  ntpdate will sync the time back in 
> one shot (but does not track it like xntp).

OR rdate

as root

# rdate time.mit.edu

Good luck

> 
> Try something like this (as root):
> 
> # export TZDIR=PST8PDT
> # ntpdate bigben.cac.washington.edu
> # hwclock --systohc
> 
> Replace bigben.cac.washington.edu with an appropriate open NTP server.  That 
> one works for me, but I try not to hit it more than once a week.  The U of 
> Washington provides that service freely and I don't want to abuse their 
> generosity.
> 
> The first line is possibly necessary if you've got a bizarre timezone set, or 
> it is really whacked.  My local configuration (SuSE) doesn't seem to have it 
> set at all, so I'm not sure where it will be set, but this should set it 
> sufficiently for glibc to figure out the time.
> 
> The last line, hwclock, is usually a good idea for PC hardware.  Often the 
> hardware clock will continue to drift off into the weeds even though the 
> system time is OK.  I have had the misfortune of having servers that drifted 
> more than eight hours between reboots.  It screwed up database timestamps 
> really well after reboot.  Since then, I always sync the hardware clock with 
> the system time.  Note that the above will probably set the hardware clock to 
> PST8PDT timezone.  You may need to add --utc to the hwclock command line in 
> that case.
> 
> I am not a system admin, nor do I play one on TV.  YMMV.  Void where 
> prohibited. Tested model price $23,596.
> 
> Best,
> Kyle
> 
> 
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
> 
-- 
Marvin J. Kosmal
Linux Activist
Registered User # 88512
Brought to by Libranet 2.7





More information about the PLUG mailing list