Operating System - HP-UX
1757656 Members
2498 Online
108862 Solutions
New Discussion юеВ

how to Run a part of script after 24 hours

 
Sanjeev gupta_2
Frequent Advisor

how to Run a part of script after 24 hours

Hi
I want to run a particuar part of a script after 24 hours. How can i do that.
Pl. suggest
Thx
6 REPLIES 6
tarek_3
Frequent Advisor

Re: how to Run a part of script after 24 hours

hi
U can use the sleep command before the part that you want run after 24 h

for example:


sleep 86400
commands

Regards
hassoun
Sanjeev gupta_2
Frequent Advisor

Re: how to Run a part of script after 24 hours

My Requirement doesnot fulfill with 'sleep'
Biswajit Tripathy
Honored Contributor

Re: how to Run a part of script after 24 hours

> My Requirement doesnot fulfill with 'sleep'

And why is that?

Just curious..

- Biswajit
:-)
Nguyen Anh Tien
Honored Contributor

Re: how to Run a part of script after 24 hours

IF your script run at fixed time, use crontab, like this:
[ALADIN:/] crontab -l
# minute hour(0-23) monthday(0-31) monthday(1-12) weekday(0-6) Command
00 00 * * 4 sh /script/App_shutdown.sh


Otherwise: user sleep function in shell:
Look at Basic shell doc at:
www.docs.hp.com/en/B2355-90046/
You can get system time by this script:

Gethour=`date +"%H"`
if $Gethour=1 then
command 1
else
fi

Regard
tienna
HP is simple
Paul Torp
Regular Advisor

Re: how to Run a part of script after 24 hours

then us the #at or cron...
"sendmail is kind of fun..."
Trond Haugen
Honored Contributor

Re: how to Run a part of script after 24 hours

You could schedule it with athe at command.
Of course that requires it to be a separate scipt or started with a option to indicate that a particular part of it is to be run.

Regards,
Trond
Regards,
Trond Haugen
LinkedIn