#! /bin/sh # $Header: bpstart_notify.sh,v 1.4 2005/06/28 15:22:02 $ # #bcpyrght #*************************************************************************** #* $VRTScprght: Copyright 1993 - 2012 Symantec Corporation, All Rights Reserved $ * #*************************************************************************** #ecpyrght # # bpstart_notify.sh # # This script is called by NetBackup when bpbkar is started up on the client # to do a backup or archive. # # This script: # receives 4 parameters: CLIENTNAME POLICYNAME SCHEDNAME SCHEDTYPE # 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 BPSTART_TIMEOUT in the /usr/openv/netbackup/bp.conf file on the server. # # 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 4 ] then exit 1 fi if [ "$4" = "FULL" -o "$4" = "INCR" -o "$4" = "CINC" ] then OUTF=/usr/openv/netbackup/bin/BPSTART_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 started on $1 - policy $2 schedule $3 >> $OUTF ;; "INCR") echo `date` differential incremental backup started on $1 - policy $2 schedule $3 >> $OUTF ;; "CINC") echo `date` cumulative incremental backup started on $1 - policy $2 schedule $3 >> $OUTF ;; esac # # might want to mail this info to someone # # cat $OUTF | mail -s "NetBackup backup started" someone_who_cares # # CAUTION: some platforms do not allow the -s parameter on mail # fi exit 0