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,260 points
46 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,150 points

Related Questions In AWS

0 votes
0 answers

I want to get file name from key in S3 bucket wanted to read single file from list of file present in bucket

1 <class 'boto.s3.key.Key'> <Key: numbers-email, staging/Procured_Numbers_Status/procured_numbers_status_2019-05-15:06:09:04.csv> I ...READ MORE

May 15 in AWS by anonymous
36 views
0 votes
1 answer
+13 votes
2 answers
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 56,160 points
100 views
+1 vote
4 answers

How do I cache my images which are stored in Amazon S3?

when caching ec2 instance these can be ...READ MORE

answered Oct 23, 2018 in AWS by Nabarupa
403 views