Operating System - HP-UX
1833729 Members
2475 Online
110063 Solutions
New Discussion

Slowin system clock down ?

 
SOLVED
Go to solution
Stefan Schulz
Honored Contributor

Slowin system clock down ?

I have here a D380 running HP-UX 10.20. The system clock of this server is 81 seconds ahead of the real time.

Due to several reasons (databases, backup) i don't want set the time back.

Is there a method available to slow down the clock till it has reached the real time.

I know that in SUN's Solaris there is a funktion to slow down the system clock.

Thanks in advance for your suggestions.

Stefan
No Mouse found. System halted. Press Mousebutton to continue.
11 REPLIES 11
Andreas Voss
Honored Contributor
Solution

Re: Slowin system clock down ?

Hi,

there's i system call adjtime() which adjusts the time gracefully.
See man adjtime

Put you a little C source at attachment for using this call.
The program asks for Delta Minutes/Seconds.
To adjust to past enter neg. value (eg: -81).
For only adjust seconds enter 0 for minutes.
Be aware to turn off xntp if you have (/sbin/init.d/xntp stop).

Regards

Andrew
Cheryl Griffin
Honored Contributor

Re: Slowin system clock down ?

Stefan,
I have not seen this type of function in HP-UX but maybe someone else has and will post.

The only other solution I could offer is to use NTP (Network Time Protocol) and sync to get the correct system time.
"Downtime is a Crime."
Alex Glennie
Honored Contributor

Re: Slowin system clock down ?

2 suggestions :

1. consider using a NTP server ;

NTP sets the kernel view of the system clock. This means that the
tick adjustment changes the number of ticks the kernels thinks a
seconds contains. This is done all the time and NTP tries to constantly
get a better prediction of how many ticks are in a second. The real-time
clock is used once during the bootup to set this value and the time of
the system clock. After the system boots, you should always check the
system clock.

During the start of NTP, ntpdate synchronizes the clock with the
reference clock. This could be a timeserver or a radioclock
(recommended). This sets the real-time clock to the new value. It is
important that the timeserver has the correct time, even after a reboot.
NTP updates the real-time clock about every 8 hours.

2. Setup dtsd : distributed time server : would require DCE cell involvemnet/setup.

Not sure if there is an individual unix command to do what your after though !
John Palmer
Honored Contributor

Re: Slowin system clock down ?

If you were on HP-UX 11.00 then the date command has a facility (-a flag) to do just what you want.

On 10.20 though you'll have to use Andrew's C program.
Rick Garland
Honored Contributor

Re: Slowin system clock down ?

Use xntpd to keep the times sync'd. Info about ntp can be obtained from www.eecis.udel.edu/~ntp/ntpfaq
Rick Garland
Honored Contributor

Re: Slowin system clock down ?

xntpd can be used to keep the time in sync.

Info can be obtained from www.eecis.udel.edu/~ntp/ntpfaq
Andreas Voss
Honored Contributor

Re: Slowin system clock down ?

Sorry,
a little correction to my c program input:
if you want to adjust 81 seconds you have to split this in 1 minute and 21 seconds to go forward or -1 minute and -21 seconds to backward time.
James R. Ferguson
Acclaimed Contributor

Re: Slowin system clock down ?

Stefan:

Setting up ntp services would be my choice, too. There's a good section on this in the Installing & Administering Internet Services manual. I synchronize all my servers to one "master" which syncs to its own clock. There is a wealth of discussion within this forum as well as in the KB too.

...JRF...
Stefan Schulz
Honored Contributor

Re: Slowin system clock down ?

Wow ... i have been away from keybord for two hours. Now look at all those replys.

As for ntp: I am using ntp to synchonize my workstations with this server. But i don't have a radioclock or internetaccess available for this server. Also there is no other ntp timesource available in the network. I was thinking about this option, but it is not available to me at the moment.

The C-Programm seems to be what i have been looking for. I will come back and tell you.

As this server has a database running and is accessed nearly 24 hours a day there is no timewindow to reset the clock. Therefore i was looking for this "slow down" solution.

Thanks to you all.

Stefan
No Mouse found. System halted. Press Mousebutton to continue.
Stefan Schulz
Honored Contributor

Re: Slowin system clock down ?

Andreas:

Your C-Programm does exactly what i was looking for. Worked without any problem.

Thanks a lot.

Stefan
No Mouse found. System halted. Press Mousebutton to continue.
Stefan Schulz
Honored Contributor

Re: Slowin system clock down ?

Andreas:

Your C-Programm does exactly what i was looking for. Worked without any problem.

Thanks a lot.

Stefan
No Mouse found. System halted. Press Mousebutton to continue.