Space required for next weekend backups

You know this situation. In some remote site you have just some amount of empty tapes available and nobody to add new ones to library available. Or it's Friday afternoon, tape library is down and you don't know whether the space on staging disk storage unit will be enough to accomodate wekend backups?

Here is a shell oneliner showing sum of last full backups for clients from list of policies (the policies configured for this particular storage unit):

cat /tmp/policies.txt| while read x; do bppllist $x| grep "^CLIENT "| cut -f2 -d" "; done| sort -u| while read client; do bpimagelist -d 01/01/2000 -client $client -U| grep -v -e "---" -e Expires| grep "Full Backup" | head -1; done| awk 'BEGIN{sum=0}{sum=sum+$5}END{printf ("%.2f\n", sum/1024/1024)}

Or nicer formatting

cat /tmp/policies.txt| while read x
do bppllist $x| grep "^CLIENT "| cut -f2 -d" "
done| sort -u| while read client
do bpimagelist -d 01/01/2000 -client $client -U| grep -v -e "---" -e Expires| grep "Full Backup" | head -1
done| awk 'BEGIN{sum=0}{sum=sum+$5}END{printf ("%.2f\n", sum/1024/1024)}

FIlter "Full Backup" matches filesystem full backups. In case of database backups you have to modify what grep should pass. Result is in GBs.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
What you need to type to URL bar to reach this web...