Ignore Pattern Targeting A Single FIle

I want to only sync a single file (foo. ) in the root directory which has other files and multiple sub directories. So I entered this:

! foo
*

But it doesn’t exclude the single file I want to keep.

According to all the help files, etc this should work but it doesn’t. What am I missing?

You are excluding a file called <space>foo.

It’ll also be more efficient if you target it directly in the root, if that’s where it is.

!/foo
*

Otherwise Syncthing will anyway need to walk all directories to check for entries called foo that might exist in there.

2 Likes

Thanks for the fact response

Entered this pattern, but still no joy. (the asterix is on the next line, but the site reformatted it.)

Then you need to show what you’re actually doing, not a similar representation. Details matter.

I solved the issue.

Instead of trying to include, I excluded the file and then added an ignore case variable. It worked.

Thanks for your help.