Bug 10220 - symlinks are not counted as files in --stats
symlinks are not counted as files in --stats
Status: RESOLVED FIXED
Product: rsync
Classification: Unclassified
Component: core
3.0.9
All Linux
: P5 enhancement
: ---
Assigned To: Wayne Davison
Rsync QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-22 15:13 UTC by Ivan Dimitrov
Modified: 2013-10-28 20:26 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Dimitrov 2013-10-22 15:13:50 UTC
[root@dbbg]:~/symlink# touch file1 file2 file3
[root@dbbg]:~/symlink# ln -s file1 sym1 ; ln -s file2 sym2 ; ln -s file3 sym3
[root@dbbg]:~/symlink# rsync  -v -a --stats /root/symlink/ /tmp/symlink
sending incremental file list
created directory /tmp/symlink
./
file1
file2
file3
sym1 -> file1
sym2 -> file2
sym3 -> file3

Number of files: 7
Number of files transferred: 3
Total file size: 15 bytes
Total transferred file size: 0 bytes
Literal data: 0 bytes
Matched data: 0 bytes
File list size: 104
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 242
Total bytes received: 81

sent 242 bytes  received 81 bytes  646.00 bytes/sec
total size is 15  speedup is 0.05

##################################
###     Number of files transferred: 3      ###
### If -l is set, this number should be 7 ###
##################################
Comment 1 Wayne Davison 2013-10-27 17:29:29 UTC
"Transferred" has a particular meaning to rsync which involves creating the data for a file.  However, stats were improved in 3.1.0 (notice that the transferred count was further qualified to say "regular files"):

Number of files: 7 (reg: 3, dir: 1, link: 3)
Number of created files: 7 (reg: 3, dir: 1, link: 3)
Number of deleted files: 0
Number of regular files transferred: 3
[...]

Thus, symlinks will now be under the created-files stat.
Comment 2 Ivan Dimitrov 2013-10-28 08:26:34 UTC
Yes, I updated since then, but symlinks are not counted anywhere. Thus making a system that rely on `--dry-run --stats -v |grep transferred` would fail if only symlinks are changed.
Comment 3 Wayne Davison 2013-10-28 17:32:26 UTC
As my paste shows, they are counted in the created files.  They aren't counted in the updated regular files since they aren't regular files.
Comment 4 Ivan Dimitrov 2013-10-28 20:26:44 UTC
THANK YOU. Somehow I've omitted this.