Skip to content

Commit

Permalink
[Backup] az backup protection backup-now: Fix bug for SQL/HANA back…
Browse files Browse the repository at this point in the history
…up retention (#23281)
  • Loading branch information
akshayneema authored Jul 21, 2022
1 parent fe7e4c8 commit c35e7f1
Show file tree
Hide file tree
Showing 38 changed files with 37,318 additions and 48,673 deletions.
9 changes: 5 additions & 4 deletions src/azure-cli/azure/cli/command_modules/backup/custom_wl.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,12 +462,13 @@ def backup_now(cmd, client, resource_group_name, vault_name, item, retain_until,

message = "For SAPHANA and SQL workload, retain-until parameter value will be overridden by the underlying policy"

if (retain_until is not None and backup_type != 'CopyOnlyFull'):
logger.warning(message)
retain_until = datetime.now(timezone.utc) + timedelta(days=30)

if retain_until is None:
retain_until = datetime.now(timezone.utc) + timedelta(days=30)
if backup_type == 'Full':
retain_until = datetime.now(timezone.utc) + timedelta(days=45)
if backup_type in ['Differential', 'Log']:
retain_until = datetime.now(timezone.utc) + timedelta(days=30)
logger.warning(message)

container_uri = cust_help.get_protection_container_uri_from_id(item.id)
item_uri = cust_help.get_protected_item_uri_from_id(item.id)
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit c35e7f1

Please sign in to comment.