Please help us improve HowtoForge and take our survey:
Keeping Your Sanity with Unison
|
Version 1.0
Author: Joe Topjian <joe [at] adminspotting [dot] net> I hate it when I have two identical scripts on two servers and have to make changes to each one or when I want to copy something to my powerbook and have to manually copy the modified version back to the fileserver when I am done. While other versioning tools like subversion handle this extremely well, they are overkill for my needs. Unison gives me the simplicity to do exactly what I want with no hassle. Hence, it keeps my sanity! Unison runs on Unix, Windows, and MacOS X. Personally, I use it on Debian and OS X. To install on Debian, just type: apt-get install unison
On OS X, I use DarwinPorts and install it like so: sudo port install unison
Like I mentioned above, running Unison is incredibly easy. Lets say you have a directory called "scripts" and you wanted to sync it with another directory called "scripts-backup". You would do this: unison scripts scripts-backup
Unison will notice the first time you sync something and mention it to you. It will then run though the directory and files and ask you if you want to sync it or not. To accept the sync, just hit enter or else ? for help. This is all well and fine if you want to sync something on the same computer, but what about remotely? Unison supports socket and SSH transfers -- SSH being the prefered. To sync something remotely, do: unison scripts
ssh://server//path/to/scripts-backup
You'll be promted for SSH authentication and then the rest is the same as if you were to run it locally. But wait, there's more! Typing all those paths over and over gets tedious.. let's make a few shortcuts. Create a directory called .unison in your home directory. Inside, create a file called "scripts.prf". Inside scripts.prf have: root = /path/to/scripts
root = ssh://server//path/to/scripts-backup Now all you need to do is type: unison scripts
And Unison will do the rest for you. That's really all you need to get started with the basics. The preference file can get a lot more detailed and all of those details are described in the Unison Manual.
Original location of this document: http://adminspotting.net/howtos/unison.html
|








Recent comments
13 hours 39 min ago
1 day 6 hours ago
1 day 6 hours ago
2 days 1 hour ago
2 days 21 hours ago
3 days 13 min ago
3 days 4 hours ago
4 days 21 hours ago
4 days 21 hours ago
4 days 22 hours ago