小编Sch*_*ure的帖子

rsync:使用过滤器排除顶级目录,但包含其一些子目录

我想用rsync/home备份我的目录。我已阅读 rsync 的手册页并决定使用过滤规则来完成此任务。

\n\n

我想要实现的目标: 排除目录中的所有文件和目录Repos,但保留所有pull_all.sh文件和output目录--- 无论它们位于Repos目录中的位置。

\n\n

到目前为止,我最终得到了以下过滤器列表,但这仅备份pull_all.sh文件而不output备份目录:

\n\n
# Files prefixed with "+ " are included. Files prefixed with "- " are excluded.\n#\n# The order of included and excluded files matters! For instance, if a folder\n# is excluded first, no subdirectory can be included anymore. Therefore,\n# mention included files first. Then, mention excluded files.\n#\n# See section "FILTER RULES" of rsync …
Run Code Online (Sandbox Code Playgroud)

linux rsync filter

3
推荐指数
1
解决办法
5106
查看次数

标签 统计

filter ×1

linux ×1

rsync ×1