Last active
January 2, 2016 16:49
-
-
Save yuta-imai/8332910 to your computer and use it in GitHub Desktop.
The script to measure total size of objects in S3 bucket.
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 | |
import sys | |
bucket_name = sys.argv[1] | |
s3 = boto.connect_s3() | |
bucket = s3.get_bucket(bucket_name) | |
iterator = bucket.list() | |
size = 0 | |
for item in iterator: | |
size += item.size | |
print size |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Setup
Configure your ENVIRONMENT VARIABLE
Usage
Dependency
boto