use*_*482 17 amazon-s3 amazon-web-services aws-cloudformation aws-cli aws-sdk
我正在尝试从s3存储桶本地复制文件.我可以获取我的存储桶上的文件列表:
aws s3 ls s3://myBucket/myDirectory/todaysFiles/
Run Code Online (Sandbox Code Playgroud)
但是当我尝试在本地复制文件时:
aws s3 cp s3://myBucket/myDirectory/todaysFiles/ .
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
fatal error: An error occurred (404) when calling the HeadObject operation: Key "myDirectory/todaysFiles/" does not exist
Run Code Online (Sandbox Code Playgroud)
但我尝试在本地复制一个文件:
aws s3 cp s3://myBucket/myDirectory/todaysFiles/somefile .
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
warning: Skipping file s3://myBucket/myDirectory/todaysFiles/somefile. Object is of storage class GLACIER. Unable to perform download operations on GLACIER objects. You must restore the object to be able to the perform operation. See aws s3 download help for additional parameter options to ignore or force these transfers.
Run Code Online (Sandbox Code Playgroud)
你们中的任何人都知道我为什么会收到此错误或解决此错误的方法?
我非常感谢你的帮助
std*_*bar 27
对于第一个错误 - 添加递归标志:
aws s3 cp s3://myBucket/myDirectory/todaysFiles/ . --recursive
Run Code Online (Sandbox Code Playgroud)
这会将"todaysFiles"目录中的所有文件复制到当前目录.
但是,第二个错误表示您的文件位于Glacier中.这有点让事情变得复杂,因为冰川不是实时的 - 取决于你愿意付出什么,它可能需要数小时才能恢复数据.有关详细信息,请参阅" 还原对象"文档.在将对象从Glacier恢复到S3之前,无法从S3复制.
请注意,如果您这样做,您将获得Glacier和S3的费用.
顺便说一句,如果这些文件实际上是今天的文件,那么在S3上存储和推送到Glacier之间应该有更长的时间.但我猜测父目录也可能有一个与日期相关的组件.
小智 15
如果源包含多个文件夹,请在末尾使用 --recursive。
aws s3 cp s3Uri Local --recursive
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
14298 次 |
| 最近记录: |