Bug 10629 - rsync follows symlinks that point to same directory / endless loop
Summary: rsync follows symlinks that point to same directory / endless loop
Status: NEW
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.1.1
Hardware: All Linux
: P5 normal (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-26 00:41 UTC by kim@evolution7.com.au (dead mail address)
Modified: 2021-11-09 02:24 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kim@evolution7.com.au (dead mail address) 2014-05-26 00:41:50 UTC
Hi,

when using "--copy-links" and there is a symlink which points to the same directory rsync should not follow. Else it runs into an endless loop and throws"

"failed: Too many levels of symbolic links (40)"

Cheers,
Kim
Comment 1 Timothee Besset 2021-11-08 22:19:30 UTC
This problem still exists in rsync v3.2.3. `--copy-links` cannot be used when symlink loops are present.
Comment 2 Kevin Korb 2021-11-09 02:24:35 UTC
Since find is one of the few utilities that actually corrects for symlink loops you can use it as a workaround.  Something like: 

cd /source/path ; find -L . -print | rsync ... --copy-links --files-from=- ./ /target/path/