> -----Original Message-----
> From: EMC NetWorker discussion [mailto:NETWORKER AT LISTSERV.TEMPLE DOT EDU]
On
> Behalf Of dmitri
> Sent: Tuesday, April 07, 2009 1:23 PM
> To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
> Subject: [Networker] [SPAM] Re: Determine total backup footprint?
>
> Here's a script I use for such purpose:
> ================8<=================
> #!/usr/bin/bash
> TOTAL=0
> printf "\ntotal size of FULL backups for the last week run, by the
> groups:\n"
> for NSRgroup in LIST OF YOUR GROUPS
> do
> SIZE=`mminfo -ar totalsize -t'last week'
-qlevel=full,group=$NSRgroup |
> awk\ {sum=sum+$0};END {print sum}'`
> SIZEgb=`expr $SIZE / 1073741824`
> TOTAL=`expr $TOTAL + $SIZEgb`
> printf $NSRgroup":\t"$SIZEgb" GB\n"
> done
> printf "====\nTOTAL:\t\t$TOTAL GB\n\n"
> =================8<==============
>
> Obvoiusly, "mminfo" parameters can be modified
>
> Cheers
Thanks Dmitri -
For Windows, here's some powershell equivalent of above (output
formatting needs work/improvement, sorry!)
Regards,
Jamie
########################################################################
####################
# WeeklyFullSizesByGroup.ps1
# ---------------------------
#
# Original bash shell code by <dmitri_ryjikh AT ml DOT com>
#
# Purpose: Determine total backup footprint in GB , for the prior
week, by GROUP names
########################################################################
####################
# Enter/replace the names of your networker backup groups into the array
below:
$groups = @("Exchange","Weekly4")
$TOTAL=0
Write-Host "Total size of FULL backups for the last week run, by the
groups:"
foreach ($groupname in $groups) {
$SIZES = (mminfo -ar totalsize -t 'last week' -q
"level=full,group=$groupname")
$TotalSize = 0
foreach ($val in $SIZES) {
$TotalSize += $val.Trim()
}
$SizeGB = $TotalSize / 1GB
$FinalSizeGB = "{0:N2}" -f $SizeGB
$TOTAL = $TOTAL + $SizeGB
Write-Host "$groupname : $FinalSizeGB GB"
}
$FinalTotal = "{0:N2}" -f $TOTAL
Write-Host "TOTAL : $FinalTotal GB"
### EOF
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 with 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
|