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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

korn script via cron

Status
Not open for further replies.

unixkid

IS-IT--Management
May 22, 2001
105
US
Wondering why this script is getting hung up. I have checked the path for ksh but it appears that my lines are DOA.

here is the error log:
+ echo /usr/bin/sh
/usr/bin/sh
+ export ORACLE_SID=EMSEUWEB
/u02/app/EMSEUWEB/scripts/start_app.sh: ORACLE_SID=EMSEUWEB: is not an identifier


here is the script:

set -x
#!/bin/ksh
# Script: start_ems
######################################################
CHK=`cat /tmp/backup`
##########################################################
echo $SHELL
export ORACLE_SID=EMSEUWEB
. /u01/app/oracle/admin/envfiles/ORACLE.env
. /u01/app/oracle/admin/envfiles/$ORACLE_SID.env
###################################################
if [ "${CHK}" = "done" ]
then
/usr/local/bin/sudo nohup /opt/WebSphere/AppServer/bin/startupServer.sh &
# --- start TradeSphere Application Server
/u02/app/EMSEUWEB/TradeSphere72/scripts/ts_start.sh
# ---- Start EMS Application
/u02/app/EMSEUWEB/scripts/startenv.ksh
/u02/app/EMSEUWEB/scripts/startems.ksh
else
print "hello"
exit
 
Hi,
Since u are using shell 'sh',u need to redefine y'r variable definition i.e. instead of
export ORACLE_SID=EMSEUWEB ,declare it as

ORACLE_SID=EMSEUWEB
export ORACLE_SID
I hope this helps.....
 
Try moving your 'set -x' on to the second line of the script for a start, if you really want it to run under /bin/ksh (i.e. [tt]#!/bin/ksh[/tt] has to be the very first line of the script). Annihilannic.
 
Found that the script was forking serveral other scripts...I used a line in the crontab:

/usr/bin/ksh -c /opt/scriptname

It appears I'm still having some issues with sourcing in the envorment varibles. Thanks for everyones suggestions
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top