当我尝试在 OS X 计算机上的 S3 中列出或恢复 duplicity 备份中的文件时,遇到了权限错误:
Traceback (most recent call last):
File "/usr/local/bin/duplicity", line 1411, in <module>
with_tempdir(main)
File "/usr/local/bin/duplicity", line 1404, in with_tempdir
fn()
File "/usr/local/bin/duplicity", line 1282, in main
sync_archive(decrypt)
File "/usr/local/bin/duplicity", line 1082, in sync_archive
copy_to_local(fn)
File "/usr/local/bin/duplicity", line 1031, in copy_to_local
tdp.move(globals.archive_dir.append(loc_name))
File "/Library/Python/2.7/site-packages/duplicity/path.py", line 618, in move
self.copy(new_path)
File "/Library/Python/2.7/site-packages/duplicity/path.py", line 444, in copy
self.copy_attribs(other)
File "/Library/Python/2.7/site-packages/duplicity/path.py", line 449, in copy_attribs
util.maybe_ignore_errors(lambda: os.chown(other.name, self.stat.st_uid, self.stat.st_gid))
File "/Library/Python/2.7/site-packages/duplicity/util.py", line 65, in maybe_ignore_errors
return fn()
File "/Library/Python/2.7/site-packages/duplicity/path.py", line 449, in <lambda>
util.maybe_ignore_errors(lambda: os.chown(other.name, self.stat.st_uid, self.stat.st_gid))
OSError: [Errno 1] Operation not permitted: '/Users/dlp/.cache/duplicity/duply_default/duplicity-full-signatures.20130611T011527Z.sigtar.gz'
该文件的权限为 600,我是所有者:
$ ls -alh ~/.cache/duplicity/duply_default/duplicity-full-signatures.20130611T011527Z.sigtar.gz
-rw------- 1 dlp staff 11M Jun 11 15:31 /Users/dlp/.cache/duplicity/duply_default/duplicity-full-signatures.20130611T011527Z.sigtar.gz
如果我以 root 身份运行 duplicity,我可以按预期列出文件。这些文件最初是在运行 Debian 7 的 VPS 上备份的。有人知道是什么原因造成的吗?
答案1
这应该可以解决你的问题:
$ mkdir -p ~/.cache/tmp
$ duplicity <your options> --tempdir=~/.cache/tmp
关于这个错误的更多信息(以及对我来说不起作用的第二种解决方法): https://bugs.launchpad.net/duplicity/+bug/1077647