Gentoo Archives: gentoo-user

From: Brandon Vargo <brandon.vargo@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] sync'ing two computers (not related to emerge)
Date: Sat, 02 May 2009 22:36:28
Message-Id: 1241303785.20917.61.camel@mercury
In Reply to: [gentoo-user] sync'ing two computers (not related to emerge) by Simon
1 On Sat, 2009-05-02 at 17:33 -0400, Simon wrote:
2 > hi there!
3 > I've been using unison to synchronise and backup my computers.
4 > unison is based on rsync IIRC but with the difference that it
5 > 'remembers' the state of the folder that was synchronised. This way,
6 > if I delete a file on A, when sync'ing it will be deleted on B. While
7 > rsync would leave the file on B...
8 >
9 > I see rsync as a very good 'cp' program, but I need something that
10 > can deal with conflicts (file changed on both hosts/directories) and
11 > can propagate changes like deletes properly. Is there a way to get
12 > this behavior with rsync (maybe i missed something)?
13
14 No. Unison implements the rsync protocol for transferring files, but it
15 does not actually use rsync itself. You can make rsync transfer files
16 that are not in either the destination or a "reference" location with
17 the --compare-dest option, for example if doing an incremental backup,
18 but this will not propagate the deletion of a file or directory. The
19 delete file will come back on the next synchronization.
20
21 > The reason i'm asking is that unison has been having problems
22 > recently in sync'ing two pc... On my laptop, when i start the sync,
23 > it first checks it for changes against the 'unison snapshot'. Changes
24 > done since last sync are those that will be propagated. But it takes
25 > so long to check for changes (disk input rate is too slow i think)
26 > that once it finished, when it's time to send the changes to the
27 > remote server, the remote end has already disconnected!
28 >
29 > Thanks for the help/suggestions!
30
31 If you are using ssh with unison, are you using the "KeepAlive yes"
32 option in your ssh configuration? If not, add it, and your connection
33 should not close from inactivity. If you are using direct sockets,
34 unison will use a keepalive so it can timeout if the communication link
35 is broken.
36
37 How long is unison taking to check for changes? I can usually reconcile
38 changes in my home directory (approximately 45G, 125,000 files) in less
39 than 10-15 seconds between my slow laptop drive and a remote machine.
40 However, if you are syncing with a Windows machine, expect the sync to
41 be much slower. Fast checking is not safe on Windows, as unison can miss
42 changes, so it scans every file every time unless you tell it otherwise.
43
44 Regards,
45
46 Brandon Vargo

Replies