Here's how I generally handle logging in most of my scripts (this is
obviously from an RMAN backup script): ################################################## ### Start log DT=`date +%Y%m%d%H%M%S` LOG=${LOGS_DEST}/RMAN_${ORACLE_SID}.${LOCALHOST}.INC_$2.$DT.log rm -f $LOG ### save the file descriptors exec 3>&1 exec 4>&2 ### set up output streams exec 1> $LOG exec 2>> $LOG ...do all my stuff here, all output (STDOUT and STDERR is automatically sent to the $LOG because of the commands above ...when I'm done, put this stuff at the bottom: ############################################################ ### Wrap up DT=`date +%Y%m%d%H%M%S` echo "Finished rman backup of $ORACLE_SID on $LOCALHOST (LEVEL $2) : " `date +%Y%m%d%H%M%S` ### restore the file descriptors exec 1>&3 exec 2>&4 Mindaugas Navickas wrote: -- //www.freelists.org/webpage/oracle-l |