Skip to content

Instantly share code, notes, and snippets.

@dannenberg
Created June 12, 2017 20:56
Show Gist options
  • Save dannenberg/26d4f34001a522e21fae1b01ce42e147 to your computer and use it in GitHub Desktop.
Save dannenberg/26d4f34001a522e21fae1b01ce42e147 to your computer and use it in GitHub Desktop.
for bucket in $(aws s3 ls | awk '{print $3}')
do
bucket_status=$(aws s3api get-bucket-versioning --bucket $bucket)
if [[ $bucket_status != "Enabled" ]]; then
echo $bucket
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment