Full backup for jobs pointed to per-VM repository

PowerShell script exchange

Full backup for jobs pointed to per-VM repository

Veeam Logoby v.Eremin » Fri Jan 29, 2016 1:41 pm 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.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

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

Veeam Logoby DavoudTeimouri » Fri Mar 18, 2016 12:39 pm

Many thanks.
It will help us about backup performance.
Best Regards
DavoudTeimouri
Influencer
 
Posts: 24
Liked: 3 times
Joined: Wed Nov 27, 2013 7:58 am
Full Name: Davoud Teimouri

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

Veeam Logoby v.Eremin » Fri Apr 01, 2016 3:30 pm

You're welcome. Feel free to use it and modify however you like. :)
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 6 guests