Health check in Backup Copy job

PowerShell script exchange

Health check in Backup Copy job

Veeam Logoby odruard » Mon Oct 27, 2014 12:40 pm

Hello,

In graphical interface, there in an option to configure Health checks in a Backup Copy job.
On Target tab, Advanced button, Backup tab, you'll find Backup files Health check options, with the availability to schedule it monthly or weekly.

I don't find how to configure this option through powershell. I found all other options I need, but not this one.

Any idea ?

Thanks for your help.
Olivier
odruard
Enthusiast
 
Posts: 29
Liked: never
Joined: Tue Jan 25, 2011 2:12 pm
Full Name: Olivier Druard

Re: Health check in Backup Copy job

Veeam Logoby v.Eremin » Mon Oct 27, 2014 5:12 pm

Hi Olivier,

I don't have a console at hand, so, can't tell what method you should use. But it stands to reason to assign all job options to a variable, and try to find which particular setting corresponds to the health check. Get-Member commandlet might be helpful in this case.

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

Re: Health check in Backup Copy job

Veeam Logoby edfops » Mon Oct 27, 2014 8:00 pm

I've been looking for this as well, at the moment not sure it exists. The "EnableIntegrityChecks" option does not include the "Health Check" for Backup Copy Jobs.
edfops
Enthusiast
 
Posts: 37
Liked: 6 times
Joined: Thu Feb 13, 2014 8:17 pm

Re: Health check in Backup Copy job

Veeam Logoby v.Eremin » Mon Oct 27, 2014 8:06 pm

Hmmm, ok. I will try to look into that, once I have an access to a backup console. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Health check in Backup Copy job

Veeam Logoby odruard » Tue Oct 28, 2014 9:18 am

v.Eremin wrote:But it stands to reason to assign all job options to a variable, and try to find which particular setting corresponds to the health check. Get-Member commandlet might be helpful in this case.

Hello Eremin

That's what I did before opening this topic, but I didn't find the correct information.
I found all other options using get-member on options. I even checked options which have themselves several members, without success.
Maybe it is not in Options. For Backup jobs, some elements are managed through AdvancedOptions, but I didn't find equivalent for Copy jobs.

Olivier.
odruard
Enthusiast
 
Posts: 29
Liked: never
Joined: Tue Jan 25, 2011 2:12 pm
Full Name: Olivier Druard

Re: Health check in Backup Copy job

Veeam Logoby v.Eremin » Thu Oct 30, 2014 8:06 pm

Can't recall the particular name, but have you checked something like options.root? Some of the peculiar options are located there. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Health check in Backup Copy job

Veeam Logoby odruard » Fri Oct 31, 2014 2:15 pm

v.Eremin wrote:have you checked something like options.root?

I don't know such property name. .options.root return nothing.
I performed a get-member on objet, its member and its sub-member, whithout finding the right information.

Olivier
odruard
Enthusiast
 
Posts: 29
Liked: never
Joined: Tue Jan 25, 2011 2:12 pm
Full Name: Olivier Druard

Re: Health check in Backup Copy job

Veeam Logoby v.Eremin » Fri Oct 31, 2014 2:26 pm

If you assign job options to a variable, say, $options, it will have a number of different options inside like $options.backuptargetoptions and so on. As far as I remember, there should be something like $options.options.root or similar. Some interesting properties might be found there sometimes. I will say for sure, when I'm back from the TechED, though. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Health check in Backup Copy job

Veeam Logoby edfops » Mon Nov 03, 2014 7:36 pm

v.Eremin wrote:If you assign job options to a variable, say, $options, it will have a number of different options inside like $options.backuptargetoptions and so on. As far as I remember, there should be something like $options.options.root or similar. Some interesting properties might be found there sometimes. I will say for sure, when I'm back from the TechED, though. Thanks.


This should do the trick.

Code: Select all
$options = New-VBRJobOptions
$options.GenerationPolicy.EnableRechek   = $false
$job = Get-VBRJob -name "job name"
Set-VBRJobOptions -Job $job -Options $options
edfops
Enthusiast
 
Posts: 37
Liked: 6 times
Joined: Thu Feb 13, 2014 8:17 pm

Re: Health check in Backup Copy job

Veeam Logoby edfops » Mon Nov 03, 2014 7:38 pm

odruard wrote:
v.Eremin wrote:have you checked something like options.root?

I don't know such property name. .options.root return nothing.
I performed a get-member on objet, its member and its sub-member, whithout finding the right information.

Olivier


Let me know if this works for you.

Code: Select all
$options = New-VBRJobOptions
$options.GenerationPolicy.EnableRechek   = $false
$job = Get-VBRJob -name "job name"
Set-VBRJobOptions -Job $job -Options $options
edfops
Enthusiast
 
Posts: 37
Liked: 6 times
Joined: Thu Feb 13, 2014 8:17 pm

Re: Health check in Backup Copy job

Veeam Logoby edfops » Mon Nov 03, 2014 8:33 pm

edfops wrote:Let me know if this works for you.

Code: Select all
$options = New-VBRJobOptions
$options.GenerationPolicy.EnableRechek   = $false
$job = Get-VBRJob -name "job name"
Set-VBRJobOptions -Job $job -Options $options


And this is why we always thoroughly test our scripts. This will work a bit better, as the above will end up setting a job back to default settings, except for the one it changes.

The below sets $options as all of the current settings in the job, and then sets the one option we want. Makes it a bit safer to run against a bunch of jobs!

Code: Select all
$job = Get-VBRJob -name "job"
$options = Get-VBRJobOptions -Job $job
$options.GenerationPolicy.EnableRechek   = $false
Set-VBRJobOptions -Job $job -Options $options
edfops
Enthusiast
 
Posts: 37
Liked: 6 times
Joined: Thu Feb 13, 2014 8:17 pm

Re: Health check in Backup Copy job

Veeam Logoby v.Eremin » Wed Nov 05, 2014 8:53 am

edfops wrote:And this is why we always thoroughly test our scripts. This will work a bit better, as the above will end up setting a job back to default settings, except for the one it changes.

Yes, New-VBRJobOptions creates a template for job options. Thus, the scrips sets all parameters (except the one that is changed within the script) to their default values. The right approach is to get options, assign to a variable, change required parameter(s) and set the changed options.

Anyway, glad to hear that you've nailed it.

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


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 4 guests