Guillaume Rousse wrote:
> Just by curiosity, do you know how this magic patch-in-place mode works ?
> I mean, before patching, you have to compute differences between the files.
> And how can you compare two files without downloading completly the first one
> to the place where the second one is located ?
I'm sure Ron knows much more than I do -- you can learn a lot by
visiting the rsync site (rsync.samba.org) and then looking for the
thesis by Andrew Tridgel , a (the?) primary author of Samba. The link
to the thesis is http://samba.org/~tridge/phd_thesis.pdf.
Basically rsync makes the comparison my computing checksums on the file
at both ends. It starts with a fast checksum that makes a rough check
for similar sections of the file at both ends, and then, if that
checksum identifies a potential match, it calculates a more thorough
(but more time consuming) checksum that pretty much can definitely
determine a match . It saves time by only transmitting these checksums
and the portions of the file that are different. It has a means
(similar to diff) of looking for "displaced" matches -- portions of the
files that match even though the location in one file does not match the
location in the other file.
There are some subtleties to rsync that you may need to know at times.
It works well, but there is a gotcha for large files -- IIRC, if the
rsync operation is interrupted, the entire file is thrown away at the
receiving end. This includes (IIRC) the bad copy that you started
with. So, if an rsync operation is interrupted every two hours, and the
rsync operation cannot be completed in two hours, you lose not only the
corrections accomplished during that two hours but also your original
file. (So, at the very least, you want to have a backup copy of your
original "bad" file in a safe location so you can restart with that
after an interruption rather than reloading from scratch. (Rsync will
essentially revert to a ftp operation if there is no file on the
receiving end.)
Rsync does use a lot of computational power on both computers, but,
since the bottleneck is the link connecting them, usually that
processing power is not an issue. I have had problems transferring
large files when the server end apparently disconnected me because the
rsync process was doing a lot of calculation without transmitting any
data (at least, that's what I suspect was happening -- the server
presumably thought the rsync process was hung). In this case you get a
rather misleading message, which I can't recall right now.
Ron (IIRC) has written sort of a wrapper around rsync that makes it
easier / better for use with cooker. I've never tried it.
Hope this helps,
Randy Kramer