I was wondering whether there's a mechanism to sync two external hard drives, so that the files are updated both ways (and they end up containing the exact same information).
Ideally it could run when once both hard drives are connected.
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
I would advise Unison (unison-gtk )
This is a graphical sync program, and can be installed via the Software Centre, but the easiest way to install is via the terminal:
sudo apt-get install unison unison-gtk
Then it will be in the dash, search for unison. You can create profiles and such like to sync locally between USBs and remotely via SSH.
The best thing is the GUI, it is easy to use because you can see exactly what you want - no messing around with the command line with
If you want it auto, you do need to use the command line -
cron. Have a look here for how to use it and below is an example:
30 17 * * * unison PROFILENAME
That will run at 5:30pm every day. Make sure the profile that you create is 1 word only, and that you remember it.
You can do it easily with rsync (for synchronizing) and cron (for scheduling regular calls of rsync).
To just synchronize:
rsync -rtvu --delete source_folder/ destination_folder/
To schedule cron:
sudo crontab -e # For example, you can run a sync # at 5 a.m every week with: 0 5 * * 1 rsync -rtvu --delete source_folder/ destination_folder/
These commands are really fundamental and usual in Linux; you can learn much more about them by searching the web.
Edit: sorry, rsync command works one way only.
maybe for beginners conduit would be interesting and very easy to handle with it's GUI... but it isn't developed anymore (like Unison)!