Solved

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

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AIX  NFS  question 1 137
how to check for shares on HP-UX 1 59
Linux :how to provide sudo access to the user 13 96
Wrap Oraccle SQL*Plus executable Command 4 83
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
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 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…
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…

776 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