Hello, I have been using the rsync --stats switch to generate rudimentary reports for a while now. I've recently noticed on a new machine I am working with that there seems to be something wrong with the Number of Files Transferred stat. Consider the following two sets of stats from two different rsync sessions. The first session is the initial rsync of a source point and the second is an rsync session run immediately after the first: Number of files: 352 Number of files transferred: 293 Total file size: 141674918 bytes Total transferred file size: 141674918 bytes Literal data: 141674918 bytes Matched data: 0 bytes File list size: 7775 Total bytes sent: 5876 Total bytes received: 141712661 sent 5876 bytes received 141712661 bytes 503440.63 bytes/sec total size is 141674918 speedup is 1.00 ------- Number of files: 352 Number of files transferred: 293 Total file size: 141674918 bytes Total transferred file size: 141674918 bytes Literal data: 0 bytes Matched data: 141674918 bytes File list size: 7775 Total bytes sent: 256212 Total bytes received: 179419 sent 256212 bytes received 179419 bytes 58084.13 bytes/sec total size is 141674918 speedup is 325.22 We can see from the literal data and the matched data from each session that the first session transferred a large amount of data (as expected for the initial rsync) and the second session transferred nothing but overhead (again, as to be expected when the second rsync is run so quickly that no files have changed). What I can't figure out is why the stats still list 293 files as being transferred in both cases. This is a fairly straightforward rsync pulling from a CentOS4.5 box to another CentOS4.5 using rsync 2.6.0 protocol version 29 on both sides. I am using the command: rsync -rv --stats root@server:/backup/* /home/backups I apologize for the server obfuscation but I do not have permission to post actual server names to the Internet. Is this expected behaviour that I just haven't run across before? Thanks Jon
On Fri, 2007-11-09 at 11:11 -0400, Jon wrote:> We can see from the literal data and the matched data from each > session that the first session transferred a large amount of data (as > expected for the initial rsync) and the second session transferred > nothing but overhead (again, as to be expected when the second rsync > is run so quickly that no files have changed). What I can't figure out > is why the stats still list 293 files as being transferred in both > cases.> rsync -rv --stats root@server:/backup/* /home/backupsBy default, rsync trusts a destination file to have data identical to the source file (and thus skips transferring the source file) if the two files have the same sizes and mtime. You need to pass -t to make rsync set the mtimes of the destination files to match those of the source files; otherwise, it will retransfer everything on subsequent runs. Matt
On Fri 09 Nov 2007, Jon wrote:> > This is a fairly straightforward rsync pulling from a CentOS4.5 box to > another CentOS4.5 using rsync 2.6.0 protocol version 29 on both sides.Apart from what Matt already said, note that 2.6.0 is pretty old, 2.6.9 is the current version and 3.0.0 is in its final stages... Paul Slootman