6

I want to set up a personal (i.e. one user) Dropbox alternative using rsync, to keep some directories synchronized over several Unix hosts.

Since only one user (namely, me) will be changing the content of any one host at a time, it is safe to assume that these changes will not overlap in time. This means that

  1. a lag of 10-15 minutes between modification and synchronization is acceptable;
  2. modification time should be a reasonably good proxy for "current version".

All the rsync schemes I've come across for keeping multiple servers in synch work on a once-a-day synchronization schedule, for backup, say. Also, in these schemes typicall one host is the master, and the remaining ones mirror it, whereas in the situation I have in mind changes can occur in any one of the hosts.

Can someone point me to a tool or how-to on setting up rsync + ssh to do this sort of thing?

7

Why don't you try unison? I am not sure, what operating systems you are using exactly, but unison will do the job. The syntax is pretty simple, although you can expand it with many options:

~$ unison /path/to/dir1 /path/to/dir2

Here you can find all the needed information.

  • 1
    Unison web page – X Tian Oct 22 '15 at 17:53
  • Thanks! The main reason for wanting to stick with plain rsync+ssh is that I don't have root permissions on some of the hosts I need to keep in sync. (I suppose I could try to install unison off my home directory for those cases...) – kjo Oct 22 '15 at 17:57
  • 1
    You can work with unison with different strategies. I personally would suggest to use a host you have root access to as your control server, where unison runs and you sync the remote hosts from it. Again this depends on your infrastructure. – Thorian Oct 22 '15 at 18:05
4

I can recommend using syncthing for that. My only gripe with it is that it sometimes blows up CPU usage, but you can control that via its thorough config. It's really fast, though not as fast as rsync+ssh.

Let us know how it works out for you, what you'll be doing in the end, because even while I'm currently using syncthing quite successfully for a similar (to your) use-case scenario, I'm still not sure I've made the right choice.

2

You can use rsync over ssh. It will need to be run in both directions if there were changes made on both machines:

rsync -uavzhe ssh /home/dir/* user@example.com:/home/dir

rsync -uavzhe ssh user@example.com:/home/dir/* /home/dir

0

Couchdrop.io/Rsync

Couchdrop works with Dropbox, Box, GoogleDrive, Amazon etc. and allows you to Rsync and SCP your files directly to them without installing additional software or packages.

Basically just need to rsync -a -e ssh filename username@rsync.couchdrop.io:

This could assist you?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.