amazon-web-services - 将存储桶文件复制到本地磁盘时出现问题

标签 amazon-web-services amazon-s3

我已经完成了我认为需要执行的整个序列,但在尝试本地复制文件时仍然收到无效参数类型错误。我在这里做错了什么?

vagrant@dev:~$ aws s3 ls s://bucketname-vagrant

A client error (NoSuchBucket) occurred when calling the ListObjects operation: The specified bucket does not exist

vagrant@dev:~$ aws s3 ls bucketname-vagrant
2015-03-30 14:06:02  285061467 or_vagrant.sql.tar.gz
2015-03-30 13:55:01  102642228 or_vagrant.sql.xz

vagrant@dev:~$ aws s3 ls bucketname-vagrant/or_vagrant.sql.xz
2015-03-30 13:55:01  102642228 or_vagrant.sql.xz
vagrant@dev:~$ aws s3 cp bucketname-vagrant/or_vagrant.sql.xz /tmp/

usage: aws s3 cp <LocalPath> <S3Path> or <S3Path> <LocalPath> or <S3Path> <S3Path>
Error: Invalid argument type

最佳答案

s3 并未被弃用。 s3 and s3api are on different tierss3api 是 API 级别,而 s3 具有高级命令。

ls

问题是您的第一个命令中的 s3:// 存在拼写错误。

$ aws s3 ls s://bucketname-vagrant
A client error (NoSuchBucket) occurred when calling the ListObjects operation: The specified bucket does not exist

我可以用我自己的存储桶复制该错误。这有效:

$ aws s3 ls s3://bucketname-vagrant

#cp

$ aws s3 cp bucketname-vagrant/or_vagrant.sql.xz /tmp/

这里的问题是 aws-cli 不知道您是否有名为 bucketname-vagrant 的本地目录。您可以使用 s3:// 语法修复此问题:

$ aws s3 cp s3://bucketname-vagrant/or_vagrant.sql.xz /tmp/

我再次在本地复制了该内容。

$ aws s3 cp bucket/test.txt /tmp/
usage: aws s3 cp <LocalPath> <S3Path> or <S3Path> <LocalPath> or <S3Path> <S3Path>
Error: Invalid argument type

$ aws s3 cp s3://bucket/test.txt /tmp/
download: s3://bucket/test.txt to /tmp/keybase.txt

关于amazon-web-services - 将存储桶文件复制到本地磁盘时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29354208/

相关文章:

amazon-web-services - 如何为任何堆栈更新运行 Scepter 钩子(Hook)(无需为每个堆栈显式定义)

amazon-web-services - Golang AWS API 网关无效字符 'e' 寻找值的开头

amazon-web-services - AWS S3 存储桶日志与 AWS cloudtrail

hadoop - 连接 Elastic Map Reduce ruby​​ 客户端时出错

amazon-web-services - 用于下载文件的 S3 模块在 ansible 中不起作用

amazon-web-services - 使用 BG96 和 MQTT 协议(protocol)将数据发布到 aws IoT 时连接断开

java - AWS SQS 临时队列在应用程序关闭时不会被删除

amazon-web-services - 具有多任务的AWS ECS服务需要负载均衡器

python - 使用 boto3 和 Python 3.7 从特定 "subdirectory"、AWS S3 下载多个文件

linux - AWS 是否在 SSH 连接中保存客户端的 IP?