local -> local file copy question

Matthias Schniedermeyer ms at citd.de
Sun Aug 19 11:40:30 MDT 2012

On 19.08.2012 10:06, Linda Walsh wrote:
> Justin T Pryzby wrote:
> >Note that --whole-file "is the default when both the source and
> >destination are specified as local paths", and implies that the file
> >is copied without the "delta transfer" algorithm.
> ---
> I am using the 'whole-file' copy, 'explicitly', as I didn't know
> that was the default in a local->local file copy.
> If that algorithm was intended for local-local copy, how does
> it use breaking up a file into blocks and summing them help
> file transfer, over, say, spewing the entire file in 1 write
> over a pipe like say cat a | cat >b would ?
> Alternatively, if it 'knows' it is local-local and it is copying the
> whole file, how does the block-summing copying of the data through a pipe
> to another process  providing benefits, over say, simply writing the
> buffer, directly back out to the new file location, like a 'cp' command
> conceptually, might do?

If rsync copies a file locally it basically does the same thing as cp.
(Both for the initial copy and for an update (with default options))
There is no checksumming going on.

The man-page is quite clear about that, including the reasoning:

- short -
        -W, --whole-file            copy files whole (w/o delta-xfer algorithm)
- short -
- long -
      -W, --whole-file
With this option rsync's delta-transfer algorithm is not used and the 
whole file is sent as-is instead.  The transfer may be faster if this 
option is used when the bandwidth between the source and destination 
machines is higher than the bandwidth to disk (especially when the 
"disk" is actually a networked filesystem).  This is the default when 
both the source and destination are specified as local paths, but only 
if no batch-writing option is in effect.
- long -

Bis denn

Real Programmers consider "what you see is what you get" to be just as 
bad a concept in Text Editors as it is in women. No, the Real Programmer
wants a "you asked for it, you got it" text editor -- complicated, 
cryptic, powerful, unforgiving, dangerous.

More information about the rsync mailing list