Solved

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

Posted on 2011-09-18
5
690 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 …
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.

615 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