Created
November 21, 2013 17:47
-
-
Save mrchilds/7586217 to your computer and use it in GitHub Desktop.
S3 Bucket Size
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
# 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