Skip to content

Instantly share code, notes, and snippets.

@akinnard
Created January 29, 2016 00:45
Show Gist options
  • Save akinnard/24136d28fbc24b48952e to your computer and use it in GitHub Desktop.
Save akinnard/24136d28fbc24b48952e to your computer and use it in GitHub Desktop.
Get s3 buckets size by day (last modified)
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