Created
April 5, 2018 15:11
-
-
Save mmirolim/644a08529662614f3f01e350f3c0dcca to your computer and use it in GitHub Desktop.
total size of s3 storage
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/bash | |
for bucket in $(aws s3 ls |awk '{print $3}'); do | |
echo $bucket | |
for size in $(aws s3 ls s3://${bucket} --recursive |awk '{print $3}'); do | |
total=$(expr $total + $size); | |
echo "total=$total b" | |
done | |
done | |
echo "total=$total b" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment