#!/bin/ksh host=`hostname|awk -F"." '{print $1}'` tdate=`date` nbbin=/usr/openv/netbackup/bin/admincmd recip=fwellers@uu.net subject=`echo "$host backup report"` outfile=out if [ -s $outfile ] then rm $outfile fi #print report heading echo " NIGHTLY BACKUP STATUS REPORT FROM $host\n" > $outfile echo " $tdate\n\n\n" >> $outfile echo "CLIENT CLASS NAME SCHEDULE STATUS" >> $outfile echo "====== ============================= =========== ======" >>$outfile #get errors $nbbin/bperror -l -hoursago 16 -backstat >/tmp/errlst$$ while read line do client=`echo $line|awk '{print $9}'|cut -d. -f1` classname=`echo $line|awk '{print $14}'` sched=`echo $line|awk '{print $16}'` stat=`echo $line|awk '{print $19}'` echo $client $classname $sched $stat |awk '{printf("%-15s %-35s %-15s %-15s\n",$1,$2,$3,$4) }'>> /tmp/out$$ done>$outfile echo "Subject:$subject\n" > /tmp/out2$$ cat $outfile >> /tmp/out2$$ /usr/lib/sendmail < /tmp/out2$$ 'prodops-backups@uu.net' rm /tmp/errlst$$ rm /tmp/out$$ rm /tmp/out2$$