I want to download all files from S3 bucket which are in this path All Buckets /abc/or/uploads
I tried with this snippet but only managed to get files in All Buckets /abc
Changing the path in bucket_list = bucket.list('or/uploads')
this line is not working? why?
import boto
import sys, os
import logging
bucket_name = 'abc'
conn = boto.connect_s3('XXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXX+XXXXXXXXXXXXXX')
bucket = conn.get_bucket(bucket_name)
bucket_list = bucket.list('or/uploads')
for key in bucket.list():
try:
res = key.get_contents_to_filename(key.name)
print "done"
except:
logging.info(key.name + ":" + "FAILED")