从S3存储桶中获取文件的特定版本 [英] Getting specific version of file from S3 bucket

查看:136
本文介绍了从S3存储桶中获取文件的特定版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在S3存储桶中有一个文件,其中版本控制已打开.使用aws-cli是否可以复制此文件的特定版本,而不是最新版本?

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?

推荐答案

是的,您可以看到此示例,您将需要该对象的版本ID.

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

您还可以使用此命令列出用于获取版本ID的版本.

Also you can list the version for getting the version ID using this commands.

aws s3api list-object-versions --bucket mybucket

这篇关于从S3存储桶中获取文件的特定版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