PowerShell script exchange
Post Reply
JannQ
Lurker
Posts: 1
Liked: never
Joined: Mar 08, 2021 8:42 pm
Contact:

VBK and ViB Size Report

Post by JannQ »

how do you generate a file size report for the vbk and vib (I need the total average) via poweshell? should I get it from the database?

the goal is to create a daily email report for those or maybe in csv per VM.
HannesK
Product Manager
Posts: 14287
Liked: 2877 times
Joined: Sep 01, 2014 11:46 am
Full Name: Hannes Kasparick
Location: Austria
Contact:

Re: VBK and ViB Size Report

Post by HannesK »

Hello,
and welcome to the forums.

Do you have Veeam ONE? The Backups on repository report might help https://helpcenter.veeam.com/docs/one/r ... ml?ver=110 (probably also other reports)

It's possible via database, but I would probably just parse the filesystem of your repository (depending how your setup looks like).

There are some code examples in this forum. Forum search can help you. For example
post279409.html?hilit=file%20size%20backup#p279409

https://blog.smasterson.com/scripts/veeam/ can also be a starting point

Best regards,
Hannes
oleg.feoktistov
Veeam Software
Posts: 1912
Liked: 635 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: VBK and ViB Size Report

Post by oleg.feoktistov » 1 person likes this post

Hi @JannQ,

Actually, if you want to know backup sizes across all jobs it might be tedious to dive into each's repository file system and report on folder size.
Another, centralised approach might look like this:

Code: Select all

$backups = Get-VBRBackup
[long]$fileSizeTotal = ''
foreach ($backup in $backups) {
    $storages = $backup.GetAllStorages()
    foreach($storage in $storages) {
        $size = $storage.Info.Stats.BackupSize.ToString()
        $fileSizeTotal += [long]$size
    }
} 
For instance, here I just get all backup storages and add their sizes to a sum variable to report to total size of all backups I have.


Thanks,
Oleg
WienerHausberge
Novice
Posts: 6
Liked: 3 times
Joined: Nov 21, 2022 8:41 am
Full Name: WH
Contact:

[MERGED]Backup size via database

Post by WienerHausberge »

Hello everyone,
I am new to Veeam and new to this forum as well.
I am asking myself, if there is a possibility to get the size of every single backup via the VeeamBackup database?

Thank you very much!
Mildur
Product Manager
Posts: 8549
Liked: 2223 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: VBK and ViB Size Report

Post by Mildur »

Hi Tom

Welcome to the forum.
We cannot provide methods to get this data directly from the database.
Please see the answers from my colleagues about our supported options.

Best
Fabian
Product Management Analyst @ Veeam Software
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests