查找与备份策略关联的Azure备份

查找与备份策略关联的Azure备份

本文介绍了查找与备份策略关联的Azure备份/保留的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以通过以下方式获取备份策略名称:,但要查找与backuppolicy相关的实际配置,例如以下数据:

I can get backup policy name via : How to find Azure VM applied backup protection policy name via Powershell BUT looking to find actual configuration associated with backuppolicy like following data :

备份频率

每天00:00保留范围

Daily at 00:00RETENTION RANGE

保留每日备份点

保留每天00:00进行的7天备份保留每周备份点

Retain backup taken every day at 00:00 for 7 Day(s)Retention of weekly backup point

保留每周六00:00每周进行的备份4周保留每月备份点

Retain backup taken every week on Saturday at 00:00 for 4 Week(s)Retention of monthly backup point

保留每月在第一个星期六的00:00进行的备份,为期12个月保留年度备份点

Retain backup taken every month on First Saturday at 00:00 for 12 Month(s)Retention of yearly backup point

保留每年1月在第一个星期六的00:00进行的99年备份

Retain backup taken every year in January on First Saturday at 00:00 for 99 Year(s)

推荐答案

您可以使用Get-AzureRmRecoveryServicesBackupProtectionPolicy|fl来获取它们.

You could use Get-AzureRmRecoveryServicesBackupProtectionPolicy|fl to get them.

例如:

##Replace Recovery service vault name
Get-AzureRmRecoveryServicesVault -Name "shui" | Set-AzureRmRecoveryServicesVaultContext

##FriendlyName is your Azure VM name
$namedContainer=Get-AzureRmRecoveryServicesBackupContainer -ContainerType "AzureVM" -Status "Registered" -FriendlyName "shui"
$item = Get-AzureRmRecoveryServicesBackupItem -Container $namedContainer -WorkloadType "AzureVM"

$policyname=$item.ProtectionPolicyName
$policy=Get-AzureRmRecoveryServicesBackupProtectionPolicy -Name $policyname

##BACKUP FREQUENCY
$policy.SchedulePolicy
##RETENTION RANGE
$policy.RetentionPolicy

这篇关于查找与备份策略关联的Azure备份/保留的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 13:08