Get increment attached to full backup

PowerShell script exchange

Get increment attached to full backup

Veeam Logoby cerede2000 » Tue Sep 09, 2014 2:27 pm

Hello,

I find the last full backup of job with :
Code: Select all
Get-VBRBackup -Name '<Job Name>' | Get-VBRRestorePoint | ?{$_.Type -eq 'Full'} | Sort-Object -Descending CreationTime | Select-Object -First 1


And now I want list all increment wich attached at this full backup.

Please help me.

Thanks.
cerede2000
Influencer
 
Posts: 16
Liked: 1 time
Joined: Tue Sep 09, 2014 2:24 pm
Full Name: Benjamin CEREDE

Re: Get increment attached to full backup

Veeam Logoby v.Eremin » Tue Sep 09, 2014 2:33 pm

You mean you're using forward incremental mode and willing to list all increments that are dependent on that full backup? Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get increment attached to full backup

Veeam Logoby cerede2000 » Tue Sep 09, 2014 2:41 pm

I make full backup once day by week.
Between full make incremental.

I want get all incremental that go with the full.
cerede2000
Influencer
 
Posts: 16
Liked: 1 time
Joined: Tue Sep 09, 2014 2:24 pm
Full Name: Benjamin CEREDE

Re: Get increment attached to full backup

Veeam Logoby v.Eremin » Tue Sep 09, 2014 3:35 pm

Then, the following script should be helpful:

Code: Select all
$LastFull = Get-VBRBackup -Name "Name of your Job" | Get-VBRRestorePoint | where {$_.type -eq "Full"} | Sort creationtime -Descending | Select -First 1
Get-VBRBackup -Name "Name of your Job" | Get-VBRRestorePoint | where {$_.Creationtime -ge $LastFull.CreationTime} | Sort creationtime


The script will list the latest full backup along with the latest increments dependent on it.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get increment attached to full backup

Veeam Logoby cerede2000 » Tue Sep 09, 2014 3:39 pm

Thanks :)

I saw that there was ParentID.
The increments have it in the full Id ParentID ?

Edit : Because when I get backup chain (full+increment linked) between two full it's not work :(
cerede2000
Influencer
 
Posts: 16
Liked: 1 time
Joined: Tue Sep 09, 2014 2:24 pm
Full Name: Benjamin CEREDE

Re: Get increment attached to full backup

Veeam Logoby v.Eremin » Tue Sep 09, 2014 4:38 pm

I got confused, since you were talking about the last full backup.

Anyway, you can try the following script and see whether it makes any difference. You will have to first assign $N variable that identifies the number of full, starting for the latest one. Be aware that it stats counting from 0, meaning 0 is the latest backup.

Code: Select all
$N = "Number of full"
$Fulls = Get-VBRBackup -Name "Name of your Job" | Get-VBRRestorePoint | where {$_.type -eq "Full"} | Sort creationtime -Descending
$DependentRP = Get-VBRBackup -Name "Name of your Job" | Get-VBRRestorePoint | where {($_.Creationtime -ge $Fulls[$N].CreationTime) -and ($_.getfull().id -eq $Fulls[$N].id)}
$DependentRP | sort creationtime -Descending | select name, type, creationtime


Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get increment attached to full backup

Veeam Logoby cerede2000 » Wed Sep 10, 2014 7:12 am

Great !!

It's that !

Thank you :)
cerede2000
Influencer
 
Posts: 16
Liked: 1 time
Joined: Tue Sep 09, 2014 2:24 pm
Full Name: Benjamin CEREDE

Re: Get increment attached to full backup

Veeam Logoby v.Eremin » Wed Sep 10, 2014 8:42 am

I've just noticed that the third line is unnecessary, so, current version has four lines, instead of five. Anyway, glad to hear that my input was helpful.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get increment attached to full backup

Veeam Logoby cerede2000 » Wed Sep 10, 2014 8:49 am

Yes i use :
Code: Select all
# Get all fulls
$fulls=Get-VBRBackup -Name 'S3_VCENTER' | Get-VBRRestorePoint | ?{$_.Type -eq 'Full'} | Sort-Object -Descending CreationTime
$increments=Get-VBRBackup -Name 'S3_VCENTER' | Get-VBRRestorePoint | ?{$_.Type -eq 'Increment' -and $_.getFull().Id -eq $full[x].Id}
cerede2000
Influencer
 
Posts: 16
Liked: 1 time
Joined: Tue Sep 09, 2014 2:24 pm
Full Name: Benjamin CEREDE


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 4 guests