Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backup] az backup protection backup-now: Fix bug for SQL/HANA backup retention #23281

Merged
merged 2 commits into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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