Skip to content

Instantly share code, notes, and snippets.

@srkiNZ84
Created October 17, 2023 01:55
Show Gist options
  • Select an option

  • Save srkiNZ84/f4ad8bee7a0759bada85de7013373feb to your computer and use it in GitHub Desktop.

Select an option

Save srkiNZ84/f4ad8bee7a0759bada85de7013373feb to your computer and use it in GitHub Desktop.

Revisions

  1. srkiNZ84 created this gist Oct 17, 2023.
    12 changes: 12 additions & 0 deletions aft_delete_recovery_points.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    #!/bin/bash

    # Run:
    # aws backup list-recovery-points-by-backup-vault --backup-vault-name aft-controltower-backup-vault | jq --raw-output ".RecoveryPoints[].RecoveryPointArn" > /tmp/aft_recovery_point_arns.txt
    # first to get the list of recovery points to delete. Then run this script with the filename as the argument
    # e.g.
    # aft_delete_recovery_points.sh /tmp/aft_recovery_point_arns.txt

    while read -r line; do
    echo "deleting recovery point: $line"
    aws backup delete-recovery-point --backup-vault-name aft-controltower-backup-vault --recovery-point-arn "$line"
    done < "$1"