Link to home
Start Free TrialLog in
Avatar of LindaC
LindaCFlag for Puerto Rico

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/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java14/jre/bin:/u
sr/java14/bin
 CRONDIR=/var/spool/cron/crontabs
 ATDIR=/var/spool/cron/atjobs
 LOGNAME=oracle
 HOME=/home/oracle

Your "cron" job executed on tbsdev01 on Sun Sep 18 00:00:00 AST 2011
/home/oracle/dba/scripts/COLD_BACKUP_streams.sh TBS6DEV


produced the following output:

sh: /home/oracle/dba/scripts/COLD_BACKUP_streams.sh:  not found.


*****************************************************************
        cron: The previous message is the standard output
        and standard error of one of the cron commands.

tbsdev01-oracle:/home/oracle> /scripts/COLD_BACKUP_streams.sh                <
-rwxr-xr-x   1 oracle   dba            3478 Sep 17 22:06 /home/oracle/dba/script
s/COLD_BACKUP_streams.sh
====================================================================

tbsdev01-oracle:/home/oracle/dba/scripts> echo $0
-ksh


====================================================================
The beggining of the script is the following:  (Only an extract)

#! /bin/bash
PATH=/home/app/oracle/product/9.2.0/bin:/usr/bin:/etc:/usr/lbin:/usr/bin/X11:/us
r/local/bin:/home/app/oracle/product/9.2.0:/usr/sbin:/usr/css/bin:/usr/ucb:/home
/app/oracle/product/9.2.0/network/admin:/usr/openv/netbackup/bin
export PATH
ORACLE_HOME=/home/app/oracle/product/9.2.0
export ORACLE_HOME
export ORACLE_SID=TBS6DEV
BCKNAME=`date +'%m%d%y'`
export BCKNAME
COLDTBS6DEV=/home/oracle/dba/logs/$1.`date '+%Y-%m-%d'`.log
export COLDTBS6DEV
echo $COLDTBS6DEV>/tmp/LOGCOLDTBS6DEV
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_data.sql
select to_char(sysdate,'MM-DD-YY-HH24:MI') from dual;
exit
EOF
mv /home/oracle/dba/lists/TBS6DEVCOLDlist.lst /home/oracle/dba/lists/TBS6DEVCOLD
list
sleep 20
chmod 755 /home/oracle/dba/lists/TBS6DEVCOLDlist
######################################################################
############  Logfile

LOGFILE=`cat /tmp/LOGCOLDTBS6DEV`

############Shutting down the database

/home/oracle/dba/scripts/stopdb_TBS6DEV.sh >> $LOGFILE
sleep 20
while ps -ef|grep -wc [o]ra_pmon_$1
do
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Do you actually have /bin/bash in AIX? The bash from the rpm package normally installs as /opt/freeware/bin/bash with a link to /usr/bin/bash

wmp
Avatar of LindaC

ASKER

tbsdev01-oracle:/usr> ls -ltr /bin/bash
ls: 0653-341 The file /bin/bash does not exist.
tbsdev01-oracle:/usr>
Avatar of LindaC

ASKER

CAn my script run well without inlcuding the first line that mentions bash?
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LindaC

ASKER

Thank you.