That sounds good, can I put some kind of delay before calling the function? If so can you please give me an example how can I fit that into the calling environment below:
#####
#
# MAIN ROUTINE
#
#####
REV="1.0"
HOST=`uname -n`
PROG=`basename $0`
ORA_HOST=`hostname`
# Set a variable that corresponds to 'whitespace'. This variable should
# contain a space and a tab. In 'vi', 'set list' will show the following:
#
# WS=" ^I"$
#
WS=" "
# Create some variables to simplify regular expression evaluations
#
# WA - Any number of white space character(s)including 0
# WN - Any character(s) including none except white space character(s)
# W1 - At least 1 white space character(s)
#
WA="[$WS]*"
WN="[^$WS]*"
W1="[$WS]+"
# Exit codes
#
# EXIT0 Backup Successful
# EXIT1 Usage error or execution termination by the user
# EXIT2 Missing executables or unset environment variables
# EXIT3 Backup Unsucessful
#
EXIT0=0
EXIT1=1
EXIT2=2
EXIT3=3
#
# Begin
#
if [ $# -eq 0 ];
then
usage;
fi
while getopts ":s:a
:b:d" OPTM "$@"
do
case "${OPTM}" in
s) SID=${OPTARG};;
a) ARC_SCRIPT=${OPTARG}
S_SCRIPT=${OPTARG}
ARC_OBK='Y';;
o) ORA_SCRIPT=${OPTARG}
S_SCRIPT=${OPTARG}
ORA_OBK='Y';;
b) BPERSON=`cat /com/oracle/omon/config/on_call_dba`;;
d) DEBUG="ON";;
*) notify -p "**ERROR : Invalid option -${OPTARG}"
usage;;
esac
done
set_def_vars;
set_local_env;
notify -l "Starting onlinerman V.${REV}"
set_ora_env;
set_rman_env;
chk_plus;
chk_rman;
# chk_oracle;
if [ ${ARC_OBK} = 'Y' ];
then
chk_arc_rman_script;
fi
if [ ${ORA_OBK} = 'Y' ];
then
chk_ora_rman_script;
fi
if [ ${ARC_OBK} = 'Y' ];
then
create_log_file_name "${RMN_ARC_SCRIPT}";
run_rman "${RMN_ARC_SCRIPT}";
if [ $? -eq 0 ];
then
validate_backup;
fi
fi
if [ ${ORA_OBK} = 'Y' ];
then
create_log_file_name "${RMN_ORA_SCRIPT}";
run_rman "${RMN_ORA_SCRIPT}";
if [ $? -eq 0 ];
then
validate_backup;
fi
fi
notify -l "Completed onlinerman V.${REV}"
cp $RMN_LOG_DIR/${OJOB}.rcv.log /dbbackup/oracle/backup/$SID
exit ${EXIT0};
#----------------------------------------------------------------------------
Appreciate
Kal