1

Given a rsync filter file that looks something like this, is there a way to list all files in the directory that satisfy the filter?

+ /var/lib/hello/samba/*
- /var/lib/world/sdfs/
- /var/lib/world/staging/
- /var/lib/world/uml/
+ /var/lib/world/**

Is there a way to check if a specific path string satisfies the filter? For instance, the input path string could be /var/lib/hello/samba/file1 or /var/lib/world/dir1 or /var/lib/world/file2

4

1 回答 1

1

为了列出要跟踪的文件,请在不指定目标的情况下调用 rsync。例如,像

rsync --recursive --filter='merge rsync_filter_file' source_dir

您还可以尝试查看可用于 rsync 的 dry-run 参数。

于 2020-05-14T18:49:45.497 回答