MainPC, Linux Ubuntu 20.04
RemotePC, Linux: Ubuntu 20.04
I’m fairly familiar with SyncThing, it’s one of my favorite projects in a while. I have multiple computers, and Android devices that have different syncs. One thing I haven’t played with much is how SyncThing will handle External HDD’s (USB). I have a plan to set this up between two computers, but I’m afraid that things might go south if the drive gets pulled.
Here’s my dilemma.
MainPC syncs files to RemotePC’s external USB HDD. What happens when the USB HDD gets pulled from RemotePC? From my searches, it sounds like if “.stfolders” is missing, then SyncThing stops… but if the USB Device plugs back in, does everything start back up from where it left off? If there’s some configurations that I need to make sure that it doesn’t just create a new “.stfolder” and start syncing everything over to the mountpoint of the USB HDD (/media/user/driveName), could you please include those.
I could test this setup, but the computers are 1000 miles away, so I can’t afford to blow up the data.
Based on the description of your setup, it’ll be fine.
The “.stfolder” marker folder is created only when a directory is added to Syncthing, and as you correctly understood, Syncthing automatically pauses the sync whenever the USB drive is unmounted.
My setup is similar to yours but instead of USB drives I’ve got multiple drives in a custom NAS that aren’t auto-mounted at boot time so the mount point /srv/Syncthing is empty until I manually run a shell script to restore the mounts and restart Syncthing.
One possible addition to handle it as clean as possible: When Syncthing is still accessing files, it may require a forced unmount of the HDD. To avoid that, you could manually pause the folder in Syncthing before trying to unmount. Then manually resume it either before or after you plug the drive back in.
Thanks for the help/info.
Of the couple threads that I read here, it seemed that they were closed without closure. After taking input from the responses, this is what I ended up with.
MainPC - Setup folder for pictures ingest. Folder is set to “Send Only”. Not sure what versioning I want. Running SyncThing in Docker, using the LinuxServer.io image.
RemotePC1 - Setup folder to stay synchronized with MainPC, receive only, Trashcan versioning, 180 days. Internal drive/folder. Desktop install of SyncThing.
RemotePC2 - Setup USB drive with a folder to be receive only, same Trashcan versioning, 180 days. SyncThing Docker image.
I don’t intend to remove the USB drive very often, worst case would be a power outage, or occasional reboots. I’m open to suggestions, and will attempt to answer any questions if my description above needs clarification, at least before it’s autolocked…
Please be aware that versioning does nothing on a Send Only folder. The reason is that only files modified or deleted on remote devices are versioned, however if the folder is set to Send Only, it doesn’t accept any remote changes, hence there is nothing to version.
Good to know. I was actually wondering about that.