telemorgan
MIS
Trying to invoke a user profile from within a script but getting errors. This error is only when I try to run the script via the cron. It runs fine manually. Any ideas?
SCRIPT:
/morgan/scripts-<deltekcp>->cat tt2
#!/bin/ksh
#
# SET GLOBAL VARIABLES
IP="10.10.28.55" # target ip
MYMSG_GD="./good.txt" # ouput for successful tests
MYMSG_BD="./bad.txt" # ouput for failed tests
DB="deltekcp griffon epay deltektc testcp" # database names
#
#
# SQL DB TEST
test -z "$ORACLE_HOME" && . /export/home/oracle/.profile # invoke the oracle environment
#
for x in $DB; do # is the listener running?
if [ `/u01/app/oracle/product/8.1.7/bin/tnsping $x | grep -c "^OK "` -ne 0 ]; then
echo "$x : up" >> $MYMSG_GD # Yes, echo message
else
echo "$x : down" >> $MYMSG_BD # No, echo message
fi
done
ERROR (sent to oracle mailbox):
Your "cron" job on enterprise
/morgan/scripts/tt2 2>&1
produced the following output:
stty: : No such device or address
SCRIPT:
/morgan/scripts-<deltekcp>->cat tt2
#!/bin/ksh
#
# SET GLOBAL VARIABLES
IP="10.10.28.55" # target ip
MYMSG_GD="./good.txt" # ouput for successful tests
MYMSG_BD="./bad.txt" # ouput for failed tests
DB="deltekcp griffon epay deltektc testcp" # database names
#
#
# SQL DB TEST
test -z "$ORACLE_HOME" && . /export/home/oracle/.profile # invoke the oracle environment
#
for x in $DB; do # is the listener running?
if [ `/u01/app/oracle/product/8.1.7/bin/tnsping $x | grep -c "^OK "` -ne 0 ]; then
echo "$x : up" >> $MYMSG_GD # Yes, echo message
else
echo "$x : down" >> $MYMSG_BD # No, echo message
fi
done
ERROR (sent to oracle mailbox):
Your "cron" job on enterprise
/morgan/scripts/tt2 2>&1
produced the following output:
stty: : No such device or address