syncing home partitions

Kurt Granroth plug-discuss at granroth.org
Wed Mar 29 17:14:15 MST 2006


der.hans wrote:
> Am 29. Mar, 2006 schwätzte Eric "Shubes" so:
>> .) Is 'rsync' the best program to use for this application?
> 
> rsync, especially with a wrapper like unison is a good choice.

<nitpick>Unison uses a protocol very similar to rsync but it's not
actually based on (nor uses) rsync at all</nitpick>

I second using Unison.  It seems like an ideal choice in this matter.
rsync is great for uni-directional updates.  I use it automatically in
cron jobs for backup purposes many times a day... and it's a rare work
day when I don't use rsync at least once by hand to transfer one or more
files.

However, rsync is a poor choice if files may be modified on either end
of the connection and you aren't very careful.  It's possible in that
case to modify one or more files on each side... but when you do the
rsync, it will clobber all of the changes on one of the sides.  The only
way around it to always remember to do the rsync before you switch sides.

Unison is much more flexible in this case.  Basically, you do one rsync
between the two sides to make sure they are identical before running
unison for the first time.  Then, unison creates a little DB of all the
files on each side.  From then on, whenever you run unison, it checks to
see if any files have changed on either side.  If so, it will propagate
the change in both directions.  If you modify the *same* file on both
sides, it will even give you the opportunity to merge the changes.  The
end result of all this is that no matter where you change your files,
the two sides will end up identical after you run unison.

Unison: http://www.cis.upenn.edu/~bcpierce/unison/

Kurt


More information about the PLUG-discuss mailing list