PowerShell script exchange
Post Reply
hjh@anycloud.dk
Lurker
Posts: 2
Liked: never
Joined: Feb 27, 2019 7:47 am
Contact:

Issue with custom script after setting up Copy Immediate job

Post by hjh@anycloud.dk »

Hi

We have a couple of custom scripts running to help us safe time and make sure we do not miss issues.
One of the scripts checks though our v-center at list all the vms. Then it checks if the vms in our v-center have a restorepoint in both a normal backup job and a copy job.

The issue is that after upgrading to v10 we have slowly started to change our copy jobs to use the immediate setting.The issue is that the way the new jobs work we cannot pull restorepoint info the same way.
This is how we used to get the restorepoints:

Get-VBRBackup | Where TypeToString -eq "Vmware Backup Copy" | Get-VBRRestorePoint | select name

I have found a way to get the restorepoints from the new job. issue is that i need a automated way to do it.
So if i want to pull the restorepoints the command is:

Get-VBRRestorePoint -Backup "NameOfCopyJobName\NameOfBackupJob"

I could create the naming so that copy and backup jobs are the same, but this is not something that will give a good end result.
So the best i can think is to somehow pull the NameOfBackupJob from the copy job somehow, so that i can use the name in the restorepoint get command.
Hope that someone knows how or know a other way to pull the data.
oleg.feoktistov
Veeam Software
Posts: 1901
Liked: 634 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Issue with custom script after setting up Copy Immediate job

Post by oleg.feoktistov »

Hi and Welcome to the Community Forums!

Due to the Backup Copy immediate mode specifics, powershell returns objects with two job types for such jobs - SimpleBackupCopyPolicy and SimpleBackupCopyWorker.
Objects with SimpleBackupCopyPolicy job type contain general information about the job/session or backup cached for the last 24 hours.
Objects with SimpleBackupCopyWorker job type are child ones and contain information for each job run.
That being said, you need to get restore points for backups with SimpleBackupCopyWorker job type to make it work:

Code: Select all

$backup = Get-VBRBackup | where {$_.JobType -eq 'SimpleBackupCopyWorker'}
Or

Code: Select all

$backup = Get-VBRBackup | where {$_.TypeToString -eq 'Backup Copy'}
Thanks,
Oleg
hjh@anycloud.dk
Lurker
Posts: 2
Liked: never
Joined: Feb 27, 2019 7:47 am
Contact:

Re: Issue with custom script after setting up Copy Immediate job

Post by hjh@anycloud.dk »

Hi Oleg

Thanks that was just what i was looking for!
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests