Skip to content

Instantly share code, notes, and snippets.

@grrywlsn
Created April 22, 2020 10:50
Show Gist options
  • Save grrywlsn/250cdfa3d1233e3e8404744d345c98db to your computer and use it in GitHub Desktop.
Save grrywlsn/250cdfa3d1233e3e8404744d345c98db to your computer and use it in GitHub Desktop.
Delete all AWS backups from a vault
#!/bin/bash
while [[ backup ]] ; do
backup=`aws backup list-recovery-points-by-backup-vault --backup-vault-name @@@@ --max-results 1 | jq -r ".RecoveryPoints[].RecoveryPointArn"`
echo "Deleting $backup..."
`aws backup delete-recovery-point --backup-vault-name @@@@ --recovery-point-arn $backup`
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment