Created
July 2, 2017 23:06
-
-
Save akerouanton/c9ceb18ae334e807c23f7a4ec79aff98 to your computer and use it in GitHub Desktop.
Cleanup Gaufrette buckets
This file contains hidden or 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/bash | |
set -o nounset | |
set -o errexit | |
# set -o xtrace | |
buckets=($(aws --profile knplabs s3api list-buckets | awk '{print $3}' | grep gaufrette)) | |
echo "${#buckets[@]} buckets found." | |
for bucket in ${buckets[@]} | |
do | |
echo "Deleting $bucket..." | |
aws --profile knplabs s3 rm --recursive s3://$bucket | |
aws --profile knplabs s3api delete-bucket --bucket $bucket | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment