Skip to content

Instantly share code, notes, and snippets.

@mumumu
Created June 13, 2014 04:30
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 mumumu/6ccda50ccddabd7c2628 to your computer and use it in GitHub Desktop.
Save mumumu/6ccda50ccddabd7c2628 to your computer and use it in GitHub Desktop.
#!/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