usage question / bind-mounts and same folder twice

Hi all,

I have a question regarding a usage scenario of Syncthing which is in my head since some time:

  • 3 Nodes
  • Node 1 holds a full set of files
  • Node 2 holds a full set of files say at mountpoint /mnt/full
  • Node 2 holds the same folder bind-mounted ro to /mnt/reduced
  • /mnt/reduced contains a .stignore file with a include excluding a part of the files
  • Syncthing on Node 2 Shares bothe folders, once as send/receive and another time as send only
  • Node 1 Shares the full folder with Node 2
  • Node 3 shares the reduced folder as receive only with Node 2

Would this work or are there any problems I have’nt noticed so far?

Background Node 3 (and 4 and 5…) are mobile devices and I don’t want to config .stignore files here.

Best regards Imk82

In theory it should work, but there are some corner cases hence we don’t recomment it. For example your own changes in one mount might end up looking like conflicts in the other mount, etc.

Why don’t you just ignore the files on the same folder on node 3 and be done with it?

Hi,

the thought behind it is to keep maintenance of my “infrastructue” as simple as possible. And on Node 3 (4,5…) I have to configure the ignores manually in a android app for every folder while on the other nodes there runs a full linux server where configs can be provided e.g. via a git or something else.

What do you mean with “my own changes” forcing sync conflicts?

Best regards Robert

Both folders start downloading the same file in the same location, potentially tramping each other.

But the reduced folder ist mounted ro and set to send only. So there cannot start any second download, or am I wrong?

1 Like

Yeah maybe, idk. Try it and see what happens.

Hi all,

two other corresponding questions:

  • will a ingnore pattern increase the computing demand on the ignoring machine?
  • will patterns like this work (ignore all but jpeg,jpg,JPEG,JPG):

(?d)*

!(?d)(?i).jpg

Best regards Robert

Combining ! and (?d) is useless, but I think it won’t hurt either. Combining (?d) with * is possible, but scary. If my thinking is correct (and I don’t give any guarantee on it) it shouldn’t have any effect, as everything is ignored, but semantically what this says to Syncthing is “ignore everything and also delete everything at your leisure”. What Syncthing does is, that it will only delete ignored items if the (not ignored) parent directory is deleted on a connected remote. So again I believe (?d) will not have any effect in this case, but I highly recommend to not use it.

Slightly (every processed item is matched against all patterns until a match), but a uninformed gut feeling says it’s practically irrelevant.

Also you should put more specific rules above general ones, your first rule says to ignore everything -> Syncthing is done. While you want it to check against the include pattern and if that doesn’t match apply the general one.

Nothing is free. Ignore matching did have a significant impact on low powered devices up to the point where it made sense to cache the result of the previous check on rpi’s. We moved to a new lib for matching since then, which is a lot faster albeit still not free.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.