I want download all the versions of a file with 100 000 versions from Amazon S3

0 votes
I have been using the AWS command line on my Windows lately and all methods that I have applied I found out that I need to get a list of version-IDs for all the objects. I
Are there some sort of files that I can upload in order to get the list of all the IDs for my reference ?
May 28, 2018 in AWS by Cloud gunner
• 4,670 points
• 4,218 views

1 answer to this question.

0 votes

Here is the Python code using boto will download all versions of files found in a bucket I wanted the same thing, so I tried this, trust me its good and will work. Also, It's possible that a large number of versions will require paging through the result set.

import boto
conn = boto.connect_s3()
bucket = conn.get_bucket('BUCKET')

# Get a list of all versions contained in the bucket
versions = bucket.list_versions(prefix='FILENAME')

for v in versions:
  # Save the version to a filename based on the Last Modified date
  v.get_contents_to_filename(v.last_modified)
answered May 28, 2018 by Flying geek
• 3,280 points

Related Questions In AWS

0 votes
1 answer

Javascript code to download a file from Amazon S3

Hai, I was thinking along the same ...READ MORE

answered Dec 31, 2018 in AWS by Archana
• 5,640 points
• 15,393 views