Skip to content

Instantly share code, notes, and snippets.

@akerouanton
Created July 2, 2017 23:06
Show Gist options
  • Save akerouanton/c9ceb18ae334e807c23f7a4ec79aff98 to your computer and use it in GitHub Desktop.
Save akerouanton/c9ceb18ae334e807c23f7a4ec79aff98 to your computer and use it in GitHub Desktop.
Cleanup Gaufrette buckets
#!/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