External storage shared between devices

I wanted to run my setup by some more experienced users to check if I’m mis-using Syncthing. Reason being, I’m suffering a lot of conflicts that I don’t think I should be getting.

I have a USB drive that has all my personal files in it. I work on 2-3 different computers and I prefer to work this way, carrying my files with me, rather than storing them locally on a machine (I have reasons but they don’t matter for this).

I also want these files synced to my phone as I sometimes need to work on them there.

I set up Syncthing on all PCs and the phone so that it’s always syncing the USB drive to my phone no matter which PC I’m using. I’m essentially trying to keep the USB drive in sync with my phone.

Since the PCs are “sharing” the USB drive, when I bring the it from PC 1 to PC 2, there should be nothing for PC 2 to do because everything’s already been synced to my phone by PC 1.

However, in reality, when I shut down PC 1, power up PC 2 and insert the USB drive, Syncthing pops up with a conflict for every file that was modified during my last session on PC 1. The “original” file seems to always be the correct option to pick, rather than the one marked “conflict” (if that matters).

Before I take this debugging any further, can anyone can confirm my situation should be supported? i.e., using multiple PCs to keep a USB drive in sync with a phone?

The PCs are Windows 10, but one is Ubuntu 22.10. But that doesn’t seem to matter - it happens even if I don’t go near the Ubuntu machine that day.

Thanks a lot for any help!

You’re misusing Syncthing. You can make this work, but you need to keep the Syncthing database & config on the same USB disk, effectively making it one instance that you move around to different hosts.

Thanks a lot!

I just tried to understand the page in the docs about the --config flag. In Windows, in the options in SyncTrayzor, under the Advanced Syncthing settings, I see “Command-line Flags”, “Custom Path” and “Custom Home Path”. If I understand correctly, I should configure one of these options (not sure which yet) to keep the DB and config on my USB drive, and do this on every Windows computer.

Then, in Ubuntu, I think I can achieve the same thing with the --config flag.

And hopefully all PCs will now be using the same DB / config on the USB drive and everything will be fine? Would that be the idea?

Something like that, yes, probably --home is the one. You’ll also have to tweak your config so that it works on all systems, particularly the path to the folder. Probably the way to do that is to make it relative to the USB disk root and make sure to launch Syncthing from there, or you can have separate but equivalent configs that you point to with --config… Also, you might need options to ignore permissions and timestamps as those (apparently) will differ from system to system. All in all, it’s not trivial.

Thanks, I’ll give it a shot.

Thinking of my more trivial options…

  1. I could designate one PC to sync the USB drive to the phone, and make sure I regularly spin up that PC to keep things synced up (probably the laptop).
  2. I could allow each PC to locally store its own copy of all these personal files, and the phone would be the middleman to keep them in sync as there’s usually only one PC on at a time. Then I’d need to use something else like rsync to keep the USB drive up-to-date whenever I shut down a PC.
  3. I could use some other tool (not Syncthing) to do a local sync of the pen drive on the phone itself, if I use a USB-C adaptor. There might be an rsync kinda thing on Android. Then I could continue working off the USB drive on all the PCs.

Not sure which is easiest yet, perhaps the first one. Let me know if I’m missing any obvious options.

Otherwise, thanks a lot again for your time =)

There are a few rsync clients available for Android, but given your use case – no servers and no always on devices except probably your phone – Primitive FTPd for Android might be a better fit.

If your phone is readily available on the same network as your 3 computers, you could configure a FTP/SFTP client (e.g., FileZilla is available for Linux and Windows) on each computer to bulk mirror files and directories from your USB drive to/from your phone.

1 Like

Just a quick tip, you can use forward slashes / in your relative paths inside Syncthing to make them work cross-platform. Interestingly enough, Syncthing on Windows will accept both \ and / as path separators, but the backslash \ won’t be accepted on other operating systems.

I would like to set up syncthing to do what you are describing. I’d like to sync files from my iMac to the SSD. Then also share the SSD with a MacBookPro (or I could set up a separate sync with the MBP). How do I set up the sync between iMac and portable SSD? I don’t see guidance for how to do this.

Syncthing is a tool which synchronizes directories between computers/phones etc.

It is NOT designed to sync between different directories on the same computer/phone etc. I’d use Unison for that purpose.

Can’t the files just live on the SSD the entire time, i.e., do they really need copied to those devices in order to work with them? That was my use case. The only tricky part in my case was getting the files synced to a phone.

I’d primarily like to to use the SSD as a file back up for my iMac.

From several Syncthing Forum threads it sounded like I might be able to use syncthing for file backup & synchronization. I appreciate the suggestion to use Unison, but it looks like Unison may only be available for Linux and not MacOS. Any suggestions for MacOS? I’m not looking for the full system backup that Mac Time Machine does; I just want to synchronize files from my iMac to an SSD. I haven’t found anything that works like syncthing…

No worries, Unison has always supported Linux, macOS and Windows: https://github.com/bcpierce00/unison/releases

In addition to Unison, also check out the following related options:

Apple bundles rsync with macOS, so there’s no extra software to install unless you’re interested in GUI wrappers, automation, etc.:

Although Syncthing can be configured to mimic a very basic backup program via its file versioning feature, any setup that isn’t two or more machines running Syncthing requires potentially tricky configuration and usage – e.g., as others have already mentioned, you’d need to run two instances of Syncthing on your iMac (in order to simulate two machines) to sync files to your SSD.

Thank you for the recommendations - really appreciate it. I’ll check them out. I want to keep it simple, so no need to try to use Syncthing for this.

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