0

I'm currently using unison for syncing local files with my cloud. 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:

 "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.

Unfortunately, unison throws an error here when I run the batch file:

Uncaught exception 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.

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.

How's the way to get unison to ignore some directories when only using command line options?

kaya3
  • 47,440
  • 4
  • 68
  • 97
bear87
  • 83
  • 1
  • 11
  • Sorry for coming in late, but are you sure you don't need to enclose the argument to `-ignore` in quotes, to prevent the shell from expanding the wildcards (`*`) ? I'm not familiar with the shells in Windows. – Edward Jan 04 '22 at 08:04

1 Answers1

0

I think your syntax is wrong. Try

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

From the Unison manual

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'.

Mike Pierce
  • 1,390
  • 1
  • 12
  • 35
  • Thanks for your answer. When I try this I get an syntax error from unison: Uncaught exception Sys_error("C:\\Users\\name\\.unison\\{*.*.tmp}': The syntax for file name, directory name or volume is wrong. Unison apparently tries to open a file named *.*.tmp. – bear87 Jan 02 '22 at 04:36