Created
June 13, 2014 04:30
-
-
Save mumumu/6ccda50ccddabd7c2628 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
import boto | |
conn=boto.connect_s3('api_key','api_secret') | |
bucket=conn.get_bucket('bucket_name'); | |
keys=bucket.list('path/to/folder') | |
size=0 | |
for key in keys: | |
print "%s:%d" % (key, key.size) | |
size+= key.size | |
print "total: %d GB" % (size / (1024 * 1024 * 1024)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment