PowerShell script exchange
Post Reply
RubinCompServ
Service Provider
Posts: 326
Liked: 78 times
Joined: Mar 16, 2015 4:00 pm
Full Name: David Rubin
Contact:

Enable Automatic Backup Integrity Checks ?

Post by RubinCompServ »

It appears that the "EnableIntegrityChecks" configured by PowerShell no longer has any bearing on the job. I have used PS to set EnableIntegrityChecks to $False, verified via PS that it is actually disabled, and found that the GUI still shows "Storage-level corruption guard" (which I assume is the fancy name for the Integrity Check) to be enabled.
veremin
Product Manager
Posts: 20413
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Enable Automatic Backup Integrity Checks ?

Post by veremin »

Can you provide a script that you use, so that, we can check what might be wrong with it? Thanks.
RubinCompServ
Service Provider
Posts: 326
Liked: 78 times
Joined: Mar 16, 2015 4:00 pm
Full Name: David Rubin
Contact:

Re: Enable Automatic Backup Integrity Checks ?

Post by RubinCompServ »

Code: Select all

Set-VBRJobAdvancedOptions -Job "Interra_Application Servers - monthly" -EnableIntegrityChecks $False
Output:

Code: Select all

FreeBackupImpl               : 
IsFree                       : False
UserCryptoKey                : Veeam.Backup.Core.CCryptoKey
Id                           : d1521c73-578f-42b8-a1d9-4b2a564adf5f
Info                         : Veeam.Backup.Model.CDbBackupJobInfo
JobType                      : Backup
SourceType                   : VDDK
JobTargetType                : Backup
TargetType                   : Other
TypeToString                 : vCloud Backup
Description                  : 
Name                         : Interra_Application Servers - monthly
BackupPlatform               : EVcd
TargetHostId                 : b0865a3b-b90a-4491-85ff-ad868f2a80ff
TargetDir                    : /mnt/Backups/Interra/backups
TargetFile                   : Interra_Application Servers - monthly
Options                      : Veeam.Backup.Model.CJobOptions
IsContinuous                 : False
NameWithDescription          : Interra_Application Servers - monthly ()
SqlEnabled                   : False
OracleEnabled                : False
ParentJobId                  : 
HvReplicaTargetOptions       : Veeam.Backup.Model.CDomHvReplicaTargetOptions
BackupStorageOptions         : Veeam.Backup.Model.CDomBackupStorageOptions
BackupTargetOptions          : Veeam.Backup.Model.CDomBackupTargetOptions
HvSourceOptions              : Veeam.Backup.Model.CDomHvSourceOptions
NotificationOptions          : Veeam.Backup.Model.CDomNotificationOptions
JobScriptCommand             : Veeam.Backup.Model.CDomJobScriptCommand
ViReplicaTargetOptions       : Veeam.Backup.Model.CDomViReplicaTargetOptions
CloudReplicaTargetOptions    : Veeam.Backup.Model.CDomCloudReplicaTargetOptions
ViSourceOptions              : Veeam.Backup.Model.CDomViSourceOptions
VssOptions                   : VssSnapshotOptions: [Enabled: [False], IgnoreErrors: [False], IsCopyOnly: [False]], WinGuestFSIndexingOptions: [Type: [None]], LinGuestFSIndexingOptions: [Type: [None]], SqlBackupOptions: [TransactionLogsProcessing: 
                               [TruncateOnlyOnSuccessJob], BackupLogsFrequencyMin: [15], UseDbBackupRetention: [True], RetainDays: [15], ProxyAutoSelect: [True]], ExchangeBackupOptions: [TransactionLogsProcessing: [TruncateOnlyOnSuccessJob]], WinCredsId: 
                               [00000000-0000-0000-0000-000000000000], LinCredsId: [00000000-0000-0000-0000-000000000000], Old Properties: [Enabled: [False], IgnoreErrors: [False], GuestFSIndexingType: [None], IncludedIndexingFolders: [], 
                               ExcludedIndexingFolders: [], LinGuestFSIndexingType: [None], LinIncludedIndexingFolders: [], LinExcludedIndexingFolders: [], IsFirstUsage: [True]]
ScheduleOptions              : Start time: [10/31/2017 5:55:00 PM], Latest run time: [9/30/2017 5:55:19 PM], Timeout for backup completion: [180min], Next run time: [10/31/2017 17:55:00], Retry times on failure: [3], Retry timeout: [10 min], Monthly 
                               options: [Enabled: True, Time: 9/28/2017 5:55:00 PM, Day Number In Month: OnDay, Day Of Month: Last, Months: January, February, March, April, May, June, July, August, September, October, November, December]
IsRunning                    : False
IsRequireRetry               : False
IsIdle                       : False
IsScheduleEnabled            : True
SourceProxyAutoDetect        : True
IsInitialReplica             : False
IsMappingReplica             : False
IsBackup                     : True
IsBackupSync                 : False
IsSnapshotReplica            : False
IsLegacyReplica              : False
IsReplica                    : False
IsVmCopy                     : False
IsTapeBackup                 : False
IsFileTapeBackup             : False
IsVmTapeBackup               : False
SourceWanAcceleratorName     : 
TargetWanAcceleratorName     : 
LinkedJobs                   : {}
LinkedJobIds                 : {}
LinkedRepositories           : {}
LinkedRepositoryIds          : {}
IsForeverIncremental         : False
IsBackupJob                  : True
IsEndpointJob                : False
SheduleEnabledTime           : 
AutoScheduleOptions          : Veeam.Backup.Model.CAutoScheduleOptions
PreviousJobIdInScheduleChain : 
A code snippet from a different script

Code: Select all

