alf*_*ish 7 linux backup amazon-s3
它曾经是我最喜欢的备份传输代理,但现在我经常在同一个 Ubuntu 服务器/网络上从 s3cmd 得到这个结果:
root@server:/home/backups# s3cmd put bkup.tgz s3://mybucket/
bkup.tgz -> s3://mybucket/bkup.tgz [1 of 1]
36864 of 2711541519 0% in 1s 20.95 kB/s failed
WARNING: Upload failed: /bkup.tgz ([Errno 32] Broken pipe)
WARNING: Retrying on lower speed (throttle=0.00)
WARNING: Waiting 3 sec...
bkup.tgz -> s3://mybucket/bkup.tgz [1 of 1]
36864 of 2711541519 0% in 1s 23.96 kB/s failed
WARNING: Upload failed: /bkup.tgz ([Errno 32] Broken pipe)
WARNING: Retrying on lower speed (throttle=0.01)
WARNING: Waiting 6 sec...
bkup.tgz -> s3://mybucket/bkup.tgz [1 of 1]
28672 of 2711541519 0% in 1s 18.71 kB/s failed
WARNING: Upload failed: /bkup.tgz ([Errno 32] Broken pipe)
WARNING: Retrying on lower speed (throttle=0.05)
WARNING: Waiting 9 sec...
bkup.tgz -> s3://mybucket/bkup.tgz [1 of 1]
28672 of 2711541519 0% in 1s 18.86 kB/s failed
WARNING: Upload failed: /bkup.tgz ([Errno 32] Broken pipe)
WARNING: Retrying on lower speed (throttle=0.25)
WARNING: Waiting 12 sec...
bkup.tgz -> s3://mybucket/bkup.tgz [1 of 1]
28672 of 2711541519 0% in 1s 15.79 kB/s failed
WARNING: Upload failed: /bkup.tgz ([Errno 32] Broken pipe)
WARNING: Retrying on lower speed (throttle=1.25)
WARNING: Waiting 15 sec...
bkup.tgz -> s3://mybucket/bkup.tgz [1 of 1]
12288 of 2711541519 0% in 2s 4.78 kB/s failed
ERROR: Upload of 'bkup.tgz' failed too many times. Skipping that file.
Run Code Online (Sandbox Code Playgroud)
即使文件小到 100MB,也会发生这种情况,所以我认为这不是大小问题。当我使用带有 --acl-private 标志的 put 时也会发生这种情况(s3cmd 版本 1.0.1)
如果您建议一些解决方案或 s3cmd 的轻量级替代方案,我将不胜感激。
小智 14
这对我的情况有帮助:
s3cmd ls在桶上做bucket_host中的那个替换.s3cfg文件中的 。s3cmd ls,它不应再打印警告我的 .s3cfg 现在是:
host_bucket = %(bucket)s.s3-external-3.amazonaws.com
Run Code Online (Sandbox Code Playgroud)
有一些常见问题会导致 s3cmd 返回您提到的错误:
s3cmd 的替代方案:
如果您想编写自己的脚本,您可以使用 Python Boto 库,该库具有执行大多数 AWS 操作的函数,并且在线提供了许多示例。有一个项目在命令行上公开了一些 boto 函数 - 尽管目前可用的函数集非常少。