PowerShell script exchange
cerede2000
Influencer
Posts: 16 Liked: 1 time
Joined: Sep 09, 2014 2:24 pm
Full Name: Benjamin CEREDE
Contact:
Post
by cerede2000 » Sep 09, 2014 2:27 pm
this post
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.
veremin
Product Manager
Posts: 20413 Liked: 2301 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:
Post
by veremin » Sep 09, 2014 2:33 pm
this post
You mean you're using forward incremental mode and willing to list all increments that are dependent on that full backup? Thanks.
cerede2000
Influencer
Posts: 16 Liked: 1 time
Joined: Sep 09, 2014 2:24 pm
Full Name: Benjamin CEREDE
Contact:
Post
by cerede2000 » Sep 09, 2014 2:41 pm
this post
I make full backup once day by week.
Between full make incremental.
I want get all incremental that go with the full.
veremin
Product Manager
Posts: 20413 Liked: 2301 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:
Post
by veremin » Sep 09, 2014 3:35 pm
this post
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.
cerede2000
Influencer
Posts: 16 Liked: 1 time
Joined: Sep 09, 2014 2:24 pm
Full Name: Benjamin CEREDE
Contact:
Post
by cerede2000 » Sep 09, 2014 3:39 pm
this post
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
veremin
Product Manager
Posts: 20413 Liked: 2301 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:
Post
by veremin » Sep 09, 2014 4:38 pm
this post
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.
cerede2000
Influencer
Posts: 16 Liked: 1 time
Joined: Sep 09, 2014 2:24 pm
Full Name: Benjamin CEREDE
Contact:
Post
by cerede2000 » Sep 10, 2014 7:12 am
this post
Great !!
It's that !
Thank you
veremin
Product Manager
Posts: 20413 Liked: 2301 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:
Post
by veremin » Sep 10, 2014 8:42 am
this post
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.
cerede2000
Influencer
Posts: 16 Liked: 1 time
Joined: Sep 09, 2014 2:24 pm
Full Name: Benjamin CEREDE
Contact:
Post
by cerede2000 » Sep 10, 2014 8:49 am
this post
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}
Users browsing this forum: No registered users and 5 guests