There appears to be a problem with the handling of symlinks within source
directories by the --relative (-R) option.
I am using rsync 2.5.5 on an SGI Origin 200 running IRIX 6.5.11f.
Example: copying the contents of /usr/local/etc/inhouse/db/ from wolf
to fox where /usr/local is a directory on wolf, but /usr/local is a link
to /usr2/local on fox.
Here's the dry-run output (some anonymizing editing has been done):
---
129 (wolf)root> /usr/local/bin/rsync -a -R -v --delete -n -e
/usr/local/bin/ssh --rsync-path=/usr/local/bin/rsync /usr/local/etc/inhouse/db/
fox.cisti.nrc.ca:
building file list ... done
deleting usr/local/etc/inhouse/db/bak/20020505130006.tar.gz
deleting usr/local/etc/inhouse/db/bak/20020505010005.tar.gz
/usr/local/etc/inhouse/db/bak/20020605010006.tar.gz
/usr/local/etc/inhouse/db/bak/20020605130005.tar.gz
/usr/local/etc/inhouse/db/maillog
/usr/local/etc/inhouse/db/pri-req.log
/usr/local/etc/inhouse/db/registry
/usr/local/etc/inhouse/db/waitlist
wrote 6474 bytes read 44 bytes 686.11 bytes/sec
total size is 137212442 speedup is 21051.31
---
Here's the (abbreviated) output of the actual update:
---
131 (wolf)root> /usr/local/bin/rsync -a -R -v --delete -e /usr/local/bin/ssh
--rsync-path=/usr/local/bin/rsync /usr/local/etc/inhouse/db/ fox.cisti.nrc.ca:
building file list ... done
deleting usr/local/etc/inhouse/db/bak/20020505130006.tar.gz
deleting usr/local/etc/inhouse/db/bak/20020505010005.tar.gz
usr/
usr/local/
usr/local/etc/
usr/local/etc/inhouse/
usr/local/etc/inhouse/db/
/usr/local/etc/inhouse/db/Backup
/usr/local/etc/inhouse/db/Makefile
/usr/local/etc/inhouse/db/areas.txt
usr/local/etc/inhouse/db/bak/
/usr/local/etc/inhouse/db/bak/20020506010006.tar.gz
/usr/local/etc/inhouse/db/bak/20020506130005.tar.gz
/usr/local/etc/inhouse/db/bak/20020507010006.tar.gz
/usr/local/etc/inhouse/db/bak/20020507130006.tar.gz
/usr/local/etc/inhouse/db/bak/20020605010006.tar.gz
/usr/local/etc/inhouse/db/bak/20020605130005.tar.gz
/usr/local/etc/inhouse/db/branch
/usr/local/etc/inhouse/db/courses
/usr/local/etc/inhouse/db/maillog
/usr/local/etc/inhouse/db/pri-req.log
/usr/local/etc/inhouse/db/registry
/usr/local/etc/inhouse/db/waitlist
wrote 137245608 bytes read 4164 bytes 469229.99 bytes/sec
total size is 137212442 speedup is 1.00
---
The deletions are performed properly, but the /usr/local link is replaced
by a /usr/local directory and then the complete contents of
/usr/local/etc/inhouse/db/ is copied to this new location.
My work-around is to not use "-R" and to fully specify the destination
directory:
---
136 (wolf)root> /usr/local/bin/rsync -a -v --delete -e /usr/local/bin/ssh
--rsync-path=/usr/local/bin/rsync /usr/local/etc/inhouse/db/
fox.cisti.nrc.ca:/usr2/local/etc/inhouse/db/
building file list ... done
bak/
bak/20020605010006.tar.gz
bak/20020605130005.tar.gz
maillog
pri-req.log
registry
waitlist
wrote 2551675 bytes read 52142 bytes 226418.87 bytes/sec
total size is 137212442 speedup is 52.70
---
(The deletions don't show up because they were previously done.)
Th work-around is okay for a single source directory, but it does not scale
properly for multiple sources. "--relative" needs to be fixed so that
it
does not alter the source directory structure.
- Greg Kresko
National Research Council of Canada
Greg.Kresko@nrc.ca
(I am not subscribed to the rsync list)