-
- Service Provider
- Posts: 56
- Liked: 6 times
- Joined: Apr 30, 2012 2:04 am
- Contact:
Reporting on space consumed by each backup job
I've recently learned how great PowerShell can be (PowerCLI to report on storage and CPU / RAM for a folder) and looking to generate a report or script that can be used to show how much space is consumed by backups, per job
I understand this can't be done at a VM level, that's fine
I had a bit of a play with some partial scripts on here, but just can't see to stitch it together
Basically just after something to run and even just spit out into the PowerShell itself with output such as:
Job Name
Space Used
Anyone able to give me any pointers or show me where to start?
Even better, anyone got such a script they're willing to share?
I understand this can't be done at a VM level, that's fine
I had a bit of a play with some partial scripts on here, but just can't see to stitch it together
Basically just after something to run and even just spit out into the PowerShell itself with output such as:
Job Name
Space Used
Anyone able to give me any pointers or show me where to start?
Even better, anyone got such a script they're willing to share?
-
- Product Manager
- Posts: 20400
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Reporting on space consumed by each backup job
Is a target a Windows-based repository? If so, take a look at this script. Thanks.
-
- VP, Product Management
- Posts: 6035
- Liked: 2860 times
- Joined: Jun 05, 2009 12:57 pm
- Full Name: Tom Sightler
- Contact:
Re: Reporting on space consumed by each backup job
If you have mulitple repositories that are a mix of Windows and Linux, calculating based on scanning the actual directory may be challenging since you have to work out paths, and potentially remote powershell/ssh, etc. I regularly use the following one-liner to get the size of the backup files on disk directly from the Veeam server. It's not quite 100% accurate because it doesn't account for metadata, but it's really close, with the exception of jobs that include periodic SQL log backups as those would need a little more code to grab the child job.
This returns the size of the restore points on disk in bytes, which you can of course round however you wish if you prefer MB/GB/TB.
Code: Select all
((Get-VBRBackup -Name "<Backup_Name>").GetStorages().Stats.BackupSize | Measure-Object -Sum).Sum
-
- Service Provider
- Posts: 56
- Liked: 6 times
- Joined: Apr 30, 2012 2:04 am
- Contact:
Re: Reporting on space consumed by each backup job
This is pretty much exactly what I'm after, thanks!tsightler wrote:If you have mulitple repositories that are a mix of Windows and Linux, calculating based on scanning the actual directory may be challenging since you have to work out paths, and potentially remote powershell/ssh, etc. I regularly use the following one-liner to get the size of the backup files on disk directly from the Veeam server. It's not quite 100% accurate because it doesn't account for metadata, but it's really close, with the exception of jobs that include periodic SQL log backups as those would need a little more code to grab the child job.This returns the size of the restore points on disk in bytes, which you can of course round however you wish if you prefer MB/GB/TB.Code: Select all
((Get-VBRBackup -Name "<Backup_Name>").GetStorages().Stats.BackupSize | Measure-Object -Sum).Sum
Quick question, I'm still a bit of a noob with PowerShell, how would I wrap that into a command or script to execute, looping through each job?
-
- VP, Product Management
- Posts: 6035
- Liked: 2860 times
- Joined: Jun 05, 2009 12:57 pm
- Full Name: Tom Sightler
- Contact:
Re: Reporting on space consumed by each backup job
You could do something like:
Which should give you output something like:
You could even export to a CSV file by simply replacing the Format-Table cmdlet with Export-Csv <path_to_file>.
Code: Select all
Get-VBRBackup | Select @{N="Job Name";E={$_.Name}}, @{N="Size (GB)";E={[math]::Round(($_.GetStorages().Stats.BackupSize | Measure-Object -Sum).Sum/1GB,1)}} | Format-Table -AutoSize
Code: Select all
Job Name Size (GB)
-------- ---------
Job_1 13.3
Job_2 310.9
Job_3 16.5
Job_4 7.7
-
- Lurker
- Posts: 2
- Liked: never
- Joined: Feb 08, 2016 10:45 pm
- Full Name: Chris Widhelm
- Contact:
[MERGED] : PowerShell V8 Command for backup size
I am needing to figure out the "backup size" with as much granularity as possible.
For example, Get-VBRRestorePoint gets me the granularity I want, however, ApproxSize is the Original Size and not the Backup Size.
Thanks
For example, Get-VBRRestorePoint gets me the granularity I want, however, ApproxSize is the Original Size and not the Backup Size.
Thanks
-
- Product Manager
- Posts: 5796
- Liked: 1215 times
- Joined: Jul 15, 2013 11:09 am
- Full Name: Niels Engelen
- Contact:
Re: PowerShell V8 Command for backup size
Did you take a look at http://forums.veeam.com/powershell-f26/ ... aw#p162974
Some other posts about this:
http://forums.veeam.com/powershell-f26/ ... 11797.html
powershell-f26/get-backup-size-of-vm-t22361.html
Some other posts about this:
http://forums.veeam.com/powershell-f26/ ... 11797.html
powershell-f26/get-backup-size-of-vm-t22361.html
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
GitHub: https://github.com/nielsengelen
-
- Product Manager
- Posts: 20400
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Reporting on space consumed by each backup job
Hi, Chris,
Kindly, take a look at the script provided above and see whether it meets your expectations.
Thanks.
Kindly, take a look at the script provided above and see whether it meets your expectations.
Thanks.
-
- Lurker
- Posts: 2
- Liked: never
- Joined: Feb 08, 2016 10:45 pm
- Full Name: Chris Widhelm
- Contact:
Re: Reporting on space consumed by each backup job
I suppose it will have to do. The GetStorages gets me the storage information for the entire restore point. I was hoping to have per VM statistics.
It would be great if there were object documentation in the PowerShell docs so we could see what methods and properties are available in the returned types.
Thanks
It would be great if there were object documentation in the PowerShell docs so we could see what methods and properties are available in the returned types.
Thanks
-
- Product Manager
- Posts: 20400
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Reporting on space consumed by each backup job
Due to deduplication it's not possible to estimate how much space a particular VM consumes inside a backup file. Thanks.
-
- Service Provider
- Posts: 60
- Liked: 3 times
- Joined: Nov 16, 2015 5:52 pm
- Full Name: Bill Boyer
- Contact:
[MERGED] Repository space per job
I need a quick script that will take a backup job and tell me how much repository space is being used. We do billing based on how much "occupancy" each customer is using in the repository. Need like size-on-disk for each VM's points. Tried looping through the GetAllStorages() and looking at the stats.DataSize, but that total doesn't match what's in the /backup directory for that job. The VeeamOne billing report just doesn't cut it for our needs. We just need the total when we run the script. Month end.
TIA,
Bill
TIA,
Bill
-
- Product Manager
- Posts: 20400
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Reporting on space consumed by each backup job
Hi, Bill,
Can you tell me whether this one-liner meets your expectations?
Thanks.
Can you tell me whether this one-liner meets your expectations?
Code: Select all
Get-VBRBackup | Select @{N="Job Name";E={$_.Name}}, @{N="Size (GB)";E={[math]::Round(($_.GetAllStorages().Stats.BackupSize | Measure-Object -Sum).Sum/1GB,1)}} | Format-Table -AutoSiz
-
- Influencer
- Posts: 13
- Liked: 3 times
- Joined: May 05, 2016 6:17 am
- Full Name: Fletcher Cocquyt
- Contact:
Re: Reporting on space consumed by each backup job
Get-VBRBackup | Select @{N="Job Name";E={$_.Name}}, @{N="Size (GB)";E={[math]::Round(($_.GetAllStorages().Stats.BackupSize | Measure-Object -Sum).Sum/1GB,1)}} | Format-Table -AutoSize
works, but gives duplicate records for some jobs - eg
SIM 1304.8
SIM 1446.5
By comparing the actual du output space taken on the backup destination it looks like the correct space is the MAX of duplicate records
We have migrated jobs from old to new vcenters and it looks like the Veeam DB keeps the old records, resulting in the duplicates.
So in the case of the SIM job 1446.5 is the actual current value for space used by this job
thanks
works, but gives duplicate records for some jobs - eg
SIM 1304.8
SIM 1446.5
By comparing the actual du output space taken on the backup destination it looks like the correct space is the MAX of duplicate records
We have migrated jobs from old to new vcenters and it looks like the Veeam DB keeps the old records, resulting in the duplicates.
So in the case of the SIM job 1446.5 is the actual current value for space used by this job
thanks
-
- Product Manager
- Posts: 20400
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Reporting on space consumed by each backup job
It seems that there are duplicated entities in configuration db, as the result scripts shows backups with the same name twice. You might reach our support team and let them correct the database. Thanks!
Who is online
Users browsing this forum: Asahi, Google [Bot] and 17 guests