Create a Central Repository
Create a folder on a large hard drive or raid your main computer/server
On the repository machine install Unison
On the local machine connect via SSH and test that the install went ok
You should see something like, “unison version 2.27.57“.
Create a file in your repository directory:
Install Unison on the Local Machine
For a Debian based system do:
Make a folder in your home directory or wherever you want:
Then run Unison:
Note the double slash after the hostname. This is used to indicate an absolute path
You will be greeted with a message saying that this is the first time it has detected changes go ahead and hit the space bar.
Press y to confirm the “conflict” and transfer the files. This should only happen the first time you setup a new directory.
Create a inhouseDropbox.prf file and stick it in ‘/home/youruser/.unison‘.
If should look something like:
root = /home/youruser/inhouseDropbox root = ssh://youruser@yourhost//media/drobo/inhouseDropbox force = newer times = true batch = true
Now we have automated preferences and just need to get rid of the password prompt for SSH. The most common method of this is making a key file.
Making a key
On the local machine do ssh-keygen.
Then scp the .pub file and append it to ~/.ssh/authorized_keys file on the remote computer.
If you need additional help on how to make SSH keys see, Setting Up SSH Keys
Running Unison by hand doesn’t do us much good. Let’s make Cron run it every two minutes or so.
Then add the following line:
Then save the file.
To test it go ahead and drop another file in the folder and wait a few minutes. The changes should propagate to the central repository.
To see if cron is running the job.
You can also append, >> /home/youruser/log.txt 2>&1 instead of > /dev/null to output all errors and regular messages to a log file in your home directory.
Was this information useful?
Please tell us why you didn't find this useful. Thanks!
Thanks! Your feedback will help NixTutor improve.