Wednesday, May 9, 2007

Unison to replace rsync

From the experience I'm facing memory problem with rsync. So need to try Unison as an option.

Below is the Unison in brief or you can go to the unison file synchronizer to learn more

Unison, a free cross-platform file synchronization program, can not only provide you with multiple backups of your files, but more importantly, grant you the freedom to simultaneously use different computers with access to all of your files, thus liberating you from the confines of one particular machine. Unison allows you to access the same set of files from any computer (running Mac OS X, Windows XP, or UNIX/Linux variants) and keeps these files up-to-date by always maintaining the most recently-modified version of each file during synchronization. I personally use Unison to keep replicas of all of my personal files across several different computers. Because my documents and configuration files are accessible from every computer, I am free to use whichever one is the most convenient at the moment without the hassle of transferring files using floppy disks, USB drives, or email.

Setting up your Unison profile:

On the computer where you are invoking Unison, it looks for a profile located in the ~/.unison/ directory to know which two locations (called roots) to synchronize and which options to invoke Unison with. I have one common profile named common.prf with properties that are shared by all profiles:

# Helps out a lot on Windows
fastcheck = true

# place new files at the top of the list
sortnewfirst = true

# turn on ssh compression
rshargs = -C

ignore = Name Thumbs.db
ignore = Name *~
ignore = Name *.tmp
Among other things, this common profile tells Unison to perform a fast file name/date check for Windows (which greatly speeds up performance) and ignore certain temporary and useless files. Every profile I set up will include this one. Here is an example of a simple profile named simple.prf:
include common

root = /home/pgbovine/my-unison-root
root = ssh://pgbovine@some.fileserver.com//home/pgbovine/my-unison-root
directory for a profile named parameters are very important. These are the two locations that Unison is trying to synchronize between. In this case, the first root is the When I invoke Unison with the command unison simple, it looks in the ~/.unison/simple.prf and virtually appends all of the options listed in that profile onto the command-line when invoking Unison. The two rootmy-unison-root directory on my computer (where all of my data is stored), and the second root is the same directory on a remote file server (which must also be able to run Unison 2.9.1).

No comments: