Duplicity备份到S3:BackendException

我正在尝试将我的Duplicity安assembly置为备份到Amazon S3存储桶。 我不断收到一个BackendException错误,没有进一步的细节。

编辑:我已经从这个问题中删除我的Duplyconfiguration努力查找更多的问题,并切换到一个小目录(10 MB,34个文件)的简单的重复命令。

这是我试图运行的命令:

 duplicity full ./logs "s3://s3-us-east-1.amazonaws.com/bucketname" -v9 

这里是输出:

 root@ats:/var/ats# duplicity full ./logs "s3://s3-us-east-1.amazonaws.com/bucketname" -v9 Duplicity 0.6 series is being deprecated: See http://www.nongnu.org/duplicity/ Using archive dir: /root/.cache/duplicity/876c7d0b54276e675d41f6ea6077d52f Using backup name: 876c7d0b54276e675d41f6ea6077d52f Import of duplicity.backends.botobackend Succeeded Import of duplicity.backends.cfbackend Succeeded Import of duplicity.backends.dpbxbackend Succeeded Import of duplicity.backends.ftpbackend Succeeded Import of duplicity.backends.ftpsbackend Succeeded Import of duplicity.backends.gdocsbackend Succeeded Import of duplicity.backends.hsibackend Succeeded Import of duplicity.backends.imapbackend Succeeded Import of duplicity.backends.localbackend Succeeded Import of duplicity.backends.megabackend Succeeded Import of duplicity.backends.rsyncbackend Succeeded Import of duplicity.backends.sshbackend Succeeded Import of duplicity.backends.swiftbackend Succeeded Import of duplicity.backends.tahoebackend Succeeded Import of duplicity.backends.webdavbackend Succeeded Import of duplicity.backends.~par2wrapperbackend Succeeded Using temporary directory /tmp/duplicity-sQ3sGs-tempdir Backend error detail: Traceback (most recent call last): File "/usr/local/bin/duplicity", line 1509, in <module> with_tempdir(main) File "/usr/local/bin/duplicity", line 1503, in with_tempdir fn() File "/usr/local/bin/duplicity", line 1336, in main action = commandline.ProcessCommandLine(sys.argv[1:]) File "/usr/local/lib/python2.7/dist-packages/duplicity/commandline.py", line 1062, in ProcessCommandLine backup, local_pathname = set_backend(args[0], args[1]) File "/usr/local/lib/python2.7/dist-packages/duplicity/commandline.py", line 955, in set_backend globals.backend = backend.get_backend(bend) File "/usr/local/lib/python2.7/dist-packages/duplicity/backend.py", line 163, in get_backend return _backends[pu.scheme](pu) File "/usr/local/lib/python2.7/dist-packages/duplicity/backends/_boto_single.py", line 163, in __init__ self.resetConnection() File "/usr/local/lib/python2.7/dist-packages/duplicity/backends/_boto_single.py", line 189, in resetConnection raise BackendException(err.message) BackendException BackendException: 

我用这个脚本testing了Boto(这是Duplicity用于S3连接的):

 root@ats:/var/ats# python Python 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import boto.s3 >>> conn = boto.s3.connect_to_region("us-east-1") >>> bucket = conn.get_bucket("bucketname") >>> for key in bucket.list(): print key, key.storage_class ... <Key: bucketname,test.txt> STANDARD >>> exit() 

我确定我运行的是最新版本的duplicity和python,并且设置了在Boto中可以正常工作的AWS_ *variables。

我错过了什么吗? 我该怎么办?

我不知道为什么原来的命令不起作用,但最终我发现将URL格式从s3://s3-us-east-1.amazonaws.com/bucketnames3+http://bucketname修复了这个问题。

现在减less的工作命令是:

 duplicity full ./logs "s3+http://bucketname" -v9 

如果仍然无法正常工作,请尝试添加: export S3_USE_SIGV4="True"到您的duplyconfiguration文件conf文件。

这在这里详细描述,并为我工作。

SIGV4和s3 + http解决scheme都不适合我。

我的解决scheme是在URL中使用区域名称,而不是通用的“s3”。 就我而言,这是欧洲西部1(爱尔兰)。

这看起来像:

s3://s3-eu-west-1.amazonaws.com/bucketname

代替:

s3://s3.amazonaws.com/bucketname

即使第二个通用的URL在其他工具(如s3cmd)中工作,它也不适用于Duplicity / Boto。

如果您正在使用法兰克福或新加坡等新地区,您可能需要将此解决scheme与Joe Hudson的答案结合起来。