Duplicate restore points?

PowerShell script exchange

Duplicate restore points?

Veeam Logoby efd121 » Wed Dec 30, 2015 8:42 pm

The script below is my starting point to collect the RPO window for each of my VM's.

My plan is to look at the last 2 restore points and report the time difference between them but I'm running into an issue where my script is reporting duplicate restore points.

I enabled encryption for my backup jobs on the 18th so I'm suspecting its not a coincidence that is when the duplicate restore points start occurring.

As expected a new backup chain was created after encryption was enabled. Should I manually delete the old backup files once I reach the 14 restore points with encryption or is there a better way to re-sync them?

Script
Code: Select all
Add-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue

#$Jobs = Get-VBRJob | Sort-Object Name | ?{$_.JobType -eq "Backup"}
$Jobs = Get-VBRJob -Name "OperationsJob02"
foreach ($Job in $Jobs)
{
$JobObjects = Get-VBRJobObject -Job $Job
foreach ($VM in $JobObjects.Name)
{
$RestorePoints = Get-VBRRestorePoint -Name $VM | Sort-Object -Property CreationTime -Descending
Write-Host "Job="$Job.Name, "VM="$VM, "has", $RestorePoints.Count "restore points"
foreach ($RP in $RestorePoints)
{
Write-Host "Creation Data" $RP.CreationTime
}
}
}

Partial Output from script
Code: Select all
Job= OperationsJob02 VM= fwdws03 has 37 restore points
Creation Data 12/29/2015 6:04:16 PM
Creation Data 12/29/2015 6:04:16 PM
Creation Data 12/28/2015 6:03:30 PM
Creation Data 12/28/2015 6:03:30 PM
Creation Data 12/27/2015 6:03:41 PM
Creation Data 12/27/2015 6:03:41 PM
Creation Data 12/26/2015 6:03:33 PM
Creation Data 12/26/2015 6:03:33 PM
Creation Data 12/25/2015 6:03:19 PM
Creation Data 12/25/2015 6:03:19 PM
Creation Data 12/24/2015 6:03:39 PM
Creation Data 12/24/2015 6:03:39 PM
Creation Data 12/23/2015 6:03:30 PM
Creation Data 12/23/2015 6:03:30 PM
Creation Data 12/22/2015 6:03:23 PM
Creation Data 12/22/2015 6:03:23 PM
Creation Data 12/21/2015 6:03:23 PM
Creation Data 12/21/2015 6:03:23 PM
Creation Data 12/20/2015 6:03:42 PM
Creation Data 12/20/2015 6:03:42 PM
Creation Data 12/19/2015 6:03:30 PM
Creation Data 12/19/2015 6:03:30 PM
Creation Data 12/18/2015 6:03:32 PM
Creation Data 12/17/2015 6:03:33 PM
Creation Data 12/16/2015 6:03:41 PM
Creation Data 12/15/2015 6:03:44 PM
Creation Data 12/14/2015 6:03:31 PM
Creation Data 12/13/2015 6:03:37 PM
Creation Data 12/12/2015 6:03:24 PM
Creation Data 12/11/2015 6:03:46 PM
Creation Data 12/10/2015 6:04:42 PM
Creation Data 12/9/2015 6:03:59 PM
Creation Data 12/8/2015 6:06:43 PM
Creation Data 12/7/2015 6:06:24 PM
Creation Data 12/6/2015 6:08:48 PM
Creation Data 12/5/2015 6:03:18 PM
Creation Data 12/4/2015 6:05:55 PM
efd121
Enthusiast
 
Posts: 25
Liked: never
Joined: Fri Aug 07, 2015 8:45 pm
Full Name: David Engler

Re: Duplicate restore points?

Veeam Logoby PTide » Mon Jan 04, 2016 1:38 pm

Hi,

Do you see duplicate restore points in VBR console as well?

Thank you.
PTide
Veeam Software
 
Posts: 3019
Liked: 246 times
Joined: Tue May 19, 2015 1:46 pm

Re: Duplicate restore points?

Veeam Logoby efd121 » Mon Jan 04, 2016 2:39 pm

I do not see them in the console. The console is showing 14 restore points but the script continues to show 28.
Dave
efd121
Enthusiast
 
Posts: 25
Liked: never
Joined: Fri Aug 07, 2015 8:45 pm
Full Name: David Engler

Re: Duplicate restore points?

Veeam Logoby efd121 » Tue Jan 05, 2016 2:31 am

I think what I'm seeing is the restore points from both the Backup and Backup Copy jobs.

Assuming that is the case how can I tell which restore points are from the Backup Job and which are from the Backup Copy Job?

If I can determine which ones are from the Backup job I should be able to compare the most recent ones.

I looked through object returned from Get-VBRRestorePoint but I don't see anything that ties them to a specific repository.

Can anyone point me in the right direction?
Dave
efd121
Enthusiast
 
Posts: 25
Liked: never
Joined: Fri Aug 07, 2015 8:45 pm
Full Name: David Engler

Re: Duplicate restore points?

Veeam Logoby tdewin » Wed Jan 06, 2016 9:47 am

You can actually find the info via some of the members. Maybe chaining the queries might not be the cleanest way to script it but just for your info ;)
Repository:
Code: Select all
#name
$rp.GetRepository().Name
#server it is hosted on
$rp.GetRepository().GetHost().Name


Path:
Code: Select all
$rp.GetStorage().filepath


You can discover these fields by adding | gm after your object, this gives you all the possible methods and properties
Code: Select all
$rp | gm
tdewin
Veeam Software
 
Posts: 1043
Liked: 361 times
Joined: Fri Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin

Re: Duplicate restore points?

Veeam Logoby tdewin » Wed Jan 06, 2016 10:54 am

Forgot to add, the job itself
Code: Select all
$rp.GetSourceJob().Name
tdewin
Veeam Software
 
Posts: 1043
Liked: 361 times
Joined: Fri Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin

Re: Duplicate restore points?

Veeam Logoby efd121 » Thu Jan 07, 2016 1:23 am

Thanks for all the replies, this should get me the information I'm looking for.
efd121
Enthusiast
 
Posts: 25
Liked: never
Joined: Fri Aug 07, 2015 8:45 pm
Full Name: David Engler


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 4 guests