az dataprotection backup-policy retention-rule
Note
This reference is part of the dataprotection extension for the Azure CLI (version 2.67.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-count
--retention-duration-type --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.
Property | Value |
---|---|
Accepted values: | Days, Months, Weeks, Years |
Specify source datastore.
Property | Value |
---|---|
Accepted values: | ArchiveStore, OperationalStore, VaultStore |
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Specify copy option from source datastore to target datastore.
Property | Value |
---|---|
Accepted values: | CopyOnExpiryOption, CustomCopyOption, ImmediateCopyOption |
Specify target datastore.
Property | Value |
---|---|
Accepted values: | ArchiveStore, OperationalStore, VaultStore |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
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.
Property | Value |
---|---|
Default value: | False |
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.
Property | Value |
---|---|
Accepted values: | Daily, Default, Monthly, Weekly, Yearly |
Existing policy Json string or file.
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
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.
Property | Value |
---|---|
Default value: | False |
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.
Property | Value |
---|---|
Accepted values: | Daily, Default, Monthly, Weekly, Yearly |
Policy Json string or file.
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
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.
Property | Value |
---|---|
Default value: | False |