Created
March 12, 2022 01:29
-
-
Save alana314/fbb8729531a3ebcd832bf30333fff6e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#Sync and then nuke S3 Bucket and all contents | |
if [ $# != 1 ]; then | |
echo "Usage: $0 [S3-bucket-name]" >&2 | |
exit 1 | |
fi | |
echo "Sync $1 to local? Press [ENTER] to continue" | |
read -s < /dev/tty | |
aws s3 sync s3://$1 ./$1 | |
echo "Empty bucket $1? Press [ENTER] to continue" | |
read -s < /dev/tty | |
aws s3 rm s3://$1 --recursive | |
echo "Delete bucket $1? Press [ENTER] to continue" | |
read -s < /dev/tty | |
aws s3 rb s3://$1 | |
echo "ok" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment