I have an amazon s3 bucket that has tens of thousands of filenames in it. What's the easiest way to get a text file that lists all the filenames in the bucket?
A:
I'd recommend using boto. Then it's a quick couple of lines of python:
import boto
conn = S3Connection('access-key','secret-access-key')
bucket = conn.get_bucket('bucket')
for key in bucket.list():
print key.name
Save this as list.py, open a terminal, and then run:
$ python list.py > results.txt
zach at longtail
2010-07-27 16:25:00