Randy Kramer [[EMAIL PROTECTED]] writes:
> I'm still uncertain about what happens if a single file rsync is
> interrupted partway through (and I've specified the --partial
> option) -- will rsync take advantage of the old copy of the file in
> --compare-dest and the partially rsync'd file (now truncated) in the
> destination directory?
No, there can only be one compare file, so the next time you try the
transfer it'll use the previous partially transferred copy for that
purpose. Depending on the size of the original compare file and how
much was partially transferred the last time, that can lose a
significant amount of information (if you were using --partial) in
terms of rsync's ability to be as efficient as possible.
Locally here, we have a similar setup where we're transferring large
database files. To work around that, I've been trying a local
"--partial-pad" option. If enabled, it works like --partial, but upon
an interruption, it appends data from the original source to the
partial copy to "fill out" the partial copy at least as large as the
original.
I believe in our specific case it's an improvement - and we really
only use it on the commands that perform the database backups - but am
not convinced that it's necessarily useful as a general purpose option
(and haven't yet submitted a patch), since there's nothing to say that
the partially transferred information will be of any use in the next
transfer, since it assumes sort of a linear change pattern to the
file. The best performing behavior would be to work with both the
previous partial file and the original in the --compare-dest directory,
but that would be significant changes to rsync internals, not to
mention potentially twice the work if the partial copy was any
significant fraction of the --compare-dest copy.
But I'd be happy to supply a diff if you think it might help in your
setup. It'd be against 2.4.3, but should be very close if not the
same against later releases.
> Aside: I think, based on your previous response, that if I did a
> multifile rsync (say 60 files), and rsync was interrupted after 20
> of the files were rsync'd, the --compare-dest option would work to
> avoid rsync'ing the first 20 files and then rsync would rsync the
> last 40 files in the normal manner (i.e., breaking them into blocks
> of 3000 to 8000 bytes and then comparing them, and transferring only
> the blocks that were different).
I don't think the --compare-dest would be the reason rsync would skip
the first 20 - it would just see them as existing in the target
directory at the right date and size. Where --compare-dest could come
into play was if they already existed in the separate comparision
directory, in which case they wouldn't be transferred at all (unless
you were using the -I option).
-- David
/-----------------------------------------------------------------------\
\ David Bolen \ E-mail: [EMAIL PROTECTED] /
| FitLinxx, Inc. \ Phone: (203) 708-5192 |
/ 860 Canal Street, Stamford, CT 06902 \ Fax: (203) 316-5150 \
\-----------------------------------------------------------------------/