Operating System - HP-UX
1753808 Members
7956 Online
108805 Solutions
New Discussion юеВ

Re: Setting date backwards on HP

 
Alpa Shah
Advisor

Setting date backwards on HP

Hi,

While setting the system date backwards on HP m/c it asks me a question.

do you really want to run time backwards?[yes/no]

Is there any switch which can skip this question and change the system date?

I want to use *date* command in perl script and hence want to avoid this question.

Thanks in advance.
7 REPLIES 7
Pete Randall
Outstanding Contributor

Re: Setting date backwards on HP

The reason the question is asked is because setting the date backwards can have bad consequences for Database servers, where it messes up the re-do logs, causing recovery efforts to be problematic at best.

This little shell script snippet should get you past the response requirement:

echo "yes" > /tmp/yes_time
CTIME=`date +%m%d%H%M%y`
date $CTIME < /tmp/yes_time


Pete

Pete
spex
Honored Contributor

Re: Setting date backwards on HP

# date
Thu Sep 20 08:32:43 EDT 2007
# echo "yes" | date 09200732
date: do you really want to run time backwards?[yes/no]Thu Sep 20 07:32:00 EDT 2007
# date
Thu Sep 20 07:32:02 EDT 2007

PCS
Alpa Shah
Advisor

Re: Setting date backwards on HP

Thanks a lot.
Ivan Krastev
Honored Contributor

Re: Setting date backwards on HP

Note that warning from date manual:
The cron daemon should be killed prior to setting the date backwards, then restarted.

regards,
ivan
Dennis Handly
Acclaimed Contributor

Re: Setting date backwards on HP

I don't think anyone asked why you wanted to set the date backwards. Is this to test DST testing? If so, there are perl scripts to find the beginning and ending times after you install a tztab(4) patch.
See Clay's perl script here:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1097748
Alpa Shah
Advisor

Re: Setting date backwards on HP

No, this is something related to licensing.
I want to install a demo license and then want to expire that license by advancing the system date for testing purpose. And then have to set the date back to current date.

Thanks much for the information.
Bill Hassell
Honored Contributor

Re: Setting date backwards on HP

Setting the date forward and backward for testing should be fine as long as the system has no production applications. But if you have any applications and cron jobs on your system, you can safely assume that there will be a lot of problems, some of which may not be immediately visible.


Bill Hassell, sysadmin