HemaV
August 25, 2011, 5:24am
1
Hi All,
Need to run a1.sh script using nohup command (since crontab facility not there in my unix server) as below:
nohup ksh -x a1.sh &
a1.sh contains:
nohup ksh -x b1.sh 2> b1.log &
In a1.sh script i need to trigger b1.sh script every one hour. How to loop b1.sh to run for every 1 hour?
Thanks in Advance,
panyam
August 25, 2011, 5:28am
2
How long the b1.sh script runs?
You can use sleep command in side a1.sh for a predefined time and then can fire b1.sh from it.
HemaV
August 25, 2011, 5:31am
3
but the problem is b1.sh script takes around 35mins to run.
i need to run b1.sh for every 1 hour. Is there a way to loop around without sleep command using date command?
Thanks in Advance,
panyam
August 25, 2011, 6:13am
4
How about this?
cat a1.sh
while true
do
if [ -f /tmp/verify ] ; then
exit
fi
sleep 3600
nohup ksh -x b1.sh 2> b1.log &
done
run nohup a1.sh &
When you want to come out of script create a file /tmp/verify
I'm not sure on how you want to use date here!
cero
August 25, 2011, 6:39am
5
@HemaV : are you able to use the at
command?