Bandwidth guesstimation for remote copy (existing backups)

PowerShell script exchange

Bandwidth guesstimation for remote copy (existing backups)

Veeam Logoby tdewin » Fri May 15, 2015 12:20 pm 1 person likes this post

Wrote this quickly, nothing to fancy. It just takes the latest increments of every Backup, adds the increments, then divides by a copy window of 8 hours. Should give you a crude number of bandwidth requirements without WAN acceleration in Mbit/s. It uses the compressed backup size.

If some people could verify, that would be great cause it is written fairly quickly.

Enjoy!

Code: Select all
 asnp veeampssnapin

 # 8*60min*60sec
 $copywindow = 8*3600
 $backups = @()
 get-vbrbackup | ?  { $_.JobType -match "^Backup$" } | % {
    $storages = $_.getStorages()
    $incs = @($storages | ? { -not $_.isFull } | Sort-Object -Property CreationTime -Descending)
    if ($incs.Count -gt 0) {
        $inc = $incs[0]
        $backups += New-Object  PSObject -Property @{name=$_.JobName;file=$inc.filepath;backupsize=$inc.Stats.BackupSize}
    }
    else
    {
        write-host ("No inc for {0}" -f $_.JobName )
    }

 }

$backups
$total = $backups | Measure-Object -Property backupsize -Sum
$bytes = $total.Sum
$bytespersec = $bytes/$copywindow
$mbitpersec = $bytespersec*8/1MB
Write-host ("Guesstimating {0} Mbit/s" -f $mbitpersec)


Should give you something like the following. It will also tell you if you don't have incs. Watch out, in this case, nothing is counted!!!
Code: Select all
No inc for Windows Environment
No inc for Backup Job 8

                                                    backupsize name                                                           file                                                         
                                                    ---------- ----                                                           ----                                                         
                                                    2144796672 Backup Job Dima                                                V:\Backup\Backup Job Dima\Backup Job Dima2015-05-14T220129...
                                                     294258688 Backup Job Windows                                             V:\Backup\Backup Job Windows\Backup Job Windows2015-05-14T...
                                                      31649792 Backup Job check indepent                                      V:\Backup\Backup Job check indepent\Backup Job check indep...
                                                   12893234688 Backup Job CBT                                                 V:\Backup\Backup Job CBT\Backup Job CBT2015-05-12T184651.vib
                                                      37475328 Backup Job Linux                                               V:\Backup\Backup Job Linux\Backup Job Linux2015-05-14T2201...
Guesstimating 4,07998168945312 Mbit/s

tdewin
Veeam Software
 
Posts: 1046
Liked: 361 times
Joined: Fri Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin

Return to PowerShell



Who is online

Users browsing this forum: No registered users and 7 guests