Ignore files with UUID naming format

Hi everyone,

I’m having an issue and I hope you could give me some light of how to handle it.

I’m running Syncthing 2.1.0 on computers running Windows 11 and it is working properly. The issue is that some folders that I sync have files with the name like this:

.A1B2C3D4-E5F7-G8H9-I0J1-K2L3M4N5O6P7

It starts with a “dot” and has a UUID like format. I want to ignore these files, but none of the ignore patterns I tried is working. As an example, the directory I want to sync is (my “root” for Syncthing):

C:\User\UserName\

But, I don’t want all the directories within it, so I set the directories I want to sync in .stignore file:

!/Documents
!/Music
!/Videos
!/Downloads

But, in the folder below, there is this document:

C:\User\UserName\Documents\.A1B2C3D4-E5F7-G8H9-I0J1-K2L3M4N5O6P7

So, I tried in .stignore the following:

// move these ones:
!\Documents
!\Music
!\Videos
!\Downloads

//ignore these ones:
/Documents/.????????-????-?????????-????????????
/Documents/.A1B2C3D4-E5F7-G8H9-I0J1-K2L3M4N5O6P7
\Documents\.????????-????-?????????-????????????
\Documents\.A1B2C3D4-E5F7-G8H9-I0J1-K2L3M4N5O6P7
.A1B2C3D4-E5F7-G8H9-I0J1-K2L3M4N5O6P7
.????????-????-?????????-????????????

The same ignore pattern is configured in all computers that synchronize the same “root” directory.

None of these attempts worked, the application still tries to synchronize these files and present errors since the file is being used or conflicts regarding file version.

Initially I ignored these files, but now it is making harder to analyze errors.

I hope anyone knows how to filter it properly.

Ignore patterns are first-match-wins. Your first pattern says to not ignore anything under documents, so that’s what happens. Move the general .????????-????-?????????-???????????? to the top to ignore it everywhere.

Thank you for your reply.

I tried it as shown below and it worked:

// ignore UUID files:
(?d)/Documents/.????????-????-?????????-????????????

// move these ones:
!\Documents
!\Music
!\Videos
!\Downloads

// ignore the rest:
.*-*
.*
*

But one thing I didn’t understand very well is the sequence it should follow. I thought that the ignored files should always go at the end, like the “ignore the rest” part shown above.

Based on this example, if I will ignore directories and files within directories that I will synchronize (i.e. inside \Documents) these files should always be placed before the directory?

It’s very similar in one respect to how firewall rules usually work.

The first match is acted upon, and the rest of the Ignore Patterns aren’t processed.

So as you are seeing, you can get very different results based on the order of the rules. This allows for a lot of flexibility, depending on your desired outcomes.