Skip to content

Instantly share code, notes, and snippets.

@mrchilds

mrchilds/S3 Size

Created Nov 21, 2013
Embed
What would you like to do?
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
You can’t perform that action at this time.