#! /bin/sh # $Header: bpend_notify.sh,v 1.3 2003/08/13 14:11:54 $ # #bcpyrght #*************************************************************************** #* $VRTScprght: Copyright 1993 - 2007 Symantec Corporation, All Rights Reserved $ * #*************************************************************************** #ecpyrght # # bpend_notify.sh # # This script is called by NetBackup when bpbkar is finished doing a # backup on the client. It is also called after backing up the files # for a user directed archive, but before the files are deleted. # # This script: # receives 5 parameters: CLIENTNAME POLICYNAME SCHEDNAME SCHEDTYPE STATUS # must be executable by the root user # should exit with 0 upon successful completion # # If this script will not complete within a few seconds, you should set # the BPEND_TIMEOUT in the /usr/openv/netbackup/bp.conf file on the server. # You should also be aware that the time taken by this script will slow # down other backups that are waiting for this client to complete. # # This script should be installed with mode 555 so that user directed # backups and archives will be able to execute this script. # # CAUTION: writing anything to stdout or stderr will cause backup problems # # -------------------------------------------------------------------- # main script starts here # -------------------------------------------------------------------- umask 022 if [ "$#" -ne 5 ] then exit 1 fi if [ "$4" = "FULL" -o "$4" = "INCR" -o "$4" = "CINC" ] then OUTF=/usr/openv/netbackup/bin/BPEND_CALLED # You may want to delete the output file elsewhere in order to # accumulate successful backup information. # If so, comment out the following 4 lines. if [ -s $OUTF ] then /bin/rm -rf $OUTF fi if [ ! -f $OUTF ] then touch $OUTF fi case "$4" in "FULL") echo `date` full backup finished on $1 - policy $2 schedule $3. Exit status = $5 >> $OUTF /usr/openv/netbackup/bin/db_end_bkup -user oracle -home /u01/app/oracle/product/10.2.0/db_1 -base /u01/app/oracle -sid orcl -init /u01/app/oracle/product/10.2.0/db_1/admin/orcl/pfile/init.ora >> $OUTF ;; "INCR") echo `date` differential incremental backup finished on $1 - policy $2 schedule $3. Exit status = $5 >> $OUTF /usr/openv/netbackup/bin/db_end_bkup -user oracle -home /u01/app/oracle/product/10.2.0/db_1 -base /u01/app/oracle -sid orcl -init /u01/app/oracle/product/10.2.0/db_1/admin/orcl/pfile/init.ora >> $OUTF ;; "CINC") echo `date` cumulative incremental backup finished on $1 - policy $2 schedule $3. Exit status = $5 >> $OUTF /usr/openv/netbackup/bin/db_end_bkup -user oracle -home /u01/app/oracle/product/10.2.0/db_1 -base /u01/app/oracle -sid orcl -init /u01/app/oracle/product/10.2.0/db_1/admin/orcl/pfile/init.ora >> $OUTF ;; esac # # might want to mail this info to someone # # cat $OUTF | mail -s "NetBackup backup finished" someone_who_cares # # CAUTION: some platforms do not allow the -s parameter on mail # fi exit 0