Syncproblem: Several Windows<>Android

Hello dear community,

I am new to Syncthing, Synthing-Fork and to this forum. So I say at first HELLO to all :waving_hand: .

If I am doing something wrong here, please tell me friendly :slight_smile: .

For two days now I googled in this forum, in the whole Google and documentations but still successless…

I freshly & successfully installed Syncthing, Syncthing Tray on 2 Windows devices and Syncthing-Fork on 1 Android. device (and will install on 2. Android device) So, they all should be the newest stable version.

Windows: Two devices (Desktop, Windows 10 & Surface Go 2, Windows 11). The synchronisation (the whole directory “Card”, syncing both directions) between these both works really fantastic!

Tablet with Android 11. Smartphone with Android 9.

But with the Android I cannot get it to work.

This is what I want to reach (only two examples, I have several of this kind):

Desktop Windows: Folder “My papers” (and several others in same parent directory “Card”).

Surface Windows >sync fully with all subfolders .

Tablet & Smartphone, both Android >no sync.

Desktop Windows: Folder “Obsidian Notes” (in the same parent directory “Card”)

Surface Windows >sync fully with all subfolders

Tablet, Android >sync with most subfolders, but excluding some specific subfolders (“Desktop”, “Mobile”, “.trash”,…)

Smartphone, Android >sync with most subfolders, but excluding some other specific subfolders (“Desktop”, “Tablet”, “.trash”,…)

What I reached until now:

Either a few seconds “84” Items failed", but then it said “everything successful”- but the files where still not in Android.

Or no error not at all. Sometimes I could even see the name of the files syncronizing, but still not existing in the filemanagement in Android.

Sometimes it syncronized some folders, but the wrong ones.

So I tried so many exclude & include codes. I haven’t been sure, if the exluding code should mention the Android path or the window path, but well, I tried all. At least, I think, all.

I don’t know anymore what else I can do. Please help. Thanks a lot!

I hope you understand my writing… If not, please ask…

Any help is much appreciated! Lilly

I painted something -hopefully I can make it more clear this way…

The bigger darker horizontal pieces mean the parent folders (the “card” is the parent-parent).

And the smaller vertical pieces mean the subfolders & sub-subfolders. From them on tablet & smartphone are only some of them.

All the syncronizing on all devices should be bi-directional, but every device with every device. I mean, if I edit something in folder “Tablet” on my Tablet, then it should be synced with folder “Tablet” on the Surface & with the folder “Tablet” on Desktop. And for all the others too.

Still hoping, that someone could help me…

Now again- after several deleting folders, deleting devices, adding devices, adding folders and back and forward and back and forward…, I managed it to sync at least little bit partly. But still the same problem. I don’t know how to setup the system or is it just to make it via exclude patterns? So I tried with ecxlude patterns, but Android builds the paths different than Windows (/ versus \ f.e.). So it is for hours and hours just try and error. I do not understand the documentation, reading it over and over.

So, what I managed now- only trying the syncing with only one folder:

Having the path D:\Dokumente\Obsidian-Notizen\Vorlagen (but there are other folders alos called “Vorlagen”, which I don’t want to sync).

I tried the pattern !\Obsidian-Notizen\Vorlagenand \Dokumente\Obsidian-Notizen\Vorlagen. I did not try !\Vorlagen, because before it then also synced all other folders “Vorlagen”.

This was all successless. Then I tried the same patterns with the other slash:

!/Obsidian-Notizen/Vorlagen >This was successful.

But now I have the folder structure on Android like this:

/storage/emulated/0/Documents/Obsidian-Notizen/Obsidian-Notizen/Vorlagen

but it should be /storage/emulated/0/Documents/Obsidian-Notizen/Vorlagen

Maybe you think, this is a stupid question, so I am sorry for that. But please help.

Can you post screenshots of the problematic folder in the web GUI from all devices? On Android, you can access the web GUI from the left slide-out menu.

This likely doesn’t matter in this specific issue, but can you list the specific version numbers? Especially on Android, you need to install the Syncthing-Fork app either from F-Droid or directly from GitHub, because the Play Store version is outdated.

Thankyou for your reply- I am happy to get a reply !! :+1: :grinning_face:

Oh, I installed Syncthing-Fork from the PlayStore…

So from the Desktop-Web-GUI:

For the others I need short time, to login here, make screenshot, and so on. And on the tablet I just removed again the folder & device and need to add it again… So, just a little time…

From the Surface-Web-GUI:

And from the Android-Web-GUI:

I installed now the fork from F-Droid and the Android-screenshot is already over the F-Droid-Syncthing-Fork.

I also made the same configuration as before (the exclude pattern !/Obsidian-Notizen/Vorlagen) . The result is the same: The path is now: /storage/emulated/0/Documents/Obsidian-Notizen/Obsidian-Notizen/Vorlagen.

When accepting the folder on Android for the first time, you need to make sure that the path is set to just /storage/emulated/0/Documents (and not /storage/emulated/0/Documents/Obsidian-Notizen). Not sure how what the app shows in the “Add Folder” dialog, but could you try to use the web GUI to add it?

Basically, remove the folder from Syncthing first, then disconnect and reconnect the devices to trigger a new “Add Folder” pop-up, then use the web GUI to add the folder under /storage/emulated/0/Documents.

I will try that again.

