Solved

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

Posted on 2011-09-18
5
684 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 …
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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.

744 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

13 Experts available now in Live!

Get 1:1 Help Now