Output of --list-only not as I expected for symlinks

Michael Hipp michael at redmule.com
Wed Sep 12 15:06:54 UTC 2018


The output of --list-only isn't as I expected as regards symlinks. Here 
are my test files:

$ ls ./src
-rw-------  1 michael michael    0 2018-09-05 09:18:15 file
lrwxrwxrwx  1 michael michael    4 2018-09-05 09:18:28 near_symlink -> file
lrwxrwxrwx  1 michael michael   23 2018-09-05 09:19:05 far_symlink -> 
/home/michael/Documents

The "destination" dir is empty:

$ ls ./dest
drwxr-xr-x 31 michael michael 4.0K 2018-09-12 09:46:06 ..
drwx------  2 michael michael 4.0K 2018-09-12 09:50:20 .

I want to know which files are candidates to transfer. I don't want 
symlinks to transfer. So I run it with --list-only :

$ rsync -r --no-links --list-only ./src/ ./dest
drwx------          4,096 2018/09/06 09:39:16 .
lrwxrwxrwx             23 2018/09/05 09:19:05 far_symlink
-rw-------              0 2018/09/05 09:18:15 file
lrwxrwxrwx              4 2018/09/05 09:18:28 near_symlink

This seems to indicate the symlinks are expected to transfer. But if I 
actually run the transfer by removing --list-only ...

$ rsync -r --no-links ./src/ ./dest
skipping non-regular file "far_symlink"
skipping non-regular file "near_symlink"

It does not transfer the symlinks and this is confirmed by the contents 
of dest:

$ ls ./dest
drwxr-xr-x 31 michael michael 4.0K 2018-09-12 09:46:06 ..
-rw-------  1 michael michael    0 2018-09-12 09:57:50 file
drwx------  2 michael michael 4.0K 2018-09-12 09:57:50 .

So it seems like --list-only isn't being truthful as it surely knows 
beforehand the symlinks will not be transferred regardless of the 
condition of dest.

What am I missing?

Thanks,
Michael Hipp




More information about the rsync mailing list