2015-03-30 140 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 
相關問題