Created
January 29, 2016 00:45
-
-
Save akinnard/24136d28fbc24b48952e to your computer and use it in GitHub Desktop.
Get s3 buckets size by day (last modified)
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
aws s3api list-objects --bucket your-bucket-here --output text --query 'Contents[*].{ Size:Size, LastModified:LastModified}' | awk '{ $1 = substr($1, 1, 10) } 1' | awk '{count[$1]++; sum[$1]+=$2;}END{for (s in sum){print s, "," ,sum[s], ",", count[s], "&"}}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment