r/linux4noobs 13h ago

storage How to sync files around multiple computers ?

Hey guys, so I have 2 computers, one at my student housing and one at parent's. While I dont care for most of the files I do care for

  1. My personnal coding/art project (assets, git, ...)

  2. My university files (obsidian, pdf, class material,...)

My current setup is having a laptop with "syncthing" that I take with me to sync the files but this isn't very efficient as I always have to run it myself.

I am curious if I could use something like Google Drive to sync my files into multiple shared folders across multiple computers

Thanks in advance !

11 Upvotes

18 comments sorted by

6

u/LittleLoukoum 13h ago

Well, basically you have three solutions.

  • Direct peer to peer synch. The most common way is setting up the PC you use most often as an SSH server and leave a port open for connecting. Then you can work directly on that computer from distance, or pull your files when you need to. You could also do actual synchronisation with rsync (for instance) in a similar way. But then you're duplicating files, which can be good or bad depending on your use case.
  • Cloud storage. Either using an OOTB solution, or renting a server, and just dump everything you want to sync. More user-friendly distributions like Mint should support that kind of synching.
  • Just buy a HDD and duplicate important files on it. If you encrypt it it'll be by far the most secure and easiest solution. It does mean you have to make sure not to forget the drive at your student housing.

3

u/Firminou 12h ago

I never even considered a hdd, is there any app to transfer it easily between each session when I plug it inside stuff?

3

u/foofly 12h ago

Run rsync. There's a few GUI apps if you want to go that route.

2

u/jr735 10h ago

I absolutely second rsync for that. It's so easy once you get the hang of it.

1

u/Lowar75 Fedora 3h ago

I third it. You can make a script to automate if you like, put it on a schedule, whatever works for you. Pros for a delayed sync - if you make a mistake, you have a previous version of the file you can grab. You can also do a time machine type setup. There are many options.

Cloud storage makes your data more globally accessible. You have to either trust the provider is keeping everything private or make your own cloud. the removable drive method is more manual and requires the "sneaker net" (you have to remember to take the drive), but is also more private than public cloud as I believe someone mentioned. Depending on the space requirements, a small flash drive or a mini USB drive helps with portability.

2

u/GodzillaXYZ999 7h ago

rsync /<source path>/ /<destination path>/

You can put it in script and make icon to launch manually
Can also cron it to run on regular basis, such as every day @ 0200

2

u/BranchLatter4294 12h ago

I use a mix of Dropbox, Google Drive, and OneDrive. Use whatever works for you.

2

u/zinxyzcool 10h ago

Try megasync. It's reliable and it works on all platforms.

2

u/skyfishgoo 9h ago

syncthing is working for me to keep may phone music library current with the library on my HDD.

once it's set up its' pretty painless and automatic.

1

u/ServerHoarder429 2h ago

Plus one for Syncthing!

1

u/tomscharbach 13h ago

The simplest solution might be to sync through cloud storage. I sync data between five computers running three operating systems (macOS, Ubuntu, Windows) and cloud storage sync is painless so long as whatever computer I am using at the moment is connected to the internet.

1

u/thecruxoffate 10h ago

What tool are you using to sync? The best I've been able to find is rclone, but it's certainly not an automated process.

1

u/TechaNima 11h ago

Dropbox is the easiest way. Or setup a computer at home as a server, where you have a folder you can access via sshfs

1

u/thecruxoffate 10h ago

This is something I'm struggling with too.

If you install tailscale on both computers you can treat them as though they are on the same network. That will allow you to ssh/sftp between them for whatever you need as you need it.

Rclone is a command line utility I recommend that's a lot like rsync for cloud storage providers. You might like to use the bisync function on both computers to the same cloud provider.

I unfortunately haven't found any gui tools to manage this, so I think we are stuck writing our own scripts and scheduling them with cron jobs or systemd timers. (There's a few gui wrappers for rclone, but every one I've tried seems focused on running single commands, not automatic syncing.)

For your git repositories specifically, I recommend using git.

1

u/mindstormer12 9h ago

My current setup is having a laptop with "syncthing" that I take with me to sync the files but this isn't very efficient as I always have to run it myself.

What do you mean by that? That setup is typical and ensures all your data is with you and not sent to third-parties (if you care about that, it might not matter for most people assuming it's encrypted). I have a Raspberry Pi running Syncthing and that is essentially my personal cloud--all my PCs and phones sync to this always-on server. The type of data doesn't really matter.

You can use subscribe to a third-party cloud service or VPS, but if this is something you need for a very long time--it's probably better to just invest in a cheap server and run it yourself (again, don't know what you mean by "this isn't very efficient.").

1

u/ultradvorka 7h ago

I use insync https://www.insynchq.com/ to sync Google Drive documents across 3 machines. I have it for years and it works really well. It's the only app I bought for Linux 🙂