#!/usr/bin/ksh # A simple script that can assist the Netbackup admin finding MS SQL database files not excluded from the regular file system backup # POLICY=$1 if [ $# -ne 1 ] then echo "Policy name missing !!" exit 1 fi # Calgulate how many days back we look. Adjust the "2 days ago" section to go longer back EPOCH_DATE=`date --date='2 days ago' +%s` BPLIST_STRING_DATE=`date -d @${EPOCH_DATE} +%m/%d/%Y ` # Retrieve a list of client in the policy choose . Since bplist terminate each line with a null byte we need to use sed # to get rid of it else grep doesn't match any mdf ndf or ldf files. /usr/openv/netbackup/bin/admincmd/bppllist ${POLICY} | grep CLIENT | awk '{ print $2 }' | while read CLIENT do echo "Processing ${CLIENT}" echo /usr/openv/netbackup/bin/bplist -B -C ${CLIENT} -R -l -t 13 -s ${BPLIST_STRING_DATE} / | sed 's/\x0//g' | grep -i -a -e "\.mdf$" -e "\.ndf$" -e "\.ldf$" echo done