Configuring Syncthing for external USB drive

Hi.

I want to synchronize folders between my two PCs Alice and Bob. However, the folder on Alice are not stored on Alice’s internal HDD but on a external USB drive connected to Alice.

I’ve read several reports here and elsewhere, that when disconnecting the USB drive from Alice, the files on Bob get deleted (because Syncthing doesn’t find the .stfolder file on Alice anymore).

However, I could find no good tutorial how I have to set up Syncthing to prevent this behavior.

Maybe one of you has a link to a tutorial or some ideas how I could deal with this problem?

Both Computers running Ubuntu 18.04 with Syncthing 1.3.4. The USB hard drive on Alice is mounted under: /media/user/hddname

Thanks for your help!

Vincent

1 Like

I am not sure what you’ve read, but exactly the opposite happens. If .stfolder is missing, it assumes a missing mount and just stops the folder. If that file is there, but the rest of the files are gone, then it identifies it as a deletion and deletes stuff everywhere.

1 Like

Thanks for the clarification. I guess, I misunderstood something.

By the way: Thanks a lot for your great work!!! I am using Syncthing for several months now, and it works really fantastic.

3 Likes

If you wanted to be very conservative, you could write a script or systemd unit file which shuts down Syncthing (or just stops relevant folders) before unmounting the drive.

1 Like