Incremental Diffs?

Kim Scarborough lists at jinx.unknown.nu
Mon Mar 18 13:08:57 EST 2002


Okay, this response is a bit delayed, so I'm including a recap:

> > > > I'm using it to backup files from one computer to another, and it
> > > > works exactly as I thought it would, except that it seems to be
> > > > copying entire files over when they've change rather than the
> > > > differences.
> > >
> > > What specifically leads you to that conclusion?
> >
> > I have it set to extra verbose, and I've been watching the files transfer
> > over. When I append 2K to a 100MB text file and re-rsync, it's pretty
> > obvious it's transferring 100MB, not 2K + whatever overhead the diff takes
> > up.
>
> I wouldn't be so sure.  Add the option --stats to the rsync command line
> and see what it says.  AFAIK those numbers are correct.

Today I did a very specific test and I'm positive it's behaving that way.
Here's a transcript, sorry for the length:

------------------------------------------------------------------------------

JINX: /root# ls -l /home/sluggo/temp
total 1904
-rw-------  1 sluggo  wheel  1934600 Mar 17 19:49 asciifile

JINX: /root# rsync -vvaRbS --backup-dir=/backups/rsync/old --delete \
--rsh=ssh --exclude="*.core" --exclude=/etc/namedb/secondary \
--exclude=/var/run --numeric-ids --stats --progress --bwlimit=100 \
/home/sluggo/temp remoteserver:/backups/rsync/current
rsync: open connection using ssh remoteserver rsync --server -vvblogDtprRS
--bwlimit=100 --delete --numeric-ids --backup-dir /backups/rsync/old . /backups/rsync/current
rsync: building file list...

rsync: expand file_list to 4000 bytes, did move
rsync: 4 files to consider.
expand file_list to 4000 bytes, did move
deleting in home/sluggo/temp
home is uptodate
home/sluggo/temp/
/home/sluggo/temp/asciifile
      131072   6%   76.13kB/s    0:00:23
      524288  27%   76.18kB/s    0:00:18
     1212416  62%   76.19kB/s    0:00:09
     1605632  82%   76.18kB/s    0:00:04
     1934600 100%   76.01kB/s    0:00:00
backup_dir is /backups/rsync/old
total: matches=0  tag_hits=0  false_alarms=0 data=1934600


Number of files: 4
Number of files transferred: 1
Total file size: 1934608 bytes
Total transferred file size: 1934600 bytes
Literal data: 1934600 bytes
Matched data: 0 bytes
File list size: 103
Total bytes written: 1935042
Total bytes read: 36

wrote 1935042 bytes  read 36 bytes  73021.81 bytes/sec
total size is 1934608  speedup is 1.00

JINX: /root# echo "13 more chars" >> /home/sluggo/temp/asciifile

JINX: /root# rsync -vvaRbS --backup-dir=/backups/rsync/old --delete \
--rsh=ssh --exclude="*.core" --exclude=/etc/namedb/secondary \
--exclude=/var/run --numeric-ids --stats --progress --bwlimit=100 \
/home/sluggo/temp remoteserver:/backups/rsync/current
rsync: open connection using ssh remoteserver rsync --server
-vvblogDtprRS --bwlimit=100 --delete --numeric-ids --backup-dir
/backups/rsync/old . /backups/rsync/current
rsync: building file list...

rsync: expand file_list to 4000 bytes, did move
rsync: 4 files to consider.
expand file_list to 4000 bytes, did move
deleting in home/sluggo/temp
home is uptodate
/home/sluggo/temp/asciifile
      131072   6%   76.19kB/s    0:00:23
      425984  22%   76.19kB/s    0:00:19
      851968  44%   76.18kB/s    0:00:14
     1376256  71%   76.19kB/s    0:00:07
     1934614 100%   76.02kB/s    0:00:00
backup_dir is /backups/rsync/old
keep_backup home/sluggo/temp/asciifile ->
/backups/rsync/old/home/sluggo/temp/asciifile

total: matches=0  tag_hits=0  false_alarms=0 data=1934614

Number of files: 4
Number of files transferred: 1
Total file size: 1934622 bytes
Total transferred file size: 1934614 bytes
Literal data: 1934614 bytes
Matched data: 0 bytes
File list size: 103
Total bytes written: 1935056
Total bytes read: 36

wrote 1935056 bytes  read 36 bytes  70366.98 bytes/sec
total size is 1934622  speedup is 1.00

--------------------------------------------------------------

Note the "Total bytes written". All I added was that one line at the end
of the file. I also hit enter a couple times during the transfer so that
snapshots of the timings would be logged; note that it took about the same
amount of time both times. So unless I'm completely on drugs here, it
seems to be transferring the entire file, not a diff.

-------------------------------------------------------------------------------
Kim Scarborough                                      http://www.unknown.nu/kim/
-------------------------------------------------------------------------------
"I was so naive as a kid, I used to sneak behind the barn and do nothing."
                                                           -Johnny Carson
-------------------------------------------------------------------------------





More information about the rsync mailing list