For stats, rsync uses the word "file" inconsistently. When reporting the total "Number of files", it indicates a total number of filesystem objects which consists of regular files, directories, symlinks, specials, and devices. When reporting number of "files" transferred, it refers only to regular files. I use the following patch to sort out these various file types in --stats. The one thing I'd still like to add is number of files that are uptodate and number of inodes relative to number of hard links. Then everything would actually add up. For what you're looking to do, this patch should work.

Without the patch:
[bombich:~/Desktop/rsync-3.0.2] sudo ./rsync --stats -aH /Volumes/ source/ /Volumes/target/

Number of files: 80
Number of files transferred: 24
Total file size: 18384 bytes
Total transferred file size: 69 bytes
Literal data: 69 bytes
Matched data: 0 bytes
File list size: 3557
File list generation time: 0.002 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 4966
Total bytes received: 743

sent 4966 bytes  received 743 bytes  11418.00 bytes/sec
total size is 18384  speedup is 3.22


With the patch:
[bombich:~/Desktop/rsync-3.0.2] sudo ./rsync --stats -aH /Volumes/ source/ /Volumes/target/

Number of files: 80
Number of directories: 30
Number of regular files: 38
Number of symlinks: 9
Number of devices: 2
Number of special files: 1
Number of re-linked hard links: 4
Number of files transferred: 24
Total file size: 18384 bytes
Total transferred file size: 69 bytes
Literal data: 69 bytes
Matched data: 0 bytes
File list size: 3557
File list generation time: 0.002 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 4963
Total bytes received: 740

sent 4963 bytes  received 740 bytes  11406.00 bytes/sec
total size is 18384  speedup is 3.22


- Mike

Attachment: extended_stats.diff
Description: Binary data




On Apr 15, 2008, at 12:02 AM, Ph. Marek wrote:

Hello everybody,

I'm using rsync (debian 3.0.2-1) to test my pet projects for correctness; but now I've come across a bug (?) in rsync - it doesn't count transferred links,
ie. "Number of files transferred:" is wrong.

See:

  # mkdir a b
  # ln -s /bin/ls a/link ; touch b/link
  # ls -la a/* b/*
  lrwxrwxrwx 1 flip flip 7 15. Apr 06:53 a/link -> /bin/ls
  -rw-r--r-- 1 flip flip 0 15. Apr 06:53 b/link

Now a test run shows that it'd send it, but doesn't count:
  # rsync -a -v --stats a/ b/ -n
  sending incremental file list
  link -> /bin/ls

  Number of files: 2
  Number of files transferred: 0
  Total file size: 7 bytes
  Total transferred file size: 0 bytes
  Literal data: 0 bytes
  Matched data: 0 bytes
  File list size: 51
  File list generation time: 0.005 seconds
  File list transfer time: 0.000 seconds
  Total bytes sent: 63
  Total bytes received: 15

  sent 63 bytes  received 15 bytes  156.00 bytes/sec
  total size is 7  speedup is 0.09 (DRY RUN)

Neither does a real run:
  # rsync -a -v --stats a/ b/
  sending incremental file list
  link -> /bin/ls

  Number of files: 2
  Number of files transferred: 0
  Total file size: 7 bytes
  Total transferred file size: 0 bytes
  Literal data: 0 bytes
  Matched data: 0 bytes
  File list size: 51
  File list generation time: 0.001 seconds
  File list transfer time: 0.000 seconds
  Total bytes sent: 63
  Total bytes received: 15

  sent 63 bytes  received 15 bytes  156.00 bytes/sec
  total size is 7  speedup is 0.09

But the symlink was sent:
  # ls -la a/* b/*
  lrwxrwxrwx 1 flip flip 7 15. Apr 06:53 a/link -> /bin/ls
  lrwxrwxrwx 1 flip flip 7 15. Apr 06:53 b/link -> /bin/ls


Now I'd like to ask whether that's a policy change (ie. will stay so), or if it's just a bug - in the first case I have to rewrite my test scripts, to
test for changes in some other way.


Thank you.


Regards,

Phil
--
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to