Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services 使用CLI在Amazon AWE上批量复制文件_Amazon Web Services_Amazon S3_Command Line Interface - Fatal编程技术网

Amazon web services 使用CLI在Amazon AWE上批量复制文件

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

这可能很容易,但它真的让我难堪。我在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-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