Hi,
I'm not very good with PowerShell so apologies in advance.
I'm trying to get a script to show the job name, description, # objects and the total backup size. This is just for VBR not cloud connect as I found cloud connect a lot easier to extract this information.
I need the description field as that contains some values we will use for billing.
I can get the 1st 3 items from get-vbrjob but cannot for the life of me work out how to then get the backup size added.
$job = Get-VBRJob
foreach($job in Get-VBRJob) { Write-Host "Client:", $job.Description, $job.Name; $job.GetObjectsInJob() | foreach { $_.Location } }
Any help for an old man is greatly appreciated.
Mark
-
- Veeam Legend
- Posts: 198
- Liked: 55 times
- Joined: Mar 22, 2017 11:10 am
- Full Name: Mark Boothman
- Location: Darlington, United Kingdom
- Contact:
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Script to show description along with # objects and backup size
Hi Mark,
To get backup size you would need to obtain backups for each job and then query backup storages (files), which are residing on a repo. That's where backup size and other stats are kept. Here is the entire script I used:
Best regards,
Oleg
To get backup size you would need to obtain backups for each job and then query backup storages (files), which are residing on a repo. That's where backup size and other stats are kept. Here is the entire script I used:
Code: Select all
$jobs = Get-VBRJob
foreach ($job in $jobs) {
$objects = Get-VBRJobObject -Job $job
$backup = Get-VBRBackup -Name $($job.Name)
$storages = $backup.GetAllChildrenStorages()
$totalSize = 0
foreach ($storage in $storages) {
$totalSize += [Math]::Round($storage.Stats.BackupSize/1Gb, 1)
}
$job | select Name, Description, @{n='Objects';e={$objects.Name}}, @{n='BackupSize';e={$totalSize}} | fl
}
Oleg
-
- Veeam Legend
- Posts: 198
- Liked: 55 times
- Joined: Mar 22, 2017 11:10 am
- Full Name: Mark Boothman
- Location: Darlington, United Kingdom
- Contact:
Re: Script to show description along with # objects and backup size
Thank you Oleg that's perfect
Many Thanks
Mark
Many Thanks
Mark
Who is online
Users browsing this forum: No registered users and 5 guests