1827249 Members
2435 Online
109716 Solutions
New Discussion

Re: Change system time

 
SOLVED
Go to solution
Americo
Advisor

Change system time

Hello,

I think this is an easy question but i'm not sure what to do.

My system time is 30 minutes beyond the correct time (sorry my english...) and i want to fix this.

Can i do without problems or should i take care with something?

How can i do this? In single user?

I have HP-UX 11.00.

Thanks in advance,

Amer
12 REPLIES 12
Sanjay Kumar Suri
Honored Contributor

Re: Change system time

You can use

SAM --> Time --> System clock

to correct the time.

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Stefan Farrelly
Honored Contributor
Solution

Re: Change system time

You should really boot in single user mode then run the date command to change it, then reboot. See man date for format.

Im from Palmerston North, New Zealand, but somehow ended up in London...
G. Vrijhoeven
Honored Contributor

Re: Change system time

Amer,

If you have no databases/apps running ( Stefans remark) you can issue the date command. ( date mmddhhmm ).

Gideon
Steven E. Protter
Exalted Contributor

Re: Change system time

In general, since I do it so rarely, I suse sam

HP-9000 systems are not very good at keeping time.

Therefore you might want to consider ntp

Here is a document.

http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90685/B2355-90685_top.html&con=/hpux/onlinedocs/B2355-90685/00/00/63-con.html&toc=/hpux/onlinedocs/B2355-90685/00/00/63-toc.html&searchterms=configuration%7cntp&queryid=20040128-022251

SEP
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
Americo
Advisor

Re: Change system time

Thanks for the help,

In this server i have system SAP with Oracle so i think it's better to do this in single user and even wait 30 minutes before booting again.

I'll do that and let you know the results and give the points.

Thanks again,

Amer
Americo
Advisor

Re: Change system time

I've stopped the database and went to single user via SAM. Then changed system time with "date mmddhhmm" (wait 30 minutes for safe) and reboot.

No problems occured.

Thanks a lot,

Amer
Dave Hutton
Honored Contributor

Re: Change system time

I've heard of people using date:
#date -a -/+ seconds
30 minutes maybe more then recommended though. I would say if you have the ability to bring the server down then thats the safer bet, and do it as suggested above.

Dave

Camel_1
Valued Contributor

Re: Change system time

for long term I suggest you should use ntp to sync the system time.
Ryan B
Frequent Advisor

Re: Change system time

Amer~

I agree that once you have this fixed you should find an atomic clock that you can point to and configure NTP (Network Time Protocol) on your system. Once you have the address to point to, you can configure in SAM.

Time-NTP TIme Sources -- Actions--Add Remote Server and then Start NTP.

Here is a page that can explain it and give you a list of NTP sources to use with your systems:

http://twiki.ntp.org/bin/view/Servers/WebHome

RDB
Ryan B
Frequent Advisor

Re: Change system time

Amer~

Forgot to mention that configuring NTP will help prevent the drift in time you are seeing and I recommend you configure a primary and a secondary....

Ryan
R. Allan Hicks
Trusted Contributor

Re: Change system time

look at the man page for date.

date -a [-]sss.fff

slowly adjuests the time by sss.ffff seconds where (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.

Unix doesn't like to have it's clock run backwards, but this should do it slowly enough so that Unix won't notice.

date -a -900.000

Should slow the clock down until it's lost 900 seconds.

I suspect that NTP does the same thing except it figures the number of seconds for you. If you don't have a time source, and you don't want to go into single user mode, then this should do the trick.
"Only he who attempts the absurd is capable of achieving the impossible
Americo
Advisor

Re: Change system time

Hi,

thank you all for complementing the answear.

I'm reading some info about NTP and then i'll try to implement it.


Regards,

Amer