Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script runs ok from prompt but not from crontab 1

Status
Not open for further replies.

Scunningham99

Programmer
Sep 20, 2001
815
GB
Hi

I have the following script which runs fine under the oracle user, but when i run under oracle's users crontab it does not run.

Any Ideas?

#script which is run every half hour to check instances are up in cluster
#SC 10/03/2009


instance1=`/u01/app/oracle/product/10.2.0/db_1/bin/srvctl status instance -d AUSLIVE -i AUSL1 |awk '/Instance/{print $4}'`
instance2=`/u01/app/oracle/product/10.2.0/db_1/bin/srvctl status instance -d AUSLIVE -i AUSL2 |awk '/Instance/{print $4}'`
instance3=`/u01/app/oracle/product/10.2.0/db_1/bin/srvctl status instance -d AUSLIVE -i AUSL3 |awk '/Instance/{print $4}'`


if [ "$instance1" = "running" ]
then
# /bin/mailx -s "AUSLIVE INSTANCE 1 (AUSL1) is DOWN !!!!!!!!!!" orclsupportdba@diamondresorts.com < inst1_notup.txt
echo "working" > crap
fi

if [ "$instance2" = "running" ]
then
/bin/mailx -s "AUSLIVE INSTANCE 2 (AUSL2) is DOWN !!!!!!!!!!" orclsupportdba@diamondresorts.com < inst2_notup.txt
fi

if [ "$instance3" = "running" ]
then
/bin/mailx -s "AUSLIVE INSTANCE 3 (AUSL3) is DOWN !!!!!!!!!!" orclsupportdba@diamondresorts.com < inst3_notup.txt
fi


Sy UK
 
I'd source (dot command) the oracle's profile at the beginning of your script.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top