New-VBRBackupWindowOptions
Short Description
Defines backup window settings for a job.
Applies to
Platform: VMware, Hyper-V
Product Edition: Standard, Enterprise, Enterprise Plus, Veeam Universal License
Syntax
New-VBRBackupWindowOptions [-FromDay <DayOfWeek>] [-FromHour <Int32>] [-ToDay <DayOfWeek>] [-ToHour <Int32>] [-Enabled] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [<CommonParameters>] |
Detailed Description
This cmdlet creates the VBRBackupWindowOptions object that contains backup window settings for a job. These settings define a time interval within which the job must be completed. You can apply these settings to a job.
For more information on the backup windows option, see the Backup Window section in the User Guide for VMware vSphere.
Run the Set-VBRJobSchedule cmdlet to apply backup window settings to the backup, replication or backup copy job.
Run the New-VBRBackupToTapeScheduleOption cmdlet to apply backup window settings to a backup to tape job.
Parameters
Parameter | Description | Required | Position | Accept | Accept |
---|---|---|---|---|---|
FromDay | Specifies the day of week on which the backup window opens. Default: Sunday. | False | Named | False | False |
FromHour | Specifies an hour when the backup window opens. Default: 0. | False | Named | False | False |
ToDay | Specifies the day of week on which the backup window closes. Default: Saturday. | False | Named | False | False |
ToHour | Specifies an hour when the backup window closes. NOTE: The backup windows closes at the end of an hour that you specify in the ToHour parameter. For example, if you specify the 22 value for the ToHour parameter, the backup window will end at 22:59. Default: 23. | False | Named | False | False |
Enabled | Defines that the backup window is enabled. If you provide this parameter, the period that you set for a backup window will specify the time when the job is allowed to run. Otherwise, the period that you set for a backup window will specify the time when the job is not allowed to run. | False | Named | True (ByValue, | False |
<CommonParameters>
This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About CommonParameters section of Microsoft Docs.
Return Type
None.
Example 1
This command defines backup window settings that will allow a job to run from 20:00 to 22:59 every day from Monday to Friday.
$windowoptions = New-VBRBackupWindowOptions -FromDay Monday -ToDay Friday -FromHour 20 -ToHour 22 -Enabled |
Example 2
This command defines backup window settings that will allow a job to run during the following period of time:
- From 22:00 to 22:59 on Friday
- From 22:00 to 22:59 on Saturday
$windowoptions = New-VBRBackupWindowOptions -FromDay Friday -FromHour 22 -ToDay Saturday -ToHour 22 -Enabled |
Example 3
This command defines backup window settings for a job. These settings specify the period of time when the job must not run. According to these setting the job is not allowed to run from 08:00 to 20:59 on weekdays.
Example 4
This example shows how to modify schedule settings of an existing job. The job is allowed to run from 07:00 to 19:59 every day from Sunday to Monday except for Saturday.
- Run New-VBRBackupWindowOptions cmdlet to create a backup window object. Save the result to the $windowoptions variable.
- Run Get-VBRJob to get the job that you want to modify. Save the result to the $job variable.
- Run Set-VBRJobSchedule with the $windowoptions and $job variables.
$windowoptions = New-VBRBackupWindowOptions -FromDay Friday -FromHour 19 -ToDay Sunday -ToHour 07 -Enabled $job = Get-VBRJob -Name "SQL Backup Job" Set-VBRJobSchedule -Job $job -Periodicaly -FullPeriod 6 -PeriodicallyKind Hours -PeriodicallySchedule $windowoptions |
Related Commands