az dataprotection backup-policy retention-rule
Note
This reference is part of the dataprotection extension for the Azure CLI (version 2.57.0 or higher). The extension will automatically install the first time you run an az dataprotection backup-policy retention-rule command. Learn more about extensions.
Create lifecycles and add or remove retention rules in a backup policy.
Commands
Name | Description | Type | Status |
---|---|---|---|
az dataprotection backup-policy retention-rule create-lifecycle |
Create lifecycle for Azure Retention rule. |
Extension | GA |
az dataprotection backup-policy retention-rule remove |
Remove existing retention rule in a backup policy. |
Extension | GA |
az dataprotection backup-policy retention-rule set |
Add new retention rule or update existing retention rule. |
Extension | GA |
az dataprotection backup-policy retention-rule create-lifecycle
Create lifecycle for Azure Retention rule.
az dataprotection backup-policy retention-rule create-lifecycle --count
--retention-duration-type {Days, Months, Weeks, Years}
--source-datastore {ArchiveStore, OperationalStore, VaultStore}
[--copy-option {CopyOnExpiryOption, CustomCopyOption, ImmediateCopyOption}]
[--target-datastore {ArchiveStore, OperationalStore, VaultStore}]
Examples
create daily lifecycle
az dataprotection backup-policy retention-rule create-lifecycle --retention-duration-count 12 --retention-duration-type Days --source-datastore OperationalStore
Required Parameters
Retention duration count.
Retention duration type.
Specify source datastore.
Optional Parameters
Specify copy option from source datastore to target datastore.
Specify target datastore.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az dataprotection backup-policy retention-rule remove
Remove existing retention rule in a backup policy.
az dataprotection backup-policy retention-rule remove --name {Daily, Default, Monthly, Weekly, Yearly}
--policy
Examples
Remove retention rule
az dataprotection backup-policy retention-rule remove --name Daily --policy policy.json
Required Parameters
Specify the retention rule name to be removed in policy.
Existing policy Json string or file.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az dataprotection backup-policy retention-rule set
Add new retention rule or update existing retention rule.
az dataprotection backup-policy retention-rule set --lifecycles
--name {Daily, Default, Monthly, Weekly, Yearly}
--policy
Examples
Add daily retention rule
az dataprotection backup-policy retention-rule set --lifecycles dailylifecycle.json --name Daily --policy policy.json
Required Parameters
Lifecycles to be associated with the retention rule. Specify space separated json file names.
Specify the retention rule name to be edited in policy.
Policy Json string or file.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.