sersync icon indicating copy to clipboard operation
sersync copied to clipboard

同步过滤的匹配方式是不是不能支持单独过滤一个文件

Open shateily opened this issue 7 years ago • 2 comments

比如根目录下有/test/test.txt这个文件,想单独过滤掉不同步,使用 <filter start="true"> <exclude expression="^test/tes(.*)\.txt"></exclude> </filter> 或者 <filter start="true"> <exclude expression="^test/test.txt"></exclude> </filter> 都不能过滤掉,一样还是会被同步

shateily avatar Jul 24 '17 09:07 shateily

https://www.kancloud.cn/curder/linux/78148

对于sersync监控的文件,会默认过来系统的临时文件(以".“开头,以”~"结尾),除了这些文件意外,可以自定义其他需要过滤的文件。

 6	    <filter start="false">
 7		<exclude expression="(.*)\.svn"></exclude>
 8		<exclude expression="(.*)\.gz"></exclude>
 9		<exclude expression="^info/*"></exclude>
10		<exclude expression="^static/*"></exclude>
11	    </filter>

将start设置为true后开启过滤功能,在exclude标签中,填写正则表达式,默认给出两个例子分别是过滤以".gz"结尾的文件与过滤监控目录下的info路径(监控路径^/info /*),可以根据需要添加,但开启的时候要提前测试,正则表达式如果出现错误,控制台会有所提示,相比较使用rsync的exclude功能,被过滤的路径不会加入监控,大大减少了rsync同步的通讯量。

wsgzao avatar Jul 25 '17 03:07 wsgzao

@shateily 请问你后来又解决这个问题吗

fanpiao avatar Apr 24 '20 03:04 fanpiao