Veritas-bu

[Veritas-bu] Amount of Data Backed up over a specific time

2003-05-14 12:23:18
Subject: [Veritas-bu] Amount of Data Backed up over a specific time
From: Mark.Donaldson AT experianems DOT com (Donaldson, Mark)
Date: Wed, 14 May 2003 10:23:18 -0600
Once more with content...
---------------------------------

This is my script for client totals.  It's made for a 24 hour report, but I
guess you could put 744 hours in for a month's worth.  It totals by client,
then subtotals by policy per client.  I'll put a snippet of output below the
script.

-M

#!/bin/ksh

MAILADDR=YOU AT YOURDOMAIN DOT COM
PATH=$PATH:/usr/openv/netbackup/bin/admincmd
OUT=/var/tmp/`basename $0`.out.$$
TMP=/var/tmp/`basename $0`.tmp.$$
shorthost=`hostname | cut -f1 -d'.'`

hours=24

echo "## Backup totals by client for past $hours hours." >$OUT

# Generate client list - this strangness is to get a complete list
# bpimagelist is all clients even if now deleted but only if they have
images
# bpclclients is all current clients, even if they have no images
# The two together should be all clients
bpimagelist -hoursago $hours|awk '$1=="IMAGE" {print $2}' | sort -u >$TMP
bpclclients -allunique -noheader | awk '{print $3}' >>$TMP
sort -u -o $TMP $TMP

for client in `cat $TMP`
do
  bpimagelist -hoursago $hours -client $client 2>/dev/null >$TMP
  if [ `wc -l $TMP | awk '{print $1}` -eq 0 ]
  then
    echo "\n     Null   \t$client"
  else
    #lost of awk stuff to make pretty totals, KB, MB, and GB.
    awk 'BEGIN {sum=0;OFMT="%8.1f"}
      {if ($1=="IMAGE") {sum=sum+$19}}
      END { if (sum<1024) {
              printf ("\n%9.1f KB\t%s\n",sum,"'$client'")
                         } else {
            if (sum<1048576) {
              printf ("\n%9.1f MB\t%s\n",sum/1024,"'$client'")
                             } else {
              printf ("\n%9.1f GB\t%s\n",sum/1024/1024,"'$client'")
                  }}}' $TMP
    #Subtotal per policy per client
    for policy in `awk '$1=="IMAGE" {print $7}' $TMP | sort -u`
    do
      awk 'BEGIN {sum=0;OFMT="%8.1f"}
        {if ($1=="IMAGE" && $7=="'$policy'" ) {sum=sum+$19}}
        END { if (sum<1024) {
                printf ("\t\t%9.1f KB\tP=%s\n",sum,"'$policy'")
                           } else {
              if (sum<1048576) {
                printf ("\t\t%9.1f MB\tP=%s\n",sum/1024,"'$policy'")
                               } else {
                printf ("\t\t%9.1f GB\tP=%s\n",sum/1024/1024,"'$policy'")
                    }}}' $TMP
    done
  fi
done >>$OUT

mailx -s "NB $shorthost ${hours}hr Rpt:Client Backup Totals" $MAILADDR <$OUT

[ -f $TMP ] && rm -f $TMP
[ -f $OUT ] && rm -f $OUT
exit

--------------------------

Output snippet:
    224.0 KB    whsp00.lodo.exactis.com
                    128.0 KB    P=System_Mux
                     96.0 KB    P=Test

      1.8 MB    whsp02.lodo.exactis.com
                      1.7 MB    P=System_Mux
                     96.0 KB    P=Test

      1.2 MB    whsp04.experian-ems.com
                      1.1 MB    P=System_Mux
                     96.0 KB    P=Test

     16.2 MB    www00.lodo.exactis.com
                     16.2 MB    P=System_Mux
                     96.0 KB    P=Test


-----Original Message-----
From: Sam Grover [mailto:orders AT siraim DOT com]
Sent: Wednesday, May 14, 2003 8:12 AM
To: veritas-bu AT mailman.eng.auburn DOT edu
Subject: [Veritas-bu] Amount of Data Backed up over a specific time


Hi all,

The bosses have now decided they need to measure something within Veritas to
let them know how we're utilizing the system... one of the metrics they've
"invented" is amount of data backed up. I have a script to pull data from
the past x number of hours... but they want the data over a given month.

I'm assuming I'm going to be sifting through the catalog for all backups
done in a given  month and then tally up the fields relating to size of
backup and number of files.... in which cmd line util would I find this (I'm
on 4.5 under HP/UX) and how within either a shell script or Perl would I
tabulate the data?

Thanks,

Sam Grover

<Prev in Thread] Current Thread [Next in Thread>