Operating System - HP-UX
1847361 Members
3569 Online
110264 Solutions
New Discussion

Re: System time adjustment

 
SOLVED
Go to solution
Guettache
Advisor

System time adjustment

Hello,

My system time is 12mn earlier than the current time:
current time = 14h
system time: 13h48

Can I adjust the time in muti-user mode?
Is there any bad effect when adjusting the time.

My system is an L1500 running hp-ux 11.0

Thanks,

Narimane
10 REPLIES 10
BFA6
Respected Contributor

Re: System time adjustment

Hi,

If setting the clock forward then there is probably no problem, but you might want to check whether any applciations running will be OK.

Hilary
Paula J Frazer-Campbell
Honored Contributor

Re: System time adjustment

Hi

Yes you can move the time forward in multiuser mode, but it it is safer to do it in single user mode.

Speak to you DBA on implications.

Paula
If you can spell SysAdmin then you is one - anon
Ken Hubnik_2
Honored Contributor

Re: System time adjustment

Make sure to check cron to see if changing the time will have any affect on some cron jobs during the change.
Clemens van Everdingen
Honored Contributor

Re: System time adjustment

Hi,

Sure you can, but personally I would not do so.
You always can expect unexpected behaviour with several OS/prog parts. For example databases, cron, log files etc.

C.
The computer is a great invention, there are as many mistakes as ever, but they are nobody's fault !
T G Manikandan
Honored Contributor

Re: System time adjustment

In case you have databases or critical applications based on time you have to be precautious and should note the impacts before changing the time backwards.

Also they should affect your application scheduled jobs.

ALso make sure that you re-start your cron daemon after the time change.


Thanks
john korterman
Honored Contributor
Solution

Re: System time adjustment

Hi Narimane,
11.0 has a possibility for "slowly adjusting time", drifting forwards or backwards. For an explanation, see the man page for "date" ("-a" option).
We have used that possibility once for setting the time 4 minutes faster on one machine, and it was done in multi-user mode when everything else was running normally, including an oracle db. We made the adjustment in portions of 30 seconds at a time, and paused app. 5 minutes in between each "30 seconds forward drift".
We saw no side-effects on our system, but others may have had other experiences using this feature. Just a suggestion..

regards,
John K
it would be nice if you always got a second chance
A. Clay Stephenson
Acclaimed Contributor

Re: System time adjustment

The smart (and safe way) to do this is through the use of the adjtime() system call. Under 11.x, the date command will do this (e.g. date -a 720). ; this will gradually adjust your time forward by 12 minutes. It does this by making your clock 'tick' faster rather than an abrupt change. In this manner, file and database datestamps while not truly accurate are self-consistant during the adjustment period.

After you get your clock reasonably synchronized, you should fix the problem permanently by setting up NTP. It's very easy to do and your time will then stay accurate easily to within a few tens of milliseconds in the worst case.
If it ain't broke, I can fix that.
Sean OB_1
Honored Contributor

Re: System time adjustment

You can adjust the time in a slow manner using the "date -a" function.

This will move the clock incrementally in clock ticks, not all at once. Your users "should" see no difference.

If you aren't already doing so you may want to consider running ntp to keep your clocks in sync.

Guettache
Advisor

Re: System time adjustment

Hello,

I used date -a 667
(667s = 11mn 7seconds)

The system time did catch
the current time . BUT for my suprise it continues to go fast. Why?
I was expecting to get the system time stabilised but it
was not the case.

Do I need to do anyting else?

Thanks,

Narimane
Guettache
Advisor

Re: System time adjustment

Hi,

Thanks a lot for your suggestions.

after using date -a xxx, the system time was adjusted, then
I rebooted the system.
The system time is now OK and
all applications running fine

Thanks,

Narimane