Solved

Cron did not found my script why - the ls -ltr found it

Posted on 2011-09-18
5
686 Views
Last Modified: 2013-11-17
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
0
Comment
Question by:LindaC
  • 3
  • 2
5 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 36556327
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
0
 
LVL 8

Author Comment

by:LindaC
ID: 36556361
tbsdev01-oracle:/usr> ls -ltr /bin/bash
ls: 0653-341 The file /bin/bash does not exist.
tbsdev01-oracle:/usr>
0
 
LVL 8

Author Comment

by:LindaC
ID: 36556364
CAn my script run well without inlcuding the first line that mentions bash?
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 36556368
Your script should run fine with

#!/bin/ksh
0
 
LVL 8

Author Closing Comment

by:LindaC
ID: 36556377
Thank you.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now