Skip to content

Commit 6b1d8b0

Browse files
Merge pull request #272586 from AbhishekMallick-MS/Apr-18-2024-Git
Addressed Git issue #115254
2 parents 8f09d80 + 96dd069 commit 6b1d8b0

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

articles/backup/backup-azure-vms-enhanced-policy.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Back up Azure VMs with Enhanced policy
33
description: Learn how to configure Enhanced policy to back up VMs.
44
ms.topic: how-to
5-
ms.date: 04/01/2024
5+
ms.date: 04/18/2024
66
ms.reviewer: sharrai
77
ms.service: backup
88
ms.custom: devx-track-azurecli, devx-track-azurepowershell
@@ -106,27 +106,26 @@ Also, the output object for this cmdlet contains the following additional fields
106106
**Step 2: Set the backup schedule objects**
107107

108108
```azurepowershell
109-
$startTime = Get-Date -Date "2021-12-22T06:10:00.00+00:00"
110-
$SchPol.ScheduleRunStartTime = $startTime
111-
$SchPol.ScheduleInterval = 6
112-
$SchPol.ScheduleWindowDuration = 12
113-
$SchPol.ScheduleRunTimezone = "PST"
109+
$schedulePolicy = Get-AzRecoveryServicesBackupSchedulePolicyObject -WorkloadType AzureVM -BackupManagementType AzureVM -PolicySubType Enhanced -ScheduleRunFrequency Hourly
110+
$timeZone = Get-TimeZone -ListAvailable | Where-Object { $_.Id -match "India" }
111+
$schedulePolicy.ScheduleRunTimeZone = $timeZone.Id
112+
$windowStartTime = (Get-Date -Date "2022-04-14T08:00:00.00+00:00").ToUniversalTime()
113+
$schPol.HourlySchedule.WindowStartTime = $windowStartTime
114+
$schedulePolicy.HourlySchedule.ScheduleInterval = 4
115+
$schedulePolicy.HourlySchedule.ScheduleWindowDuration = 23
114116
115117
```
116118

117-
This sample cmdlet contains the following parameters:
119+
In this sample cmdlet:
118120

119-
- `$ScheduleInterval`: Defines the difference (in hours) between two successive backups per day. Currently, the acceptable values are *4*, *6*, *8* and *12*.
121+
- The first command gets a base enhanced hourly SchedulePolicyObject for WorkloadType AzureVM, and then stores it in the $schedulePolicy variable.
122+
- The second and third command fetches the India timezone and updates the timezone in the $schedulePolicy.
123+
- The fourth and fifth command initializes the schedule window start time and updates the $schedulePolicy.
120124

121-
- `$ScheduleWindowStartTime`: The time at which the first backup job is triggered in case of *hourly backups*. The current limits (in policy's timezone) are:
122-
- `Minimum: 00:00`
123-
- `Maximum:19:30`
125+
>[Note]
126+
>The start time must be in UTC even if the timezone is not UTC.
124127
125-
- `$ScheduleRunTimezone`: Specifies the timezone in which backups are scheduled. The default schedule is *UTC*.
126-
127-
- `$ScheduleWindowDuration`: The time span (in hours measured from the Schedule Window Start Time) beyond which backup jobs shouldn't be triggered. The current limits are:
128-
- `Minimum: 4`
129-
- `Maximum:23`
128+
- The sixth and seventh command updates the interval (in hours) after which the backup will be retriggered on the same day, duration (in hours) for which the schedule will run.
130129

131130
**Step 3: Create the backup retention policy**
132131

0 commit comments

Comments
 (0)