by codeflo · 5y ago · 0 comments
I wanted to sync my personal files between three computers, two desktops and a notebook, which don't always see each other. At first, this worked great. Obviously, there were conflicts when I accidentally edited something in two places without syncing up. What I didn't figure out was how to permanently resolve those. I ran into endless cycles were I had a conflict between two systems, resolved that, but the third one hadn't seen the conflict resolution, which produced another conflict, which I resolved, which the first system hadn't seen yet, ad infinitum. At least, that's what it looked like. Among other errors, files long since deleted on all systems would still show up as conflicts.
To be fair, I didn't actually lose any data, and it's very possible I did something wrong that would be obvious to other people. But to me, it wasn't at all clear what and why, which scared me enough to move away from this setup. I don't want to take a lot of chances with my data.
So if you have 3 machines that you need to sync, designate one as a hub which syncs with the other two, and the other two do not see each other. If you absolutely need to transfer data between two others as well, set up another completely independent share between them (a different directory on both machines).
I am not sure but fully automated replication setup with cycles might be impossible due to https://en.wikipedia.org/wiki/CAP_theorem.
(Addendum: I think actually what is needed is even stronger - you should make sure before editing files that the designated "central hub" node is available and has been synced.)
SyncThing is very handy, but not something I’d use as a backup solution.
Can you explain further?
I imagine what happened is that this was somehow related to the fact that the PC and Mac have case-insensitive file systems, and the Linux machine does not. Somehow one of these machines renamed the folder (I have no idea how this could have happened). I would hazard to guess that SyncThing on one of the nodes (probably Linux) decided it needed to delete the "backgrounds" folder because it no longer existed, and then sync the new "Backgrounds" folder. If deleting the "backgrounds" folder was synchronized back to the PC or Mac though, they would have also deleted the "Backgrounds" folder, since in case-insensitive-land, they're the same folder.
I went digging through their github at the time to see if there was an issue about case sensitivity and didn't find anything that was relevant and open. I didn't have a lot to go on, and my attempts to recreate it failed at the time, so I didn't bother opening an issue. It's entirely possible my specific issue is fixed by now.
It seems like synchronization is the next logic step and I could really use feedback and testing from interested users. The application is available at https://github.com/prettydiff/share-file-systems
I would love for syncing to occur upon changes in real time as opposed to timed intervals like a cron job.