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: Sun, 03 May 2009 22:16:10
Message-Id: 1241388968.5106.63.camel@mercury
In Reply to: Re: [gentoo-user] sync'ing two computers (not related to emerge) by Simon
1 On Sun, 2009-05-03 at 10:32 -0400, Simon wrote:
2 > > How long is unison taking to check for changes? I can usually reconcile
3 > > changes in my home directory (approximately 45G, 125,000 files) in less
4 > > than 10-15 seconds between my slow laptop drive and a remote machine.
5 > > However, if you are syncing with a Windows machine, expect the sync to
6 > > be much slower. Fast checking is not safe on Windows, as unison can miss
7 > > changes, so it scans every file every time unless you tell it otherwise.
8 >
9 > Ok i had to try a few times and now with tcpkeepalive being turned on
10 > it doesnt disconnect. But when the scan is done, it 'reconciles' the
11 > changes (so it has received the changes from the remote end) and
12 > Begins the transfer of a dozen files, but not a bit is transfered.
13 > The sshd and unison process on the remote host are waiting/sleeping or
14 > in coma, but nothing happens.
15 >
16 > I just tried again and let it sit on the transfer to see if the
17 > processes would wake up, but it read from remote host that connection
18 > timed out. I'm not sure but this may be due to the fact i'm on an
19 > unstable link... I'll try once more with a ssh session on the side to
20 > see if that session will get disconnected or not...
21 >
22 > It would be so nice if unison could 'remember' the changes on my HD
23 > against its local archive... anyway...
24 >
25 > Thanks, Simon
26
27 An unstable link is probably triggering your issue. If the link dies and
28 comes back, unison (at least version 2.27.57, what I have here) gets
29 confused and just sits there. What's interesting is that if unison is
30 killed on the initiating machine, the remote process stops as well,
31 which leads me to believe this is a bug in unison; they can talk, but
32 they don't do anything. I've glanced at the code before despite my lack
33 of familiarity with OCaml, as my wireless connection will often die,
34 causing much grief, but I've never found a solution.
35
36 You could try syncing subdirectories iteratively within what you want to
37 sync and hope that your connection does not die during the smaller sync,
38 but that really isn't a good solution. I personally use this method to
39 speed up synchronization if, for example, I only need my latest CS
40 project synchronized but not any new music I may have. Unison is smart
41 enough to use the same hash database if you use the same root
42 directories and use the Path directive in your configuration to limit
43 what is synchronized, so it should not re-hash your files on a later
44 sync.
45
46 As for other solutions, if you cannot get unison to work with your
47 connection, I would suggest using a DVCS. I tried synchronizing my home
48 directory with git before finding unison. The DVCS approach is better
49 than SVN or CVS because it takes up less space and does not require a
50 server. The disadvantages are the increased space used to store the
51 backend files and the need to commit all of your files before
52 pushing/pulling to/from the other machine (though I guess that could be
53 an advantage, depending on your needs). It isn't optimal, but it can
54 work, despite the git manual specifically mentioning that git was not
55 made to do such a thing. Mercurial might work better, but I've never
56 tried to use it. You might hit the same issues if the connection dies; I
57 don't know.
58
59 If you do find something that works similar to unison, but is more
60 robust, I'd love to hear about it. I've tired a number of things, but I
61 keep coming back to unison, despite its issues.
62
63 Regards,
64
65 Brandon Vargo

Replies

Subject Author
Re: [gentoo-user] sync'ing two computers (not related to emerge) Simon <turner25@×××××.com>