When using rsync with "--dry-run --stats" the reported "Number of files transferred" and "Total transferred file size" are incorrect: bsqa1.nyc:/tmp/rsync/test # /tmp/rsync/bin/rsync --archive --dry-run --stats /tmp/rsync/ bsprod1:/tmp/rsync/ building file list ... done ./ bin/ man/ man/man1/ man/man1/rsync.1 man/man5/ man/man5/rsyncd.conf.5 test/ test/foo Number of files: 10 Number of files transferred: 3 Total file size: 853173 bytes Total transferred file size: 126433 bytes Literal data: 0 bytes Matched data: 0 bytes File list size: 188 File list generation time: 0.001 seconds File list transfer time: 0.000 seconds Total bytes sent: 254 Total bytes received: 74 sent 254 bytes received 74 bytes 656.00 bytes/sec total size is 853173 speedup is 2601.14 Notice that rsync reported that 3 files were transferred and they had a size of 126433 bytes. Rsync was run with "--dry-run" so in fact 0 files were transferred with 0 size. I'll attach a patch I've been using to work around this problem. David
Created attachment 980 [details] Proposed sender.c / receiver.c patch
The purpose of the --dry-run is to tell you what would be transferred. The output of the names is exactly that: the file being mentioned normally means "this file has been transferred", but with --dry-run it instead means "this file would be transferred". The stats follow in this same vein: how many files would have been transferred and how large are they?