rsync icon indicating copy to clipboard operation
rsync copied to clipboard

rsync 3.2.7 Failed to synchronize the soft connection file. Procedure

Open sunwenbo opened this issue 2 years ago • 12 comments

This is my server file (base) root@node001:/home/sunwenbo# ls -lh total 8.0K drwxr-xr-x 2 root root 4.0K Nov 23 18:51 1111 -rw-r--r-- 1 root root 0 Nov 23 19:00 123 drwxr-xr-x 2 root root 4.0K Nov 23 19:11 2222 lrwxrwxrwx 1 root root 4 Nov 23 19:23 3333 -> 1111 lrwxrwxrwx 1 root root 18 Nov 23 19:31 4444 -> /tmp/sunwenbo-test (base) root@node001:/home/sunwenbo#

**This is my client ** root@master1/mnt# rsync -avzLP --password-file=/etc/rsyncd.secrets [email protected]::sunwenbo/123 . receiving incremental file list

sent 24 bytes received 49 bytes 48.67 bytes/sec total size is 0 speedup is 0.00 root@master1/mnt# rsync -avzLP --password-file=/etc/rsyncd.secrets [email protected]::sunwenbo/4444 . receiving incremental file list rsync: link_stat "/4444" (in sunwenbo) failed: No such file or directory (2)

sent 8 bytes received 96 bytes 69.33 bytes/sec total size is 0 speedup is 0.00 rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1865) [Receiver=3.2.7]

I have tried to create a soft link file to point to the directory or file in the current directory, this time the client to synchronize the data is no problem, but what is the point root@master1/mnt# rsync -avzLP --password-file=/etc/rsyncd.secrets [email protected]::sunwenbo/3333 . receiving incremental file list

sent 29 bytes received 59 bytes 58.67 bytes/sec total size is 0 speedup is 0.00

sunwenbo avatar Nov 23 '23 11:11 sunwenbo

Hi,

I think your problem is that you're using options which should not be used together:

-a translates to -rlptgoD

So in fact you have -l and -L, which the man page says:

       --links, -l              copy symlinks as symlinks
       --copy-links, -L         transform symlink into referent file/dir

To use both of these doesn't make any sense IMHO.

Regards, Simon

realsimix avatar Nov 24 '23 08:11 realsimix

你好,

我认为你的问题是你使用的选项不应该一起使用:

-a翻译为-rlptgoD

所以实际上你有 -l 和 -L,手册页上说:

       --links, -l              copy symlinks as symlinks
       --copy-links, -L         transform symlink into referent file/dir

恕我直言,使用这两者没有任何意义。

问候, 西蒙 Thank you for your reply! After receiving your reply, it is indeed the problem you said. Now I want to synchronize the soft connection file of rsync server to my client. What combination parameters should I use?

sunwenbo avatar Nov 24 '23 08:11 sunwenbo

I'm not exactly sure what you mean but you may use one of the two below:

-avzP
-rLptgoDvzP

They do almost the same but the first copies symlinks as symlinks and the second resolves the symlink and copies the referenced file instead.

realsimix avatar Nov 24 '23 09:11 realsimix

According to your prompt information, I use the following two methods, but there are still problems

image

sunwenbo avatar Nov 24 '23 09:11 sunwenbo

Does the file /tmp/sunwenbo-test exist and is readable by the rsync daemon on the source system?

realsimix avatar Nov 24 '23 09:11 realsimix

image

The file does exist, but in the /tmp directory, the path to my rsync.conf module is as follows

image

sunwenbo avatar Nov 24 '23 09:11 sunwenbo

Is it because the /tmp/sunwenbo-test directory is not in the module of the rsync.conf configuration file?

sunwenbo avatar Nov 24 '23 09:11 sunwenbo

I'm quite sure rsync in daemon mode won't allow you to fetch a file which is outside your module. That would be a security problem because you can then just create symlinks to files where you don't have access to.

realsimix avatar Nov 24 '23 09:11 realsimix

This is discussed here https://rsync.samba.org/security.html

realsimix avatar Nov 24 '23 09:11 realsimix

I'm quite sure rsync in daemon mode won't allow you to fetch a file which is outside your module. That would be a security problem because you can then just create symlinks to files where you don't have access to.

Thanks again for your support, so the conclusion is that the soft link file I want to copy must also be inside the rsync daemon module, is that right

sunwenbo avatar Nov 24 '23 09:11 sunwenbo

I think so, yes.

realsimix avatar Nov 24 '23 12:11 realsimix

thank you~

sunwenbo avatar Nov 24 '23 13:11 sunwenbo