Problem with absolute symbolic links
Kevin Minder
kevin.minder at oracle.com
Fri Dec 13 19:15:47 EST 2002
I'm trying to synchronize a particularly troublesome directory structure on a SunOS box to a PC. I really want all symbolic links resolved to real files on the PC when everything is done. I can't seem to find any combination of parameters that will accomplish this.
It boils down to two problems.
1. It seems like that even if I exclude a symbolic link that is a directory it is not excluded.
2. It seems like copy-links and copy-unsafe-links don't work for symbolic links to directories outside the source tree.
Is this the correct behavior or am I doing something wrong.
Any input is greatly appreciated.
Here is my rsyncd.conf file...
-----------------------------------
motd file = /etc/rsyncd.motd
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
uid = kminder
gid = svrtech
[test]
path = /home/kminder/rsync/test
comment = test
read only = yes
list = yes
-----------------------------------
Below is a simplified source structure on the unix side (source).
Note the .rel symlink and the .abs symlink.
-----------------------------------
/home/kminder/rsync> ls -al outside test
outside:
total 16
drwxr-xr-x 2 kminder g904 4096 Dec 13 11:37 .
drwxr-xr-x 5 kminder g904 4096 Dec 13 11:29 ..
-rw-r--r-- 1 kminder g904 15 Dec 13 11:37 file
test:
total 24
drwxr-xr-x 3 kminder g904 4096 Dec 13 11:36 .
drwxr-xr-x 5 kminder g904 4096 Dec 13 11:29 ..
lrwxrwxrwx 1 kminder g904 27 Dec 13 11:36 .abs -> /home/kminder/rsync/outside
lrwxrwxrwx 1 kminder g904 3 Dec 13 11:34 .rel -> dir
lrwxrwxrwx 1 kminder g904 9 Dec 13 11:36 absfile -> .abs/file
drwxr-xr-x 2 kminder g904 4096 Dec 13 11:34 dir
-rw-r--r-- 1 kminder g904 10 Dec 13 11:32 file
lrwxrwxrwx 1 kminder g904 4 Dec 13 11:33 link -> file
lrwxrwxrwx 1 kminder g904 4 Dec 13 11:33 linklink -> link
lrwxrwxrwx 1 kminder g904 9 Dec 13 11:35 relfile -> .rel/file
-----------------------------------
I'm trying for the following structure on the pc (cygwin ls -al).
Note that all links should be resolved.
I want the duplicate files.
-----------------------------------
drwxr-xr-x+ 4 kminder None 4096 Dec 13 11:36 .
drwxrwxrwx+ 14 Administ Administ 8192 Dec 13 11:20 ..
drwxr-xr-x+ 2 kminder None 0 Dec 13 11:34 dir
-rw-r--r-- 1 kminder None 10 Dec 13 11:32 file
-rw-r--r-- 1 kminder None 10 Dec 13 11:32 link
-rw-r--r-- 1 kminder None 10 Dec 13 11:32 linklink
-rw-r--r-- 1 kminder None 14 Dec 13 11:34 relfile
-rw-r--r-- 1 kminder None 14 Dec 13 11:34 absfile
-----------------------------------
When I execute the command that I think should accomplish this...
D:\sync>rsync -rptgDvP --port=34343 --copy-links --copy-unsafe-links --exclude .rel --exclude .abs kminder at usunnbd25::test d:\sync
The resulting output follows...
-----------------------------------
receiving file list ...
readlink absfile: No such file or directory
7 files to consider
./
dir/
dir/file
14 100% 0.00kB/s 0:00:00
file
10 100% 9.77kB/s 0:00:00
link
10 100% 9.77kB/s 0:00:00
linklink
10 100% 9.77kB/s 0:00:00
relfile
14 100% 13.67kB/s 0:00:00
wrote 190 bytes read 465 bytes 187.14 bytes/sec
total size is 58 speedup is 0.09
rsync error: partial transfer (code D:\sync>dir23) at /tmp/rsync-2.5.5/main.c(926)
-----------------------------------
My disk ends up looking as follows. Again using cygwin ls -al.
-----------------------------------
drwxr-xr-x+ 4 kminder None 4096 Dec 13 11:36 .
drwxrwxrwx+ 14 Administ Administ 8192 Dec 13 11:20 ..
drwxr-xr-x+ 2 kminder None 0 Dec 13 11:34 .rel
drwxr-xr-x+ 2 kminder None 0 Dec 13 11:34 dir
-rw-r--r-- 1 kminder None 10 Dec 13 11:32 file
-rw-r--r-- 1 kminder None 10 Dec 13 11:32 link
-rw-r--r-- 1 kminder None 10 Dec 13 11:32 linklink
-rw-r--r-- 1 kminder None 14 Dec 13 11:34 relfile
-----------------------------------
If I do it without the excludes like this...
rsync -rptgDvP --port=34343 --copy-links --copy-unsafe-links kminder at usunnbd25::test d:/sync
The output is this...
-----------------------------------
receiving file list ...
readlink .abs: No such file or directory
readlink absfile: No such file or directory
9 files to consider
./
dir/
dir/file
14 100% 0.00kB/s 0:00:00
file
10 100% 9.77kB/s 0:00:00
link
10 100% 9.77kB/s 0:00:00
linklink
10 100% 9.77kB/s 0:00:00
relfile
14 100% 13.67kB/s 0:00:00
wrote 174 bytes read 540 bytes 204.00 bytes/sec
total size is 72 speedup is 0.10
rsync error: partial transfer (code 23) at /tmp/rsync-2.5.5/main.c(926)
-----------------------------------
My PC filesystem looks the same as it did above.
More information about the rsync
mailing list