1745893 Members
4813 Online
108723 Solutions
New Discussion юеВ

HP-UX System Time change

 
Hemangi
New Member

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
7 REPLIES 7
rariasn
Honored Contributor

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,
rariasn
Honored Contributor

Re: HP-UX System Time change

Hi:

# /sbin/set_parms date_time

Provides an interactive interface to set the date and time.

rgs
Laurent Menase
Honored Contributor

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.
Matti_Kurkela
Honored Contributor

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
klb
Valued Contributor

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
Rahul Rai_1
Frequent Advisor

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
Steven E. Protter
Exalted Contributor

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