Veritas-bu

[Veritas-bu] amount of data backed up

2002-04-25 10:29:09
Subject: [Veritas-bu] amount of data backed up
From: david AT xbpadm-commands DOT com (David A. Chapa)
Date: Thu, 25 Apr 2002 09:29:09 -0500
No, but I have a script for that...

This was my original, I think I made some mods for a client recently but
can't put my finger on it right now, but hey its a start.

Its kind of limited because you have to give it the schedule names in the
grep statements in order to extract the FULL and INCRM schedules.

I'll try to find my other one, which I think is better (has to be better
than this...after looking at this, I'm kind of embarrassed to send it out.
Now I know why I haven't posted this one to my site yet)

:-)

David

#!/bin/ksh
#********************************************************************
# Filename:     data_backed_up
#
# Purpose:      Determine amount of data being backed up with
#               NetBackup for both Full and Incremental
#               schedules.
#
# Author: David A. Chapa, DataStaff, Inc.
#
# Revision History:
# 06/26/98      Initial Creation
# 11/17/98      dac:Updated design and added more functionality
#*******************************************************************
#
KBYTES=0
FULLS=/tmp/fullbackups
INCRM=/tmp/incrmbackups
HEADER=/tmp/workfil.kb
OUTPUT=/tmp/data_jobs
OUTPUT1=/tmp/data_backup_full
OUTPUT2=/tmp/data_backup_incrm
ALLBKUPS=/tmp/allbkups
#
if [ -f $OUTPUT ];then
rm $OUTPUT
fi
if [ -f $OUTPUT1 ];then
rm $OUTPUT1
fi
#
if [ -f $OUTPUT2 ];then
rm $OUTPUT2
fi
echo " CLIENT       KBytes      CLASS       SCHEDULE      DATE
COMPLETED" > $HEADER
echo
"=======================================================================" >>
$HEADER
#
#       Find the successful Backups (Status 0 and 1) minus any unnecessary data
#
#
bperror -hoursago 120 -backstat -U | fgrep -v "(" > $ALLBKUPS
#
#       Find FULL Backups first
#
cat $ALLBKUPS | fgrep -vi daily |
#  daily is the incremental schedule name
#
#       This regular expression excludes any status code between   2 and   9
#       with two spaces in front to the number.
#
grep -v ^"\ \{2,\}[2-9]\{2\}" |
#
#       This regular expression excludes any status code between  00 and  99
#       with one space in front to the number
#
grep -v ^"\ \{1,\}[0-9]\{2\}" |
#
#       This regular expression excludes any status code between 000 and 999
#       with no spaces in front to the number
#
grep -v ^"[0-9]\{3\}" > $FULLS
#
#       Then puts all of this in a file called fullbackups
#
#       Now find the Incrementals
#
cat $ALLBKUPS | fgrep -vi weekly | fgrep -vi monthly | fgrep -vi year |
grep -v ^"\ \{2,\}[2-9]\{2\}" |
grep -v ^"\ \{1,\}[0-9]\{2\}" |
grep -v ^"[0-9]\{3\}" > $INCRM
#
# again, weekly, monthly and year are the FULL schedule names to exclude to
get the Incrm info
dupclient=""

for i in $FULLS $INCRM
do
cat $i | tail +2 | while read status client class schedule server date time
do
  if [ "$client" != "$dupclient" ];then
        bperror -d $date -e $date $time -client $client -server $server | grep
Kbytes |
        awk -F\, '{print $4}' | awk '{print $1}' | while read total
         do
          KBYTES=`expr $total + $KBYTES`
         done
        printf '%-12s' $client >> $OUTPUT
        printf '%12s' $KBYTES"   " >> $OUTPUT
        printf '%-14.11s' $class >> $OUTPUT
        printf '%-12s' $schedule >> $OUTPUT
        printf '%-9s' $date >> $OUTPUT
        printf '%11s\n' $time >> $OUTPUT
  fi
dupclient=$client
KBYTES=0
done
cat $HEADER > $i.rpt
cat $OUTPUT >> $i.rpt
cp /dev/null $OUTPUT
done

<><><><><><><><><><><><><><><><><><><><>
David A. Chapa
NetBackup Consultant
DataStaff, Inc.
http://www.consulting.datastaff.com
847 413 1144
---------------------------------------
NBU-LSERV AT datastaff DOT com - Adv. Scripting
http://www.xbpadm-commands.com

-----Original Message-----
From: veritas-bu-admin AT mailman.eng.auburn DOT edu
[mailto:veritas-bu-admin AT mailman.eng.auburn DOT edu]On Behalf Of Jeff
Kennedy
Sent: Wednesday, April 24, 2002 4:47 PM
To: NBU List
Subject: [Veritas-bu] amount of data backed up


Is there a command that will tell me how much data was backed up by
client for a given schedule, like the last full?

Thanks.
--
=====================
Jeff Kennedy
Unix Administrator
AMCC
jlkennedy AT amcc DOT com
_______________________________________________
Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu


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