cat parent_end_notify #! /bin/sh # $Header$ #bcpyrght #*************************************************************************** #* $Copyright: Copyright (c) 2016 Veritas Technologies LLC. All rights reserved VT25-0977-2658-84-51-3 $ * #*************************************************************************** #ecpyrght # # parent_end_notify.sh # # This script is called by GenBackupJob (nbjm), after the parent job has completed. # # NOTE: this script will always be run in "background" mode, meaning that # GenBackupJob (nbjm) will NOT wait for it's completion. # # This script: # receives 7 parameters: # CLIENT - the client hostname # POLICY - the policy label # SCHEDULE - the schedule label # SCHEDULE_TYPE - the type of schedule: FULL INCR UBAK UARC # STATUS - the backup status for this job # STREAM - the backup stream number for this job always -1 # STREAM_CNT - # streams started (if -1, genjob failed to call pem) # must be executable by the root user # should exit with 0 upon successful completion if [ $2 = "SAP_JOB_A" ] then OUTF=/usr/openv/netbackup/bin/PARENT_END_CALLED.SAP_JOB_A # -------------------------------------------------------------------- # main script starts here # -------------------------------------------------------------------- umask 022 dateStr=`date` if [ "$#" -lt 7 ] then echo ${dateStr} "parent_end_notify expects at least 7 parameters: $*" >> $OUTF exit 1 fi # 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 echo ${dateStr} "-----------------------------" >> $OUTF echo ${dateStr} " CLIENT: $1" >> $OUTF echo ${dateStr} " POLICY: $2" >> $OUTF echo ${dateStr} " SCHEDULE: $3" >> $OUTF echo ${dateStr} "SCHEDULE TYPE: $4" >> $OUTF echo ${dateStr} " STATUS: $5" >> $OUTF echo ${dateStr} " STREAM: $6" >> $OUTF echo ${dateStr} " STREAM_CNT: $7" >> $OUTF echo ${dateStr} "-----------------------------" >> $OUTF /usr/openv/netbackup/bin/bpbackup -i -p SAP_JOB_B -s XXX -h xxxx -t 17 >> $OUTF # # might want to mail this info to someone # # cat $OUTF | mail -s "NetBackup parent end notify" someone_who_cares exit 0