How to get restore point count for a backup job?

PowerShell script exchange

How to get restore point count for a backup job?

Veeam Logoby zuldan » Wed Mar 01, 2017 10:17 am

So I'm trying to work out the Powershell command to get the same restore point figures as what you see in the VBR GUI Console. I can never get the number to match up. Anyone see what I'm doing wrong?

Code: Select all
Get-VBRRestorePoint -Backup 'S12AUMDC01VVC01 - SQL Servers 02' | Group-Object -Property VmName | Select-Object -Property Name,@{Name='RestorePoints';Expression={$PSItem.Count}}


Image
zuldan
Enthusiast
 
Posts: 45
Liked: 5 times
Joined: Wed Feb 15, 2017 9:51 am

Re: How to get restore point count for a backup job?

Veeam Logoby tdewin » Wed Mar 01, 2017 11:02 am

Does it work better if you use get-vbrbackup as a source? For me this gives the exact same result:

Code: Select all
$job = "Backup Job AD"
$vm = "adalone"
$count = $(get-vbrbackup -name $job | Get-VBRRestorePoint -Name $vm | Measure-Object).Count
write-host $count


or with your code

Code: Select all
$job = "Backup Job AD"
get-vbrbackup -name $job | Get-VBRRestorePoint | Group-Object -Property VmName
tdewin
Veeam Software
 
Posts: 1106
Liked: 389 times
Joined: Fri Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin

Re: How to get restore point count for a backup job?

Veeam Logoby zuldan » Wed Mar 01, 2017 11:57 am

No luck with either. Both show 54 restore points per VM instead of 13 like the GUI.

Code: Select all
Count Name                      Group                                                                                               
----- ----                      -----                                                                                               
   54 S12AUMDC01SQL14           {Veeam.Backup.Core.COib, Veeam.Backup.Core.COib, Veeam.Backup.Core.COib, Veeam.Backup.Core.COib...} 
   54 S12AUMDC01SQL11           {Veeam.Backup.Core.COib, Veeam.Backup.Core.COib, Veeam.Backup.Core.COib, Veeam.Backup.Core.COib...} 
   54 S12AUMDC01SQL12           {Veeam.Backup.Core.COib, Veeam.Backup.Core.COib, Veeam.Backup.Core.COib, Veeam.Backup.Core.COib...} 
   54 S12AUMDC01SQL02           {Veeam.Backup.Core.COib, Veeam.Backup.Core.COib, Veeam.Backup.Core.COib, Veeam.Backup.Core.COib...} 
   54 S12AUMDC01SQL13           {Veeam.Backup.Core.COib, Veeam.Backup.Core.COib, Veeam.Backup.Core.COib, Veeam.Backup.Core.COib...}
zuldan
Enthusiast
 
Posts: 45
Liked: 5 times
Joined: Wed Feb 15, 2017 9:51 am

Re: How to get restore point count for a backup job?

Veeam Logoby tdewin » Wed Mar 01, 2017 1:34 pm

Don't experience it in my lab. Maybe, you could try investigating the dates

Code: Select all
Get-VBRRestorePoint -Backup $job | Group-Object -Property VmName | % { $vmg = $_;write-host $vmg.name; $vmg.Group | Sort-Object -Property creationtime -Descending | % { write-host $_.creationtime; };write-host ""}


Takes the properties of the backup, and see what dates are mismatching. If older dates are showing up, maybe you have residue data left.
tdewin
Veeam Software
 
Posts: 1106
Liked: 389 times
Joined: Fri Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin

Re: How to get restore point count for a backup job?

Veeam Logoby v.Eremin » Wed Mar 01, 2017 1:39 pm

Most likely, there are stuck entities inside product db. So, I recommend checking db with support team help. Thanks.
v.Eremin
Veeam Software
 
Posts: 13702
Liked: 1020 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: How to get restore point count for a backup job?

Veeam Logoby zuldan » Thu Mar 02, 2017 4:01 am

Thanks v.Eremin. I'll open up a Veeam case.
zuldan
Enthusiast
 
Posts: 45
Liked: 5 times
Joined: Wed Feb 15, 2017 9:51 am

Re: How to get restore point count for a backup job?

Veeam Logoby zuldan » Thu Mar 02, 2017 5:48 am

v.Eremin, before I open up a new case, I just had a thought. Is it possible this issue is related to case 02082443. Details at veeam-backup-replication-f2/veeam-exagrid-very-worried-t41399.html
zuldan
Enthusiast
 
Posts: 45
Liked: 5 times
Joined: Wed Feb 15, 2017 9:51 am

Re: How to get restore point count for a backup job?

Veeam Logoby Mike Resseler » Thu Mar 02, 2017 5:51 am

Zuldan,

That might be the case indeed. As I just read that other thread, I would wait for the result of that one. I think that one is the most urgent one and needs to be fixed as soon as possible. I can't help you there however. Our engineer will do its best to get this fixed and escalate when necessary.

From the moment that is done, we can come back to this one and see if the issue is still there

Mike
Mike Resseler
Veeam Software
 
Posts: 3381
Liked: 384 times
Joined: Fri Feb 08, 2013 3:08 pm
Location: Belgium, the land of the fries, the beer, the chocolate and the diamonds...
Full Name: Mike Resseler


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 1 guest