Skip to content

Instantly share code, notes, and snippets.

@mrchilds
Created November 21, 2013 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrchilds/7586217 to your computer and use it in GitHub Desktop.
Save mrchilds/7586217 to your computer and use it in GitHub Desktop.
S3 Bucket Size
# Crude but does the job
from boto.s3.connection import S3Connection
conn = XXX
rs = conn.get_all_buckets()
# Get bucket
bucket_name = 'XXX'
for b in rs:
if b.name == bucket_name:
bucket = b
total_bytes = 0
for key in bucket:
total_bytes += key.size
total_bytes
Out[21]: 365139901385
or
340 Gb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment