An easy way to search for failures in NetBackup is as follows:
#!/bin/bash
if [ $# -eq 1 ]
then
HOURS=$1
/usr/openv/netbackup/bin/admincmd/bperror -backstat -U -hoursago $HOURS | nawk ‘$1 != “0” && $1 != “1” && $0 !~ /the requested operation was partially successful/’
else
/usr/openv/netbackup/bin/admincmd/bperror -backstat -U -hoursago 18 | nawk ‘$1 != “0” && $1 != “1” && $0 !~ /the requested operation was partially successful/’
fi
So if you run the script without any arguments, it will default to looking at the past 18 hours. If you use an argument, it will be used as the number of hours.
So if you save the script as fail_check.sh
./fail_check.sh without any arguments will run against the past 18 hours.
./fail_check.sh 24 will run against the past 24 hours.