gpt4 book ai didi

amazon-web-services - AWS CLI S3 : copying file locally using the terminal : fatal error: An error occurred (404) when calling the HeadObject operation

转载 作者:行者123 更新时间:2023-12-02 19:37:08 26 4
gpt4 key购买 nike

我正在尝试从 s3 存储桶本地复制文件。我可以获得我的存储桶中的文件列表:

aws s3 ls  s3://myBucket/myDirectory/todaysFiles/

但是当我尝试在本地复制文件时:

aws s3 cp s3://myBucket/myDirectory/todaysFiles/ .

我收到此错误:

fatal error: An error occurred (404) when calling the HeadObject operation: Key "myDirectory/todaysFiles/" does not exist

但我尝试在本地仅复制一个文件:

 aws s3 cp s3://myBucket/myDirectory/todaysFiles/somefile .

我收到此错误:

 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.

你们中有人知道我为什么会收到此错误或解决此错误的方法吗?

非常感谢您的帮助

最佳答案

对于第一个错误 - 添加递归标志:

aws s3 cp s3://myBucket/myDirectory/todaysFiles/ . --recursive

这会将“todaysFiles”目录中的所有文件复制到当前目录。

但是,第二个错误表明您的文件位于 Glacier 中。这让事情变得有点复杂,因为 Glacier 不是实时的 - 取决于您愿意支付的费用,数据可能需要几个小时才能恢复。请参阅Restoring Objects文档以获取更多信息。在对象从 Glacier 恢复到 S3 之前,您无法从 S3 进行复制。

请注意,如果您这样做,您将需要承担来自 Glacier 和 S3 的费用。

顺便说一句,如果这些文件确实是今天的文件,那么存储在 S3 上和推送到 Glacier 之间应该有更长的时间。但我猜测父目录也可能有一个与日期相关的组件。

关于amazon-web-services - AWS CLI S3 : copying file locally using the terminal : fatal error: An error occurred (404) when calling the HeadObject operation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45109533/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com