我想用rsync/home备份我的目录。我已阅读 rsync 的手册页并决定使用过滤规则来完成此任务。
我想要实现的目标: 排除目录中的所有文件和目录Repos,但保留所有pull_all.sh文件和output目录--- 无论它们位于Repos目录中的位置。
到目前为止,我最终得到了以下过滤器列表,但这仅备份pull_all.sh文件而不output备份目录:
# 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)