S3sync 不工作

S3sync 不工作

我设法让 s3sync 将我的测试文件夹上传到 Amazon S3 并可以在 MWS 管理控制台中看到它。

将数据下载回测试文件夹会导致以下错误消息:


root@mybucketname:/var/s3sync# ./week_download.sh
s3Prefix backups/weekly
localPrefix /var/s3sync/testdown/weekly
s3TreeRecurse mybucketname backups/weekly
Creating new connection
Trying command list_bucket mybucketname prefix backups/weekly max-keys 200 delimiter / with 100 retries le
ft
Response code: 200
prefix found: /
s3TreeRecurse mybucketname backups/weekly /
Trying command list_bucket mybucketname prefix backups/weekly/ max-keys 200 delimiter / with 100 retries l
eft
Response code: 200
S3 item backups/weekly/
s3 node object init. Name: Path:backups/weekly Size:0 Tag:d41d8cd98f00b204e9800998ecf8427e Date:Fri O
ct 29 14:21:53 UTC 2010
local node object init. Name: Path:/var/s3sync/testdown/weekly/ Size: Tag: Date:
source:
dest:
Update node
s3sync.rb:638:in `initialize': No such file or directory - /var/s3sync/testdown/weekly/.s3syncTemp (E
rrno::ENOENT)
from s3sync.rb:638:in `open'
from s3sync.rb:638:in `updateFrom'
from s3sync.rb:393:in `main'
from s3sync.rb:735

我正在使用以下下载脚本:


#!/bin/bash
# script to download local directory upto s3
cd /var/s3sync/
export AWS_ACCESS_KEY_ID=nothing to see here
export AWS_SECRET_ACCESS_KEY=nothing to see here
export SSL_CERT_DIR=/var/s3sync/certs
ruby s3sync.rb -r -v -d --progress --make-dirs mybucket:backups/weekly /var/s3sync/testdown
# copy and modify line above for each additional folder to be synced

有什么想法吗?下载脚本是否需要下载到 Amazon S3 的源,即 testup 文件夹?希望在完全失败且原始文件夹不存在的情况下,它会从我这里下载所有内容。

注意:将我的存储桶名称更改为“mybucketname”,以便它不公开!

答案1

为了下载 (GET),必须首先指定存储桶/前缀,然后指定本地路径。要上传 (PUT),顺序相反,首先指定路径,然后指定存储桶。在您的下载示例中,存储桶是第二个指定的,因此它实际上是尝试上传“tesstup”目录。

http://s3.amazonaws.com/ServEdge_pub/s3sync/README.txt

相关内容