PowerShell script exchange
Post Reply
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Full backup for jobs pointed to per-VM repository

Post by veremin » 2 people like this post

So, you've just upgraded to version 9 and enabled new fancy option called "Use per-VM backup files" in the settings of your repository(s).

This option allows you to store each VM in a separate backup file enhancing backup performance when backing up to deduplicating storage.

However, this option won't take place, unless you run manually active full backup.

The following script is supposed to make your life easier. It finds repositories with corresponding option enabled and ,then, executes an active full backup for the jobs pointed to these repositories.

Code: Select all

asnp VeeamPSSNapin
foreach ($Repository in (Get-VBRBackupRepository | where {$_.Options.OneBackupFilePerVm -eq $True}))
{
    foreach ($Job in (Get-VBRJob | where {$_.JobType -eq "Backup" -or $_.JobType -eq "BackupSync" -and $_.FindTargetRepository().name -eq $Repository.name}))
    {
        if ($Job.JobType -eq "Backup")
        {
            Start-VBRJob -Job $Job -FullBackup
        }
        else
        {
            Sync-VBRBackupCopyJob -Job $Job -FullBackup
        }
    }
}
Hope this helps.
Thanks.
DavoudTeimouri
Enthusiast
Posts: 50
Liked: 6 times
Joined: Nov 27, 2013 7:58 am
Full Name: Davoud Teimouri
Contact:

Re: Full backup for jobs pointed to per-VM repository

Post by DavoudTeimouri »

Many thanks.
It will help us about backup performance.
Best Regards
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Full backup for jobs pointed to per-VM repository

Post by veremin »

You're welcome. Feel free to use it and modify however you like. :)
Post Reply

Who is online

Users browsing this forum: oscarm and 17 guests