But I did it already like this and then I had all other unwanted folders also inside. But no problem, I’ll try again… Maybe I have been unconcentrated in all my attempts… step by step I will reach the goal

If you want to ignore all other folders and sync only /Obsidian-Notizen, then you can add the following to the ignore patterns while adding the folder for the first time:

!/Obsidian-Notizen
/

The first line tells Syncthing not to ignore the specific path, the second line tells it to ignore everything (else) in the root path.

Yes, this I also did already. But much more consisting of small parts. Because this “Obsidian-Notizen” has a lot of subfolders & subsubfolders. So for my attempts I wanted to start with a small folder with only 1 subfolder & only few files. Just to learn how Syncthing works. This is why I wrote the exclude-pattern !/Obsidian-Notizen/Vorlagen.

What I couldn’t find out by googling- only by try & error, but still not sure if it is correct: Which kind of backslashes I need (/or \) and where the foldername should begin, because of the differences between Android and Windows. I mean the paths are the same at the end, but the beginning is different on Android (/storage/emulated/0/Documents/Obsidian-Notizen/...) versus on Windows (D:\Dokumente\Obsidian-Notizen\…).

Windows uses backslashes, but when it comes to Syncthing, you can use forward slashes everywhere and it will work just fine. Especially in ignore patterns, if you want them to be system-agnostic, you should stick to forward slashes only.

Oh, I saw now, that your second line in the exclude pattern is “/”, while I had “*”. Maybe this is the difference…

/ and * will do the same thing, i.e. ignore everything starting from the root path.

Windows uses backslashes, but when it comes to Syncthing, you can use forward slashes everywhere and it will work just fine. Especially in ignore patterns, if you want them to be system-agnostic, you should stick to forward slashes only.

Ah!! This is very very good to know! Thanks!

/ and * will do the same thing, i.e. ignore everything starting from the root path.

Achso, ok…

Sorry, that I didn’t answer anymore yesterday.

I wanted to answer, but wasn’t allowed anymore, because of being new in this forum.

Experimenting the whole rest until midnight, I found out now the secret :grinning_face: :

The secret is a forward slash at the beginning, just after the “!” =“!/” and a forward slash at the end. Like in this example:!/Obsidian-Notizen/Vorlagen/

Now, it is working like expected, at least in this example and some similar. But guess, it should work now also with everything else.

Big thanks to @tomasz86 for your help :+1: !

What I am not sure about:

I do not only want all this working bi-directional, but in all directions. So, it doesn’t matter where a I edit or create a file >it should be syncronized to all other devices, if it is in the configuration of syncronization.

For that: Is it enough to add all devices to all devices or do I need to do that also with the folders?

But if I need to add all folders, how do I do that, because I have these different wishes for the different devices (Desktop & Surface have all files, but Smartphone only some and tablet only some others)?

Or is this another topic?

Devices being connected to each other is “just” a precondition. For synchronization to happen for a certain folder, it must be shared between the devices you want for that particular folder.

For a certain folder, if you want each device to have a different subset of files, you must configure ignore rules unique to each device.

Since ignore rules are defined in files within the folder, they must be configured per folder as well.

But there is also a trick which might come in handy, depending on your need. The “.stignore” file is not shared between devices, as you know nu now. Say you have the devices which share a certain folder. Two of them only need a certain identical subset of the files. Then you can create the ignore rules in another file and then use “#include thecustomignorefile” in “.stignore”.

Hope that answered your questions. Have a nice weekend!

Hello @Martin,

yes, I have already these ignore rules unique for the tablet and unique for the smartphone. Like this:

On the Tablet:

!/Obsidian-Notizen/.obsidian/
!/Obsidian-Notizen/.trash Tablet/
!/Obsidian-Notizen/ALLES NEU HIER!/
!/Obsidian-Notizen/\Handy+Tablet/
!/Obsidian-Notizen/\Obsidian-Intern/
!/Obsidian-Notizen/Tablet/
!/Obsidian-Notizen/Vorlagen/

On the Smartphone:

!/Obsidian-Notizen/.obsidian/
!/Obsidian-Notizen/.trash Handy/
!/Obsidian-Notizen/ALLES NEU HIER!/
!/Obsidian-Notizen/Handy/
!/Obsidian-Notizen/Handy+Tablet/
!/Obsidian-Notizen/Vorlagen/

The folder for both comes from the Surface, with the path D:\Dokumente\Obsidian-Notizen\… (and all the subfolders).

And the Surface gets it from the Desktop, with the path A:\1) Dokumente\Obsidian-Notizen\… (and all the subfolders).

In the moment it is like this, explained with the example of the “Handy+Tablet”-folder. This folder is shared like this:

Desktop <>Surface, Surface<>Smartphone, Surface<>Tablet.

But it should be like this:

Desktop<>Surface, Desktop<>Smartphone, Desktop<>Tablet, Surface<>Handy, Surface<>Tablet, Smartphone<>Tablet. Don’t know, if I forgot one… :wink:

I could just try in the kind of “try and error”, but I fear that it will then get completely chaotic, when I do anything wrong.

In my words, I THINK you are wondering about which devices should sync with which. As long as you don’t have a huge number of devices, I recommend that all devices sync with all devices in a mesh. If you do have a huge number of devices that becomes burdensome, in which case I recommend using one or two central devices as “hubs” and the rest just sync with them.