Amazon web services 使用CLI在Amazon AWE上批量复制文件
这可能很容易,但它真的让我难堪。我在Amazon AWS和CLI方面有大约9小时的经验 我有一个目录Amazon web services 使用CLI在Amazon AWE上批量复制文件,amazon-web-services,amazon-s3,command-line-interface,Amazon Web Services,Amazon S3,Command Line Interface,这可能很容易,但它真的让我难堪。我在Amazon AWS和CLI方面有大约9小时的经验 我有一个目录 BDp-Archive/item/ 在我的S3上,我想将该目录中的文本文件复制到名为 BDp-Archive/item/txt/ 我尝试的命令是: aws s3 mv s3://Bdp-Archive/00009e98-3e0f-402e-9d12-7aec8e32b783/ s3://BDp-Archive/00009e98-3e0f-402e-9d12-7aec8
BDp-Archive/item/
在我的S3上,我想将该目录中的文本文件复制到名为
BDp-Archive/item/txt/
我尝试的命令是:
aws s3 mv s3://Bdp-Archive/00009e98-3e0f-402e-9d12-7aec8e32b783/ s3://BDp-Archive/00009e98-3e0f-402e-9d12-7aec8e32b783/txt/ --include "*.txt"
这将抛出错误:
调用HeadObject操作时发生客户端错误(NoSuchKey):Key“
00009e98-3e0f-402e-9d12-7aec8e32b783“不存在
已完成1部分,包括。。。剩余文件您需要配置访问密钥和密钥,请尝试:
aws configure
有关更多选项,请参见:我认为问题在于您需要使用
--recursive
开关,因为默认情况下,mv
命令仅适用于单个对象(与其他命令类似-rm
,sync
等)。尝试:
我需要配置bucket的区域(或将其指定为cli命令的一部分)
aws s3 cp——区域
aws s3 mv s3://Bdp-Archive/00009e98-3e0f-402e-9d12-7aec8e32b783/ s3://BDp-Archive/00009e98-3e0f-402e-9d12-7aec8e32b783/txt/ --include "*.txt" --recursive