Operating System - HP-UX
1825775 Members
2436 Online
109687 Solutions
New Discussion

set the time, but slowly...

 
Bakos György
Super Advisor

set the time, but slowly...

Hi

I want to set the date, but I won't set it with :
date MMDDhhmm...

I want to set like ntpdate -B server, but the problem is I want to set the servers time, but slowly(because I have heard that if ntp tme differs from server more then 30minutes then it could'nt be done.
2 REPLIES 2
Robert-Jan Goossens
Honored Contributor

Re: set the time, but slowly...

Hi,

You can use the date command to slowly reduce the time of your server. check the manual page of date.

man date

-a [-]sss[.fff]
Slowly adjust the time by sss.fff seconds (fff represents
fractions of a second). This adjustment can be positive or
negative. The system's clock will be sped up or slowed down
until it has drifted by the number of seconds specified.

Regards,
Robert-Jan
Elmar P. Kolkman
Honored Contributor

Re: set the time, but slowly...

ntpdate does not comply with the xntpd in this case, and works for any difference. Using the -B option will slowly adjust the clock like you want it to... I have done this multiple times. It is fun the have a xclock running on both the NTP server and the client running ntpdate, both with update of 1 second, to see the difference in speed...

Mind that it can take a long time for the clock to sync this way.
Every problem has at least one solution. Only some solutions are harder to find.