简体   繁体   English

Unison:使用命令行按名称忽略所有路径中的目录

[英]Unison: Ignore directory by name in all paths by using command line

I'm currently using unison for syncing local files with my cloud.我目前正在使用 unison 将本地文件与我的云同步。 Therefore I have set up a batch file which contains all options I need.因此,我设置了一个批处理文件,其中包含我需要的所有选项。

"K:\unison\unison 2.48.4 text.exe" -batch -repeat 1200 -fastcheck true -log=false D:\localsync Z:\cloudsync

In order to tell unison to skip all folders with the name ".tmp" regardless of their path I came up with this command:为了告诉 unison 跳过所有名为“.tmp”的文件夹,不管它们的路径如何,我想出了这个命令:

 "K:\unison\unison 2.48.4 text.exe" -batch -repeat 1200 -fastcheck true -log=false -ignore=Name{*.*.tmp} D:\localsync Z:\cloudsync

The *.*.tmp construct is recommend since unison ignores all names beginning with a dot.推荐使用*.*.tmp结构,因为 unison 会忽略所有以点开头的名称。

Unfortunately, unison throws an error here when I run the batch file:不幸的是,当我运行批处理文件时,统一在此处引发错误:

Uncaught exception Sys_error("C:\Users\name\.unison\*.tmp)未捕获的异常 Sys_error("C:\Users\name\.unison\*.tmp)

It then complains that the syntax for the directory name is wrong.然后它抱怨目录名称的语法错误。 Obviously, unison is reading the ignore statement and looking for a file with the name of the to be ignored folder in the.unison directory.显然,unison 是在读取ignore 语句,并在.unison 目录中寻找一个名为要被忽略的文件夹的文件。

I couldn't come up with a solution to that.我想不出解决办法。 All information in the manual ( https://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html ) sets ignore paths in the unison profile which I'm not using.手册中的所有信息( https://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html )设置了我没有使用的统一配置文件中的忽略路径。

How's the way to get unison to ignore some directories when only using command line options?仅使用命令行选项时如何统一忽略某些目录?

I think your syntax is wrong.我认为你的语法是错误的。 Try尝试

-ignore 'Name {*.*.tmp}'

From the Unison manual来自Unison 手册

Ignore patterns can also be specified on the command line, if you like (this is probably not very useful), using an option like -ignore 'Name temp.txt'.如果您愿意,也可以在命令行上指定忽略模式(这可能不是很有用),使用 -ignore 'Name temp.txt' 之类的选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM