#!/bin/tcsh #1. Create a file of all disk images from the Netbackup catalog that Netbackup thinks is on disk. echo "Creating list of all images that Netbackup thinks is on disk." cp /dev/null catall grep "F:\\backup" cat.txt | sed -e "s/F:\\backup\\/\*/g" | awk -F\* '{print "F:\\backup\\" $2}' >> catall grep "G:\\backup" cat.txt | sed -e "s/G:\\backup\\/\*/g" | awk -F\* '{print "G:\\backup\\" $2}' >> catall grep "H:\\backup" cat.txt | sed -e "s/H:\\backup\\/\*/g" | awk -F\* '{print "H:\\backup\\" $2}' >> catall #2. Create file of what's on disk echo "Create file listing of all images on disk." cp /dev/null dirall grep "_" Fdir.txt | awk '{print "F:\\backup\\" $5}' > dirall grep "_" Gdir.txt | awk '{print "G:\\backup\\" $5}' >> dirall grep "_" Hdir.txt | awk '{print "H:\\backup\\" $5}' >> dirall #3. sort the files echo "Sorting the two files" sort catall > catall.srt sort dirall > dirall.srt #4. check em echo "Checking the differences." diff -u dirall.srt catall.srt |grep "^-" |grep -v "\-\-\-" |sed -e s/\-//g > delfile.list #5. create batch file echo "Creating a batch file to delete the files that Netbackup doesn't know about." awk '{print "del " $1}' delfile.list > delfile.bat