What if I create 2 identical directory structures with files and delete a single file in one, THEN bring sync on line on both ends. How does SyncThing det’n to propagate the file to both, or delete it on both?
I don’t think the OS keeps track of when deletions happen, so how does SyncThing decide which is more recent - the deletion or the file add ? In the man pages, descriptions under “Syncing” don’t address the delete issue, unless (am I getting this right?) that when the “global version” goes to nothing, then a deletion is what each device strives to update to? That still doesn’t answer the question of what happens when two directories are ab-inito different, or how a “deletion” becomes the target.
My ~real~ question is that I want to do a fuse mount on top of an existing directory; it could be on or off when SyncThing runs. This is similar to mounting a USB drive on top of an existing directory. "almost" lost all files in my distributed pc network after usb disk umount
The threat is that when the device is unmounted, the underlying empty directory is sync’d to all peers. Ouch! Lots of data deletion! I’ve read the debate in the prior post. IMHO, the MOST important thing is SyncThing MAY NOT silently delete all my files on all my peer systems. To say, “User should know what he’s doing and not unplug the USB” is really scary to me.
Syncthing tries to protect help this issue with the .stfolder file (if it’s missing assume a dismount and do not propagate this as deletions to the rest of the peers). Okay, but that invalidates using a USB mount or fuse mount on any subdirectory in the sync.
Are you aware of how Unison does this? Maybe this should be implemented. There is a “usbmount” directive that can be associated with any path. How about implementing a SyncThing option “-transientmount=”, where can be “./” or “./anysubdirectory”? Then, the sync program checks the mount table to be sure there IS a mount at that location before it does anything with that directory. Sounds easy conceptually, but I’m not sure what it would take to program. If this issue is the only reason you use the .stfolder, then the entire .stfolder logic thread can be deleted from SyncThing.
My real goal here is to use encfs (with the --reverse parameter) and sync peer-2-peer encrypted directories that are really virtual mounts switched on and off with encfs. The real data is stored clear text on the computer and the sync directory is really an empty mount point for encfs to show the encrypted version of the files.