Networker

Re: [Networker] Locating last full backup

2005-12-22 11:20:59
Subject: Re: [Networker] Locating last full backup
From: "Krishnan, Ramamurthy" <Ramamurthy.Krishnan AT KPMG.CO DOT UK>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Thu, 22 Dec 2005 16:18:56 -0000
Matt

The below script takes individual savesets from each client and
calculates the total size of the last full backups.  You can modify the
loop to output the total size of last full backup for each individual
client.

**** Start Script ****

#!/bin/ksh

#set -x

ssFile="/nsr/tmp/ssf_$$.tmp"
outputFile="/nsr/tmp/clsize_$$.tmp"
clientFile="/nsr/tmp/client_$$.tmp"
adminFile="/nsr/tmp/admin_$$.tmp"

echo ". Type: NSR Client        " > "$adminFile"
echo "show name                         " >> "$adminFile"
echo "print                                     " >> "$adminFile"
echo "quit                                      " >> "$adminFile"

# Parse through the servers file and for each
# backup server, create a client/saveset list
# and calculate the size of last full backups

nsrServer="bkserver"

        nsrServer=`echo "$oneLine" | awk '{print $1}'`
        serverTotSize=0

        /usr/sbin/nsradmin -i "$adminFile" -s "$nsrServer" | grep -vi
current | sed 'n;d' | sed 's/[ ;]//g' | \
                cut -d: -f2 | sort | uniq > "$clientFile"

        while read clientName
        do

                echo "Processing savesets of $clientName on $nsrServer.
This may take a while..."
                /usr/sbin/mminfo -av -r 'name' -c "$clientName" -s
"$nsrServer" | \
                        sed 's/\\/\\\\/g' | sort | uniq > "$ssFile"

                # Now loop through the ssFile to calculate size
                while read indiSS
                do
                        echo "\tCalculating size for saveset : $indiSS"
                        indiSize=0
                        indiSize=`/usr/sbin/mminfo -av -s "$nsrServer"
-c "$clientName" -N "$indiSS" \
                                -q "level=full" -ot -r "totalsize(20)" |
tail -1`

                        if [ "$indiSize""a" = "a" ]; then # MMINFO
did'nt return any results
                                indiSize=0
                        fi

                        indiSize=`expr $indiSize + 0`
                        serverTotSize=`expr $serverTotSize + $indiSize`
                        indiSize=`expr $indiSize / 1024 / 1024 / 1024`
                        echo "\t\t\tSaveset size is $indiSize GB"

                done < "$ssFile"

        done < "$clientFile"    # End "Done" for client list for that
server

        # The total size will now be in bytes.  Convert and send the
output
        serverTotSize=`expr $serverTotSize / 1024 / 1024 / 1024`
# in Gigabytes

        echo "Total Full backup size on server $nsrServer is :
$serverTotSize GB " >> "$outputFile"
        echo "\n\n\n"

# Clean up
rm -f "$ssFile"
rm -f "$outputFile"
rm -f "$clientFile"
rm -f "$adminFile"

**** End Script ****

HTH

Rgds, Ram


-----Original Message-----
From: Legato NetWorker discussion [mailto:NETWORKER AT LISTSERV.TEMPLE DOT EDU]
On Behalf Of Matt Temple
Sent: 22 December 2005 16:06
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Subject: [Networker] Locating last full backup

Hello, all, and happy holidays,

          I was looking for a script that would likst out the last full
backup of all filesystems on all clients.   I looked through the
archives in ways that made sense to me, but didn't see what I was
looking for.    Has anyone written a script to do this that he or
she would like to share?

          Thanks.

                                        Matt Temple

--
=============================================================
Matthew Temple                Tel:    617/632-2597
Director, Research Computing  Fax:    617/582-7820
Dana-Farber Cancer Institute  mht AT research.dfci.harvard DOT edu
44 Binney Street, LG300/300   http://research.dfci.harvard.edu
Boston, MA 02115              Choice is the Choice!

To sign off this list, send email to listserv AT listserv.temple DOT edu and
type "signoff networker" in the body of the email. Please write to
networker-request AT listserv.temple DOT edu if you have any problems wit this
list. You can access the archives at
http://listserv.temple.edu/archives/networker.html or via RSS at
http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER



This email has been sent from KPMG LLP, a UK limited liability partnership, or 
from one of the companies within its control (which include KPMG Audit Plc , 
KPMG United Kingdom Plc and KPMG UK Limited). The information in this email is 
confidential and may be legally privileged. It is intended solely for the 
addressee.  Access to this email by anyone else is unauthorised.  If you are 
not the intended recipient, any disclosure, copying, distribution or any action 
taken or omitted to be taken in reliance on it, is prohibited and may be 
unlawful.  When addressed to our clients any opinions or advice contained in 
this email are subject to the terms and conditions expressed in the governing 
KPMG client engagement letter.

To sign off this list, send email to listserv AT listserv.temple DOT edu and 
type "signoff networker" in the
body of the email. Please write to networker-request AT listserv.temple DOT edu 
if you have any problems
wit this list. You can access the archives at 
http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [Networker] Locating last full backup, Krishnan, Ramamurthy <=