Default ignore patterns in config.xml not working

There seems to be a syncthing feature “Default ignore patterns” which should address that issue about global ignore patterns. However it does not seem to work and I did not find any information about it.

Here it is: GUI - Settings - Edit Folder Defaults - Ignore Patterns

If you type in same patterns they go into:

~/.config/syncthing/config.xml

There is a section followed by the patterns.

There is also a cli command available to import such patterns via txt file. That command maintains the same config.xml section.

So it looks pretty well implemented but no one talks about it and it does not work - at least for me.

Does anybody know something about it or know to to get it working?

thanks

1 Like

So those ignore patterns are applied to new folders, they are not combined with ignore patterns on existing folders - does that clear things up? If not, please describe what doesn’t work, i.e. what do you do (e.g. what patterns do you use_ and what happens that you don’t expect.

1 Like

Good point! I tried it with existing folders. Does this mean even applying them on new folders any updates afterwards would not be applied? If so to use that feature I have to remove all folders on all syncthing devices - setup the default patterns and recreate the folders, right?

1 Like

I’d say yes to both questions, but if you’re going to remove and re-add the folders, you can as well just edit them and replace their current ignore patterns with your updated ones. The whole process should be much faster this way.

1 Like

To apply common “default” patterns to an existing folder, it might be easy enough to just append them to the individual .stignore file using a script or similar.

If you want to be flexible about editing the common patterns later, while also retaining patterns specific to one specific shared folder, you can move the common ones to a separate file that is includeed from each .stignore file. Adjusting the common patterns then becomes as easy as overwriting that file with a new version in every shared folder.

1 Like

Defualt ignore patterns are not common/shared ignore patterns. That functionality you can get with #include. The default ignore patterns are really just what their location (inside default folder) suggests: A default for new folders, that can be used or not.

1 Like

Hm, thanks for that hint. It just looked to me as if I can only include pattern-files within that folder or subfolders that is configured for syncing. However I have about 10 independend folders and referring to one common include file outside that folder structure came up with an error.

F. i.:

syncfolders:

home/musik

home/videos

home/ignorpatterns.txt

Can I include that central file for all syncfolders? I know I could sync /home at all and exclude anything I do not want but I prefer the other way.

1 Like

You can use relative links with #include, but I think a cleaner method would be to make all .stignore files themselves symlinks or hardlinks pointing at a single file somewhere else on your system. Then, if you edit that file, the ignore patterns in all folders will also end up being updated all at once.

That said, I personally just use a script that automatically goes through all Syncthing folders and overwrites .stignore inside them with my own ignore patterns file.

1 Like

ok, symlinks is probably the best solution as I run linux only. Good one - thanks a lot!

1 Like