简体   繁体   English

duplicity + rsync 仍然使用 --rsync-options 备份排除的文件

[英]duplicity + rsync still backup excluded files with --rsync-options

By using the command below, I intended to exclude three types of an archive with a name that consists of Backup, however, the files still get copied.通过使用下面的命令,我打算排除三种名称由 Backup 组成的存档类型,但是,文件仍然会被复制。 Any idea what's the mistake?知道有什么错误吗?

   duplicity --encrypt-key somekey --verbosity 8 --rsync-options "-avPt --delete --delete-excluded --exclude="*Backup*."{zip,tar,xz} --include="*/" --include="*" --rsync-path="sudo rsync"" source dest

I realize the --exclude flag from duplicity exist, but rsync 's more suit to my needs (multiple combinations of the flags achieve what I want).我意识到存在来自duplicity--exclude标志,但rsync更适合我的需要(标志的多种组合实现了我想要的)。 This will only be my last resort if using rsync's own flag is impossible.如果不可能使用 rsync 自己的标志,这将是我最后的手段。

duplicity will only use your --rsync-options if your destination url has the form rsync://... .如果您的目标网址具有rsync://...形式, --rsync-options只会使用您的--rsync-options

Also, the command you give above is using double-quotes inside double-quotes, which may not work as you intended.此外,您上面给出的命令是在双引号内使用双引号,这可能无法按您的预期工作。 Looking at the sources, in backend.py we see that python shlex is used to parse the command line that you provide via --rsync-options .查看源代码,在backend.py 中,我们看到 python shlex用于解析您通过--rsync-options提供的命令行。 It seems therefore that you can use single quotes to quote each separate argument, including the one with spaces: --rsync-path='sudo rsync' .因此,您似乎可以使用单引号来引用每个单独的参数,包括带空格的参数: --rsync-path='sudo rsync'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM