HP-UX System Time change (4960 Views)
Reply
Occasional Visitor
Hemangi
Posts: 1
Registered: ‎05-26-2011
Message 1 of 8 (4,960 Views)

HP-UX System Time change

Hello,
We have HP-UX on ia64 with SAP installed on it.
We need to change the OS-system time to change.
1) How to change OS System time ?
2) Do we need to reboot system after time change?
3) What are the other factors that need to be considered during this time change ?

- Thanks
Hemangi
Honored Contributor
rariasn
Posts: 1,135
Registered: ‎08-09-1999
Message 2 of 8 (4,960 Views)

Re: HP-UX System Time change

Hi Hemangi:

1) How to change OS System time ?

# date [-u] [mmddhhmm[[cc]yy]]

2) Do we need to reboot system after time change?

No

3) What are the other factors that need to be considered during this time change ?

Changing the date while the system is running in multiuser mode should be avoided to prevent disrupting user-scheduled and time sensitive programs and processes. Also, changing the date can cause make and
the SCCS and cron subsystems to behave in an unexpected manner. The cron daemon should be killed prior to setting the date backwards, then restarted. SCCS files should be checked with the val command (see val(1)) if deltas have been made while the clock was wrongly set.


# man date

rgs,
Honored Contributor
rariasn
Posts: 1,135
Registered: ‎08-09-1999
Message 3 of 8 (4,960 Views)

Re: HP-UX System Time change

Hi:

# /sbin/set_parms date_time

Provides an interactive interface to set the date and time.

rgs
Honored Contributor
Laurent Menase
Posts: 1,080
Registered: ‎11-06-2003
Message 4 of 8 (4,960 Views)

Re: HP-UX System Time change

Also if you have database on the system, be sure to shutdown it before changing the date backward, else you have a risk to have new record with creation date smaller than older one.
Honored Contributor
Matti_Kurkela
Posts: 6,271
Registered: ‎12-02-2001
Message 5 of 8 (4,960 Views)

Re: HP-UX System Time change

The actual hardware real-time clock runs in UTC time on most Unix systems, including HP-UX. If you're moving the system to a different timezone, you should be adjusting the timezone settings, not the clock itself.

Any Daylight Saving Time transitions are also handled using the timezone settings (see "man 4 tztab" for more information).

To change the system default timezone settings, use "set_parms timezone". This will require a reboot to ensure all the system daemons are using the new default timezone setting.

It is also possible to run a particular user, session or process using a different timezone from the rest of the system: to do that, just set the TZ environment variable to the appropriate value for the user/session/process. This does not require a reboot. See "man 5 environ" for more details about the TZ environment variable.

MK
MK
Valued Contributor
Valued Contributor
klb
Posts: 159
Registered: ‎12-05-2003
Message 6 of 8 (4,960 Views)

Re: HP-UX System Time change


If you just need to correct the time by a few minutes ( even 10s of minutes ) in either direction, you can use the date command to "drift" the time slowly over time. This will not disrupt scheduled jobs ( even going backward ).

For example, if your clock is 30 minutes behind where it needs to be, this command tells the system to slowly tick the clock faster until 30 minutes have been added to the current time:

date -a 1800

Once you issue this command, there is no indicator that anything is different. You can watch the seconds tick by and ~maybe~ notice it. To get these 30 minutes added to the clock will take apx. 8 hours of real clock time.

Hth,

-klb
Frequent Advisor
Rahul Rai_1
Posts: 53
Registered: ‎09-10-2008
Message 7 of 8 (4,960 Views)

Re: HP-UX System Time change

Hi Hemangi,

You can use either SAM or set_parms

e.g.
set_parms date_time

This allows the user to set the system date and time interactively. The change takes effect immediately.

You just have to take care of crontab.
I would say if smthin imp is there in crontab , shut cron down change time and restart cron.


Regards,
Rahul Rai
Exalted Contributor
Steven E. Protter
Posts: 33,806
Registered: ‎08-15-2002
Message 8 of 8 (4,960 Views)

Re: HP-UX System Time change

Shalom,

3) If you roll back the time, you need to have any applications that use an Oracle database shut down. Probably other apps as well. These apps crash when system time is rolled back.

2) No. See item above.

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
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.