PowerShell script exchange
Post Reply
matteu
Veeam Legend
Posts: 818
Liked: 127 times
Joined: May 11, 2018 8:42 am
Contact:

Get-VBRBackupCopyJob backup copy size

Post by matteu »

Hello,

How is it possible to get backup copy size like it was with the Get-VBRBackupCopyJob cmdlet ?
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 669 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Get-VBRBackupCopyJob backup copy size

Post by oleg.feoktistov »

matteu,

If you are after determining the actual size of a backup made with backup copy job, you do that the same way you would with a primary backup. Meaning, gathering the sizes of each storage and summing them all:

Code: Select all

$job = Get-VBRBackupCopyJob -Name 'Backup Copy Job 1'
$backup = Get-VBRBackup | where {$_.JobId -eq $job.Id}
$storages = $backup.GetAllChildrenStorages()
$totalSize = $null
foreach ($storage in $storages) {
  $totalSize += $storage.Stats.BackupSize
}

$totalRounded = [Math]::Round($totalSize/1GB, 2)
$backup | select Name, @{n='Size';e={$totalRounded}}
Best regards,
Oleg
matteu
Veeam Legend
Posts: 818
Liked: 127 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Get-VBRBackupCopyJob backup copy size

Post by matteu »

Thanks for your answer.

Before this new cmdlet, I did this :

(Get-VBRJob -Name "xxxx").Info.Includedsize / 1GB -as [INT]

Now, the only way is what you mentionned ?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest