如何在 Unison 同步中忽略文件夹及其子目录

Imr*_*ran 6 linux sync unison

我使用Unison在我的机器上同步网站项目,在我的一台机器中,我想避免同步(双向)我观看的文件夹中包含的某些文件夹:

/vendor
/node_modules
/storage/debugbar
/staroge/framework
Run Code Online (Sandbox Code Playgroud)

这是我用来执行同步的 .prf 文件的配置文件,您可以看到文件夹位于忽略路径行中。

# Roots of the synchronization
root = /Volumes/Data HD
root = ssh://Server//volume1/My Files

# Paths
path = Sites

# Some regexps specifying names and paths to ignore
ignore = Name */@eaDir
ignore = Name */_notes
ignore = Name .DS_Store
ignore = Name SyncToy_*.dat
ignore = Path */Archives
ignore = Path */tools
ignore = Name *.sublime*

# Ignore laravel composer and npm folders
ignore = Path {Sites/CRMJobs/node_modules}
ignore = Path {Sites/Loot/node_modules}
ignore = Path {Sites/Pompous/node_modules}
ignore = Path */vendor
ignore = Path */node_modules
ignore = Path */storage/debugbar
ignore = Path */storage/framework

log = true
times = true
auto = true
Run Code Online (Sandbox Code Playgroud)

您可以看到,在某些情况下,我什至明确提到要忽略的完整补丁,但它们仍然是同步的。

有人能告诉我我做错了什么吗?

Mik*_*rce 5

请参阅Unison 手册中的Path Specification上的这一点。而不是Path你应该使用Name.

ignore = Name vendor
ignore = Name node_modules
ignore = Name storage/debugbar
ignore = Name storage/framework
Run Code Online (Sandbox Code Playgroud)


归档时间:

查看次数:

8832 次

最近记录:

4 年,11 月 前