--copy-unsafe-links, links preserved in source tree or local directory?

Seth Olsen olsen at gps.caltech.edu
Thu Jan 2 23:09:00 EST 2003


Hi,

I'm a bit confused about what the '--copy-unsafe-links' option 
considers the 'source tree'.  In the man page it says that for links
pointing outside the 'source tree' the file will be copied, but when I
try this, for all links pointing outside of the local directory the
files are copied even though the links point to files that are in the
directory tree that is being rsynced.  I couldn't find anything definitive
on the web either. See the example below. 

Is this the expected behaviour? Is the 'source tree' just the 
current directory? If so, it would be nice to have an option where 
only links pointing outside of the 'parent source tree' 
('Test' in the example below) would be copied as files.

rsyc-2.5.4 on RedHat-7.3 i386, XFS filesystem

Thanks,

Seth
olsen at gps.caltech.edu

example:

chump0:~> ll Test/*
Test/Q1:
total 0
-rw-rw-r--    1 olsen    olsen           0 Jan  2 14:05 q1_1
-rw-rw-r--    1 olsen    olsen           0 Jan  2 14:05 q1_2
lrwxrwxrwx    1 olsen    olsen           4 Jan  2 14:06 q1_3 -> q1_2
lrwxrwxrwx    1 olsen    olsen          24 Jan  2 14:09 q1_4 -> /home/olsen/Test/Q2/q2_1 
lrwxrwxrwx    1 olsen    olsen          15 Jan  2 14:42 q1_5 -> ../../test/qw.F

Test/Q2:
total 0
-rw-rw-r--    1 olsen    olsen           0 Jan  2 14:06 q2_1
-rw-rw-r--    1 olsen    olsen           0 Jan  2 14:06 q2_2
lrwxrwxrwx    1 olsen    olsen           4 Jan  2 14:06 q2_3 -> q2_1
lrwxrwxrwx    1 olsen    olsen          10 Jan  2 14:06 q2_4 -> ../Q1/q1_1 
lrwxrwxrwx    1 olsen    olsen          10 Jan  2 14:06 q2_5 -> ../Q1/q1_3

chump0:~> rsync -rl --copy-unsafe-links Test Test2

chump0:~> ll Test2/Test/*
Test2/Test/Q1:
total 4.0k
-rw-rw-r--    1 olsen    olsen           0 Jan  2 14:48 q1_1
-rw-rw-r--    1 olsen    olsen           0 Jan  2 14:48 q1_2
lrwxrwxrwx    1 olsen    olsen           4 Jan  2 14:48 q1_3 -> q1_2
-rw-rw-r--    1 olsen    olsen           0 Jan  2 14:48 q1_4
-rw-rw-r--    1 olsen    olsen         275 Jan  2 14:48 q1_5

Test2/Test/Q2:
total 0
-rw-rw-r--    1 olsen    olsen           0 Jan  2 14:48 q2_1
-rw-rw-r--    1 olsen    olsen           0 Jan  2 14:48 q2_2
lrwxrwxrwx    1 olsen    olsen           4 Jan  2 14:48 q2_3 -> q2_1
-rw-rw-r--    1 olsen    olsen           0 Jan  2 14:48 q2_4
-rw-rw-r--    1 olsen    olsen           0 Jan  2 14:48 q2_5



More information about the rsync mailing list