# Detect if Integrity Checks are enabled
           if ($Options.Options.RootNode.EnableIntegrityChecks -eq "True") {
              $integrity = "Enabled"
           } else { $integrity = "Disabled" }
...
$Details.EnableIntegrityChecks = $integrity
shows that the script worked properly and Integrity checks are disabled

Code: Select all

EnableIntegrityChecks : Disabled
However the GUI still shows a check in the box for the "Perform backup files health check" option.
veremin
Product Manager
Posts: 20413
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Enable Automatic Backup Integrity Checks ?

Post by veremin »

Try the following example instead:

Code: Select all

asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Name of your backup job"
$Options = $Job.GetOptions()
$Options.generationpolicy.enablerechek = $false
Set-VBRJobOptions -Job $Job -Options $Options
Thanks.
RubinCompServ
Service Provider
Posts: 326
Liked: 78 times
Joined: Mar 16, 2015 4:00 pm
Full Name: David Rubin
Contact:

Re: Enable Automatic Backup Integrity Checks ?

Post by RubinCompServ »

That worked. So does that mean that the PS cmdlet is altering the wrong property?
veremin
Product Manager
Posts: 20413
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Enable Automatic Backup Integrity Checks ?

Post by veremin »

If you query job options, you will still see there integrity check property (which the given cmdlet tries to alter). However, storage level corruption guard is represented by different entity and thus has to be modified differently - the way I've demonstrated. Thanks.
RubinCompServ
Service Provider
Posts: 326
Liked: 78 times
Joined: Mar 16, 2015 4:00 pm
Full Name: David Rubin
Contact:

Re: Enable Automatic Backup Integrity Checks ?

Post by RubinCompServ »

Is the integrity check property available in the GUI somewhere?
veremin
Product Manager
Posts: 20413
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Enable Automatic Backup Integrity Checks ?

Post by veremin »

It's been replaced by periodic health check options. As you can see there are several tiny differences between integrity check option and heath check ones, internally those settings are represented by two separate properties and thus have to be modified differently. Thanks.
RubinCompServ
Service Provider
Posts: 326
Liked: 78 times
Joined: Mar 16, 2015 4:00 pm
Full Name: David Rubin
Contact:

Re: Enable Automatic Backup Integrity Checks ?

Post by RubinCompServ »

Since Integrity Check has been removed from the GUI, are there any plans to remove it from PowerShell as well, perhaps to eliminate the confusion that started this thread?
veremin
Product Manager
Posts: 20413
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Enable Automatic Backup Integrity Checks ?

Post by veremin »

This property is still present inside configuration db which makes it rather hard to remove only from PowerShell, but well keep our eyes on this issue. Thanks.
cristiano.cumer
Enthusiast
Posts: 34
Liked: 9 times
Joined: Nov 23, 2011 11:18 pm
Full Name: Cristianno Cumer
Contact:

[PowerShell] Integrity check scheduling

Post by cristiano.cumer »

Hello,

I'm not able to find a way to set integrity checks week and day schedule via Powershell. Is this possible?
cristiano.cumer
Enthusiast
Posts: 34
Liked: 9 times
Joined: Nov 23, 2011 11:18 pm
Full Name: Cristianno Cumer
Contact:

Re: Enable Automatic Backup Integrity Checks ?

Post by cristiano.cumer »

options.GenerationPolicy.RecheckBackupMonthlyScheduleOptions, here it is
veremin
Product Manager
Posts: 20413
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Enable Automatic Backup Integrity Checks ?

Post by veremin »

Those settings (can be found under $Job.Options.GenerationPolicy) control health check schedule:

Code: Select all

EnableRechek
RecheckScheduleKind 
RecheckDays
RecheckBackupMonthlyScheduleOptions
Thanks.
nsimao
Veeam Software
Posts: 67
Liked: 3 times
Joined: Oct 18, 2011 3:47 am
Full Name: Nelson Simao
Contact:

Re: Enable Automatic Backup Integrity Checks ?

Post by nsimao »

Hi Team,

I have a customer who is trying to use the following script to enable storage guard on 9.5 and U3 (which works in U2) and is getting an error:

#Enable Storage-level corruption guard
$Job = Get-VBRJob -name "PrimaryBackup"
$Options = $Job.getoptions()
$Options.GenerationPolicy.RecheckScheduleKind = "Daily"
$Options.GenerationPolicy.Recheckdays = "Sunday"
$Options.GenerationPolicy.EnableRechek = $true
$job.SetOptions($Options) | out-null
write-log "Storage-level corruption guard has been enabled Successfully."

Have there been any changes in U3 to the cmdlet? They need to apply it across a large number of backup servers too, so powershell is required.

Thanks.
veremin
Product Manager
Posts: 20413
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Enable Automatic Backup Integrity Checks ?

Post by veremin »

Try to change this line:

Code: Select all

$job.SetOptions($Options) | out-null
To

Code: Select all

Set-VBRJobOptions -Job $Job -Options $Options
Thanks.
nsimao
Veeam Software
Posts: 67
Liked: 3 times
Joined: Oct 18, 2011 3:47 am
Full Name: Nelson Simao
Contact:

Re: Enable Automatic Backup Integrity Checks ?

Post by nsimao »

Thanks for the assistance Vladimir. I tested the code you provided with the customer and it works as expected with update 3a (RTM provided on the forum by Anton).

I'm assuming there wont be any difference between the RTM code for update 3a and GA?
veremin
Product Manager
Posts: 20413
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Enable Automatic Backup Integrity Checks ?

Post by veremin »

Might be, but that certainly won't affect the script provided. Thanks.
Post Reply

Who is online

Users browsing this forum: Amazon [Bot], Semrush [Bot] and 16 guests