如何在重复中包含/排除目录

int*_*000 11 duplicity

我正在使用双重性来备份我的一些文件。关于包含/排除模式,手册页有点令人困惑。我想备份以下内容:

/storage/include
/otherthings
Run Code Online (Sandbox Code Playgroud)

但不是

/storage/include/exclude
Run Code Online (Sandbox Code Playgroud)

包含文件目前看起来:

+ /storage/include
- /storage/include/exclude
+ /otherthings
- ** 
Run Code Online (Sandbox Code Playgroud)

双重性被称为如下:

/usr/bin/duplicity --include-globbing-filelist /Path/to/file/above / target
Run Code Online (Sandbox Code Playgroud)

它根本行不通。每次备份时,它还包括 /storage/include/exclude 中的文件。

Ant*_*hon 10

文件选择部分中的duplicity手册页指出:

每个文件选择条件匹配或不匹配给定文件。文件选择系统恰好在第一个匹配的文件选择条件指定要排除该文件时排除给定的文件;否则文件被包含在内。

这与 --include / --exclude 命令行选项优先级有关,但稍后您会在手册页中找到--include-globbing-filelist您使用的选项的相关信息:

The --include-globbing-filelist and --exclude-globbing-filelist options also 
specify filelists, but each line in the filelist will be interpreted as a
globbing pattern the way --include and --exclude options are interpreted
(although "+ " and "- " prefixing is still allowed). For instance, if the
file "globbing-list.txt" contains the lines:

    dir/foo
    + dir/bar
    - ** 

Then --include-globbing-filelist globbing-list.txt would be exactly the same
as specifying --include dir/foo --include dir/bar --exclude ** on the command
line. 
Run Code Online (Sandbox Code Playgroud)

发生的事情是/storage/include/exclude匹配第一行,因此它被包含在内。通常,您应该在不太具体的语句之前使用更具体的语句。以下应该对您有用:

- /storage/include/exclude
+ /storage/include
+ /otherthings
- ** 
Run Code Online (Sandbox Code Playgroud)