问题
I have a file in a S3 bucket with versioning turned on. Using the aws-cli is there a way to copy a specific version of this file, rather than the latest version?
回答1:
Yes you can do that see this example you will need the version ID for the object.
aws s3api get-object --bucket mybucket --key file1.txt --version-id Mj1.PcWG8e.C._7LhvFU131pXJ98abIl foo.txt
Also you can list the version for getting the version ID using this commands.
aws s3api list-object-versions --bucket mybucket
回答2:
Yes, use aws s3api get-object
and specify --version-id
More info here http://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html
来源:https://stackoverflow.com/questions/38599477/getting-specific-version-of-file-from-s3-bucket