Operating System - HP-UX
1819777 Members
3178 Online
109607 Solutions
New Discussion юеВ

trying to syn time using ntpdate

 
SOLVED
Go to solution
oliver chan
New Member

trying to syn time using ntpdate

Hi

I'm trying to used ntpdate to syn hpux 11 server's time with a workstation running on hpux 10.20. However i have noticed that there is always an hour difference even though i try to reverse the role of both the machine(hpux 11 and hpux 10.20). Is there any difference between hpux 11 and hpux 10.20. if so..how can i work around with this...

Oliver
5 REPLIES 5
Patrick Wallek
Honored Contributor
Solution

Re: trying to syn time using ntpdate

Are you sure both machines are using the same time zone?

# echo $TZ

on both systems. If they do not agree then that could be your problem.
oliver chan
New Member

Re: trying to syn time using ntpdate

hi

thanks for the reply...just realised that hpux 10.20 is using sst-7 and the other one sst-8.. so how can i go abt making the change to make it the same..?
Patrick Wallek
Honored Contributor

Re: trying to syn time using ntpdate

On whichever machine is wrong, just do a:

# export TZ=sst-7

or

# export TZ=sst-8

whichever is correct. With the use of the TZ (timezone) variable you are not changing the time (which is kept in UTC anyway) but just changing the way it is displayed. If you look at the time on both machines, you should see that they are in sync, except for the hour, which will change based on your TZ.
Dmitry G. Spitsyn
Trusted Contributor

Re: trying to syn time using ntpdate

Oliver !

And don't forget to fix the above change in the file /etc/TIMEZONE, otherwise the change of the timezone value will not survive a reboot !

BR,
Dmitry
Bill Hassell
Honored Contributor

Re: trying to syn time using ntpdate

NTP doesn't care about the timezone at all. HP-UX always keeps time (and NTP updates time) using Zulu or Greenwich time so the time is correct. You are seeing it translated based on the current setting for $TZ in your shell login. Change TZ and then type date and you'll see the new interepretation.

BTW: using ntpdate is *NOT* recommended to sync computers. It will jump the time rather than slew the time and can create missing seconds during the day. Go to http://ntp.org and Dr. David Mills will warn against this crude technique. To setup proper NTP services, add your NTP servers (always, always use 3 to 8 references for your local time server) to /etc/ntp.conf after verifying you can contact them using ntpq -p server_name. Then edit /etc/rc.config.d/netdaemons to specify the bootup ntpdate source (ntpdate on bootup is OK) and turn on XNTPD.


Bill Hassell, sysadmin