-
- Enthusiast
- Posts: 30
- Liked: 2 times
- Joined: Apr 07, 2020 6:23 pm
- Full Name: Markus Pfohl
- Contact:
Get size of all tape backups
Hello all,
for billing reasons I'd like to get the size of all tape sessions from specified jobs.
In the B&R GUI I can see the properties of "<job> on Tape" that lists all current tape Backups of a job ... cumulating the "Backup Size" of that output would be perfect.
Is there a way to script that?
Thanks
Markus
for billing reasons I'd like to get the size of all tape sessions from specified jobs.
In the B&R GUI I can see the properties of "<job> on Tape" that lists all current tape Backups of a job ... cumulating the "Backup Size" of that output would be perfect.
Is there a way to script that?
Thanks
Markus
-
- Veeam Software
- Posts: 1918
- Liked: 636 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Get size of all tape backups
Hi Markus,
Sure there is. Here is an example:
Cheers,
Oleg
Sure there is. Here is an example:
Code: Select all
# This script shows total size of backup files in GB for each tape backup.
$jobType = [Veeam.Backup.Model.EDbJobType]::VmTapeBackup
$backups = [Veeam.Backup.Core.CBackup]::FindByJobType($true, $JobType)
foreach ($backup in $backups) {
[int]$totalSize = ""
$storages = $backup.GetAllStorages()
foreach ($storage in $storages) {
$backupSize = $storage.Stats.BackupSize/1GB
$backupSize = [Convert]::ToInt32($backupSize)
$totalSize += $backupSize
}
$restorepoints = Get-VBRRestorePoint -Backup $backup
$backup | select-object Name, @{n='RPCount';e={$restorepoints.Count}}, @{n='BackupSizeTotal, GB';e={$totalSize}}
}
Oleg
-
- Enthusiast
- Posts: 30
- Liked: 2 times
- Joined: Apr 07, 2020 6:23 pm
- Full Name: Markus Pfohl
- Contact:
Re: Get size of all tape backups
Hey Oleg,
that is one neat script, works great!
I just added "| Export-Csv d:\temp\tapesizes.csv -Append" in line 10 ... for better postprocessing.
Much appreciated
Thanks
Markus
that is one neat script, works great!
I just added "| Export-Csv d:\temp\tapesizes.csv -Append" in line 10 ... for better postprocessing.
Much appreciated
Thanks
Markus
-
- Veeam Software
- Posts: 1918
- Liked: 636 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Get size of all tape backups
Hi Markus,
Sure thing, glad it helped! You might also want to slightly change the output format for backup size to avoid overly rounded values.
Best regards,
Oleg
Sure thing, glad it helped! You might also want to slightly change the output format for backup size to avoid overly rounded values.
Best regards,
Oleg
-
- Veeam Legend
- Posts: 235
- Liked: 134 times
- Joined: Mar 28, 2019 2:01 pm
- Full Name: SP
- Contact:
Re: Get size of all tape backups
Very Handy. Thanks
Who is online
Users browsing this forum: No registered users and 16 guests