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

VBR backup job estimated size

Post by matteu »

Hello,

I would like to know what is the good command to go to calculate the estimated backup copy job size (the second screen when we create a job) because what I find doesn't work everytime.

I use

Code: Select all

$VmwareBkpJobs = Get-VBRJob | Where-Object {$_.TypeToString -eq "VMware Backup"}
foreach ($element in $VmwareBkpJobs)
{
    $element.name
    $element.info.IncludedSize / 1GB -as [INT]
}
I know it's working for 15TB job but it's not for 25TB.
I suppose I need to use an other way ?

Then, how is it possible to have this information for backup to tape job pls ?

Thanks
matteu
Veeam Legend
Posts: 823
Liked: 128 times
Joined: May 11, 2018 8:42 am
Contact:

Re: VBR backup job estimated size

Post by matteu »

Just to add it's not working for backup, backup copy, replication
david.domask
Veeam Software
Posts: 2123
Liked: 513 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: VBR backup job estimated size

Post by david.domask »

Hey @matteu,

This is a more complex question than it seems ;)

In "most" cases, you can get away with passing the CBackupJob object returned from Get-VBRJob to Get-VBRJobObject

This will give you output like:

Code: Select all

PS C:\Users\Administrator> $job |Get-VBRJobObject

Name                      Type       ApproxSize       Location
----                      ----       ----------       --------
DDom-TinyVM_migrated      Include    0 B             somevcenter...
somevcenter.lo... Include    9.6 TB           somevcenter...
And you can sum up ApproxSize value.

Note that you need to consider if you want to count the excluded objects also (they will have Type -eq Exclude), but that's a decision best left for you :)

Backup Copies are unique though in that you can also add objects by LinkedJob property, so you need to do some logic to check if there are linked jobs (Linked Backups work alright and add infrastructure objects so no need for special handling):

Code: Select all

$job = Get-VBRjob -name 'somebackupcopy'

if($job.LinkedJobs){
     $linkedjobobjects = (Get-VBRJob | Where-Object {$_.id -eq $job.LinkedJobs.LinkedJobID}) | Get-VBRJobObject
}
You'll initialize some array and add the $linkedjobobjects to the array and then you can sum it along with the items returned by Get-VBRJobObject.
David Domask | Product Management: Principal Analyst
matteu
Veeam Legend
Posts: 823
Liked: 128 times
Joined: May 11, 2018 8:42 am
Contact:

Re: VBR backup job estimated size

Post by matteu »

Thank you for your answer.

I will try if I get the information for tape with the same logical than backup copy :)
Post Reply

Who is online

Users browsing this forum: Amazon [Bot] and 5 guests