Skip to content

Instantly share code, notes, and snippets.

@vanrysss
Created January 23, 2019 22:34
Show Gist options
  • Save vanrysss/6daabdcf978dac4dab52973ef63fa7dd to your computer and use it in GitHub Desktop.
Save vanrysss/6daabdcf978dac4dab52973ef63fa7dd to your computer and use it in GitHub Desktop.
#!/bin/bash
for line in $(aws s3api list-buckets --query 'Buckets[?starts_with(Name, `prd-`) == `true` && contains(Name, `dead-letter`) == `true`].Name' | jq '.[]' -r)
do
echo "$line"
aws s3 ls $line --recursive --summarize | grep "Total Objects:"
done
--recursive --summarize | grep "Total Objects:"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment