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
--list-only is simply a way to list remote files when you only have access via rsync. It ignores the rest of the command line. You want --dry-run (--itemize-changes would be a good idea too). On 09/12/2018 11:06 AM, Michael Hipp via rsync wrote:> 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 > >-- ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._., Kevin Korb Phone: (407) 252-6853 Systems Administrator Internet: FutureQuest, Inc. Kevin at FutureQuest.net (work) Orlando, Florida kmk at sanitarium.net (personal) Web page: https://sanitarium.net/ PGP public key available on web site. ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._., -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 195 bytes Desc: OpenPGP digital signature URL: <http://lists.samba.org/pipermail/rsync/attachments/20180912/ea621960/signature.sig>
Thank you. But I'm afraid I don't understand. The man entry reads: "--list-only This option will cause the source files to be listed instead of transferred. This option is inferred if there is a single source arg and no destination specified..." It doesn't say anything about "list remote files". In fact I am not sure why it would even contact the remote end. And the behavior does not change even if no destination is specified. As far as it ignoring the rest of the command line, note that it does obey exclusion rules. Symlinks seem to be the only anomaly in its output. I use --dry-run and --itemize-changes frequently. But I was trying to find something that would give me a correct list of the candidate source files but without having to make an expensive connect to the remote server. Any suggestions? Thanks, Michael Hipp On 2018-09-12 11:17, Kevin Korb via rsync wrote:> --list-only is simply a way to list remote files when you only have > access via rsync. It ignores the rest of the command line. You want > --dry-run (--itemize-changes would be a good idea too). > > On 09/12/2018 11:06 AM, Michael Hipp via rsync wrote: >> 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 >> >> > >
Maybe Matching Threads
- Output of --list-only not as I expected for symlinks
- Output of --list-only not as I expected for symlinks
- Output of --list-only not as I expected for symlinks
- Output of --list-only not as I expected for symlinks
- [Bug 13615] New: Output of --list-only not as I expected re: symlinks