... or something like that. To look at the last week, just change the "hoursago" parameter from 24 to 168
(the $19 might actually be $18 - I can't remember right now)
But yes, what Ed says about expired backups not being included is right. But as long as you have at least 1 week's retention on all your backups, the above command works for me.
- Dean
z=0
for x in $(/usr/openv/netbackup/bin/admincmd/bpimagelist -U -hoursago 64 | grep -v "^[KB-]" | awk '{ print $5 }')
do
z=$(( $x + z ))
done
echo $z | /usr/bin/mail -s "Production Weekend Backups" someonewhocares AT domain DOT com
set z to 0 so we start out at 0
What the for loop does.
Run the bpimagelist command (this will run for each server you have configured) and get info back to 64 hours - I do 64 because I only run this for the weekend backups. You would want two - one to run for 24 hours to get your daily backup totals. And one to run for your weekend (or just do one each day))
It then greps for all lines except for the header (has a KB in it) or the separator line which has a - in it)
Then we awk out column 5 which is the kb's backed up for each server. That amount is the x variable
Add that x to z which started out as 0
And do it again, adding to z until you get the total for all you backed up in the last number of hours.
Then it emails that total.
Which for me gets put into a chart once a week so I can watch how much we grow.