2015-03-30 145 views
2

我已经完成了我认为需要做的整个序列,但在尝试在本地复制我的文件时,我仍然得到invalid argument type error。我在这里做错了什么?将存储桶文件复制到本地磁盘的问题

[email protected]:~$ aws s3 ls s://bucketname-vagrant 

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

[email protected]:~$ 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 

[email protected]:~$ aws s3 ls bucketname-vagrant/or_vagrant.sql.xz 
2015-03-30 13:55:01 102642228 or_vagrant.sql.xz 
[email protected]:~$ 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 

回答

6

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 s://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 
0

似乎是,S3是有利于s3api的过时了,这个工作

aws s3api get-object --bucket bucketname-vagrant --key or_vagrant.sql.tar.gz or_vagrant.sql.tar.gz 
相关问题