Operating System - HP-UX
1826775 Members
1382 Online
109702 Solutions
New Discussion

How to synchronize to the correct time under 2-3 weeks?

 
SOLVED
Go to solution
Mr. Laszlo Kulcsar
Occasional Contributor

How to synchronize to the correct time under 2-3 weeks?

Our local time server has 3 minutes delay to the correct time. I have tried the 'ntpdate -B' on an independent test server to see how fast the time will be corrected to the right time. Unfortunatelly the 'ntpdate -B' synchronize to the correct time in some minutes.

As we are using RSA tokens for remote access, we have to adjust the time very slowly, for example 2 weeks.

Have anybody got a solution for this problem?
6 REPLIES 6
Robert-Jan Goossens
Honored Contributor
Solution

Re: How to synchronize to the correct time under 2-3 weeks?

Steven E. Protter
Exalted Contributor

Re: How to synchronize to the correct time under 2-3 weeks?

The above posts are excellent.

For a specific one time process, you can manually change the time with the date command.

man date


Otherwise the above posts are great. All you need is the IP address of a time server inside the firewall or port 123 open on the firewall to connect to an ntp server.

p
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
A. Clay Stephenson
Acclaimed Contributor

Re: How to synchronize to the correct time under 2-3 weeks?

One approach would be to use the date -a command but instead of the entire 180 seconds correction in one shot, you would script a series of very small corrections. For even better control, a small C program using the adjtime() system call could be used.
If it ain't broke, I can fix that.
Dave Chamberlin
Trusted Contributor

Re: How to synchronize to the correct time under 2-3 weeks?

You could use date -a sss to nudge the time sss seconds. Take the total time change desired and divide by the number of hours in the period you will have to do the syncronizing. Then schedule cron to run every hour with the date -a nnn command where nnn is the number of seconds per hour. The time will change in chunks but they will be small chunks.
Mark Greene_1
Honored Contributor

Re: How to synchronize to the correct time under 2-3 weeks?

Look at the man page for xntpd, particularly the section on SLEW. You can make a change to your ntp configuration to activate SLEW'ing until the time comes into alignment (see the "over 1000 milisecond" part). Also, verify the contents of your /etc/ntp.drift file, if you have one defined.

When you time is back in-sync, you can then change the ntp config back to what it was--so be sure to save a copy of the original config file.

HTH
mark
the future will be a lot like now, only later
Mr. Laszlo Kulcsar
Occasional Contributor

Re: How to synchronize to the correct time under 2-3 weeks?

Thank you for all of you the very helpfull answers. On the base of your answers I have suceeded to solve my problem.

But, some advice for the other who will face to this type of problem in the future:

- The 'date' command has no '-a' option under HP-UX 10.20.
- It's very important to run the xntpd in slewing mode. Generally the '-x' option is hidden and not present in manuals, but it works. After installing the latest ntp patch, the manual will show the '-x' option and the patch also correct some bugs.

- If NT servers are synchronizing to the UNIX xntp serverr with ntp service, it have to run also in slewing mode.