LindaC
asked on
Cron did not found my script why - the ls -ltr found it
Hi experts. I don't know how to fix or make this work.
The cron did not find my script, but my script is there and have the privileges to be executed.
Cron Environment:
SHELL =
PATH=/usr/bin:/etc:/usr/sb in:/usr/uc b:/usr/bin /X11:/sbin :/usr/java 14/jre/bin :/u
sr/java14/bin
CRONDIR=/var/spool/cron/cr ontabs
ATDIR=/var/spool/cron/atjo bs
LOGNAME=oracle
HOME=/home/oracle
Your "cron" job executed on tbsdev01 on Sun Sep 18 00:00:00 AST 2011
/home/oracle/dba/scripts/C OLD_BACKUP _streams.s h TBS6DEV
produced the following output:
sh: /home/oracle/dba/scripts/C OLD_BACKUP _streams.s h: not found.
************************** ********** ********** ********** *********
cron: The previous message is the standard output
and standard error of one of the cron commands.
tbsdev01-oracle:/home/orac le> /scripts/COLD_BACKUP_strea ms.sh <
-rwxr-xr-x 1 oracle dba 3478 Sep 17 22:06 /home/oracle/dba/script
s/COLD_BACKUP_streams.sh
========================== ========== ========== ========== ========== ==
tbsdev01-oracle:/home/orac le/dba/scr ipts> echo $0
-ksh
========================== ========== ========== ========== ========== ==
The beggining of the script is the following: (Only an extract)
#! /bin/bash
PATH=/home/app/oracle/prod uct/9.2.0/ bin:/usr/b in:/etc:/u sr/lbin:/u sr/bin/X11 :/us
r/local/bin:/home/app/orac le/product /9.2.0:/us r/sbin:/us r/css/bin: /usr/ucb:/ home
/app/oracle/product/9.2.0/ network/ad min:/usr/o penv/netba ckup/bin
export PATH
ORACLE_HOME=/home/app/orac le/product /9.2.0
export ORACLE_HOME
export ORACLE_SID=TBS6DEV
BCKNAME=`date +'%m%d%y'`
export BCKNAME
COLDTBS6DEV=/home/oracle/d ba/logs/$1 .`date '+%Y-%m-%d'`.log
export COLDTBS6DEV
echo $COLDTBS6DEV>/tmp/LOGCOLDT BS6DEV
if [ "$#" -ne 1 ]
then
echo "Usage : $0 <ORACLE_SID>"
exit 1
fi
############ The listing
sqlplus /nolog <<EOF
connect /as sysdba
spool /home/oracle/dba/logs/test .log
select to_char(sysdate,'MM-DD-YY- HH24:MI') from dual;
@/home/oracle/dba/scripts/ listar_dat a.sql
select to_char(sysdate,'MM-DD-YY- HH24:MI') from dual;
exit
EOF
mv /home/oracle/dba/lists/TBS 6DEVCOLDli st.lst /home/oracle/dba/lists/TBS 6DEVCOLD
list
sleep 20
chmod 755 /home/oracle/dba/lists/TBS 6DEVCOLDli st
########################## ########## ########## ########## ########## ####
############ Logfile
LOGFILE=`cat /tmp/LOGCOLDTBS6DEV`
############Shutting down the database
/home/oracle/dba/scripts/s topdb_TBS6 DEV.sh >> $LOGFILE
sleep 20
while ps -ef|grep -wc [o]ra_pmon_$1
do
The cron did not find my script, but my script is there and have the privileges to be executed.
Cron Environment:
SHELL =
PATH=/usr/bin:/etc:/usr/sb
sr/java14/bin
CRONDIR=/var/spool/cron/cr
ATDIR=/var/spool/cron/atjo
LOGNAME=oracle
HOME=/home/oracle
Your "cron" job executed on tbsdev01 on Sun Sep 18 00:00:00 AST 2011
/home/oracle/dba/scripts/C
produced the following output:
sh: /home/oracle/dba/scripts/C
**************************
cron: The previous message is the standard output
and standard error of one of the cron commands.
tbsdev01-oracle:/home/orac
-rwxr-xr-x 1 oracle dba 3478 Sep 17 22:06 /home/oracle/dba/script
s/COLD_BACKUP_streams.sh
==========================
tbsdev01-oracle:/home/orac
-ksh
==========================
The beggining of the script is the following: (Only an extract)
#! /bin/bash
PATH=/home/app/oracle/prod
r/local/bin:/home/app/orac
/app/oracle/product/9.2.0/
export PATH
ORACLE_HOME=/home/app/orac
export ORACLE_HOME
export ORACLE_SID=TBS6DEV
BCKNAME=`date +'%m%d%y'`
export BCKNAME
COLDTBS6DEV=/home/oracle/d
export COLDTBS6DEV
echo $COLDTBS6DEV>/tmp/LOGCOLDT
if [ "$#" -ne 1 ]
then
echo "Usage : $0 <ORACLE_SID>"
exit 1
fi
############ The listing
sqlplus /nolog <<EOF
connect /as sysdba
spool /home/oracle/dba/logs/test
select to_char(sysdate,'MM-DD-YY-
@/home/oracle/dba/scripts/
select to_char(sysdate,'MM-DD-YY-
exit
EOF
mv /home/oracle/dba/lists/TBS
list
sleep 20
chmod 755 /home/oracle/dba/lists/TBS
##########################
############ Logfile
LOGFILE=`cat /tmp/LOGCOLDTBS6DEV`
############Shutting down the database
/home/oracle/dba/scripts/s
sleep 20
while ps -ef|grep -wc [o]ra_pmon_$1
do
ASKER
tbsdev01-oracle:/usr> ls -ltr /bin/bash
ls: 0653-341 The file /bin/bash does not exist.
tbsdev01-oracle:/usr>
ls: 0653-341 The file /bin/bash does not exist.
tbsdev01-oracle:/usr>
ASKER
CAn my script run well without inlcuding the first line that mentions bash?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you.
wmp