AZ CLI 备份策略 retentionDuration 保存不超过 7 天
AZ CLI backup policy retentionDuration not save more than 7 days
我正在使用 AZ CLI 为我的 MV 配置备份。
我创建了以下备份策略:
{
"eTag": null,
"id": "/#############",
"location": null,
"name": "DefaultPolicy",
"properties": {
"backupManagementType": "AzureIaasVM",
"instantRpDetails": {
"azureBackupRgNamePrefix": null,
"azureBackupRgNameSuffix": null
},
"instantRpRetentionRangeInDays": 2,
"protectedItemsCount": 1,
"retentionPolicy": {
"dailySchedule": {
"retentionDuration": {
"count": 30,
"durationType": "Days"
},
"retentionTimes": [
"2021-07-30T18:30:00+00:00"
]
},
"monthlySchedule": null,
"retentionPolicyType": "LongTermRetentionPolicy",
"weeklySchedule": null,
"yearlySchedule": null
},
"schedulePolicy": {
"schedulePolicyType": "SimpleSchedulePolicy",
"scheduleRunDays": null,
"scheduleRunFrequency": "Daily",
"scheduleRunTimes": [
"2021-07-30T18:30:00+00:00"
],
"scheduleWeeklyFrequency": 0
},
"timeZone": "UTC"
},
"resourceGroup": "RSGNAME",
"tags": null,
"type": "Microsoft.RecoveryServices/vaults/backupPolicies"
}
但是,当我检查当前可用的备份时,只能看到接下来的 7 天。
$ az backup job list --resource-group $MYGROUP --vault-name $MYVAULT --output table
Name Operation Status Item Name Backup Management Type Start Time UTC Duration
------------------------------------ ----------- --------- ----------------------- ------------------------ -------------------------------- --------------
111111111111111111111111111111111111 Backup Completed VM000000000000000000001 AzureIaasVM 2021-08-22T18:34:17.278978+00:00 1:41:15.046246
111111111111111111111111111111111111 Backup Completed VM000000000000000000001 AzureIaasVM 2021-08-21T18:36:46.181912+00:00 0:51:15.567965
111111111111111111111111111111111111 Backup Completed VM000000000000000000001 AzureIaasVM 2021-08-20T18:33:07.149902+00:00 1:51:16.718326
111111111111111111111111111111111111 Backup Completed VM000000000000000000001 AzureIaasVM 2021-08-19T18:38:39.130984+00:00 1:41:15.183022
111111111111111111111111111111111111 Backup Completed VM000000000000000000001 AzureIaasVM 2021-08-18T18:39:26.770685+00:00 1:41:16.276962
111111111111111111111111111111111111 Backup Completed VM000000000000000000001 AzureIaasVM 2021-08-17T18:37:04.641265+00:00 1:41:16.294330
111111111111111111111111111111111111 Backup Completed VM000000000000000000001 AzureIaasVM 2021-08-16T18:37:37.795313+00:00 1:41:15.296275
这是什么问题?如您所见,政策已在30天后制定
如评论中所述,请指定 --start-date
和 --end-date
参数以获取这些日期之间的备份列表。
可以在此处找到有关参数的更多信息:https://docs.microsoft.com/en-us/cli/azure/backup/job?view=azure-cli-latest#az_backup_job_list。
我正在使用 AZ CLI 为我的 MV 配置备份。
我创建了以下备份策略:
{
"eTag": null,
"id": "/#############",
"location": null,
"name": "DefaultPolicy",
"properties": {
"backupManagementType": "AzureIaasVM",
"instantRpDetails": {
"azureBackupRgNamePrefix": null,
"azureBackupRgNameSuffix": null
},
"instantRpRetentionRangeInDays": 2,
"protectedItemsCount": 1,
"retentionPolicy": {
"dailySchedule": {
"retentionDuration": {
"count": 30,
"durationType": "Days"
},
"retentionTimes": [
"2021-07-30T18:30:00+00:00"
]
},
"monthlySchedule": null,
"retentionPolicyType": "LongTermRetentionPolicy",
"weeklySchedule": null,
"yearlySchedule": null
},
"schedulePolicy": {
"schedulePolicyType": "SimpleSchedulePolicy",
"scheduleRunDays": null,
"scheduleRunFrequency": "Daily",
"scheduleRunTimes": [
"2021-07-30T18:30:00+00:00"
],
"scheduleWeeklyFrequency": 0
},
"timeZone": "UTC"
},
"resourceGroup": "RSGNAME",
"tags": null,
"type": "Microsoft.RecoveryServices/vaults/backupPolicies"
}
但是,当我检查当前可用的备份时,只能看到接下来的 7 天。
$ az backup job list --resource-group $MYGROUP --vault-name $MYVAULT --output table
Name Operation Status Item Name Backup Management Type Start Time UTC Duration
------------------------------------ ----------- --------- ----------------------- ------------------------ -------------------------------- --------------
111111111111111111111111111111111111 Backup Completed VM000000000000000000001 AzureIaasVM 2021-08-22T18:34:17.278978+00:00 1:41:15.046246
111111111111111111111111111111111111 Backup Completed VM000000000000000000001 AzureIaasVM 2021-08-21T18:36:46.181912+00:00 0:51:15.567965
111111111111111111111111111111111111 Backup Completed VM000000000000000000001 AzureIaasVM 2021-08-20T18:33:07.149902+00:00 1:51:16.718326
111111111111111111111111111111111111 Backup Completed VM000000000000000000001 AzureIaasVM 2021-08-19T18:38:39.130984+00:00 1:41:15.183022
111111111111111111111111111111111111 Backup Completed VM000000000000000000001 AzureIaasVM 2021-08-18T18:39:26.770685+00:00 1:41:16.276962
111111111111111111111111111111111111 Backup Completed VM000000000000000000001 AzureIaasVM 2021-08-17T18:37:04.641265+00:00 1:41:16.294330
111111111111111111111111111111111111 Backup Completed VM000000000000000000001 AzureIaasVM 2021-08-16T18:37:37.795313+00:00 1:41:15.296275
这是什么问题?如您所见,政策已在30天后制定
如评论中所述,请指定 --start-date
和 --end-date
参数以获取这些日期之间的备份列表。
可以在此处找到有关参数的更多信息:https://docs.microsoft.com/en-us/cli/azure/backup/job?view=azure-cli-latest#az_backup_job_list。