#961929 rsync: syntax for multiple files from remote host seems not working when files are in different modules

Package:
rsync
Source:
rsync
Description:
fast, versatile, remote (and local) file-copying tool
Submitter:
furio
Date:
2021-02-08 21:21:02 UTC
Severity:
normal
#961929#5
Date:
2020-05-31 16:28:49 UTC
From:
To:
Dear Maintainer,

I am trying to rsync individually named multiple files using the rsync daemon.

In the ADVANCED USAGE section, the manual page says

	The syntax for requesting multiple files from a remote host is done by
	specifying additional remote-host  args in the same style as the first,
	or with the hostname omitted.  For instance, all these work:

		rsync -av host:file1 :file2 host:file{3,4} /dest/
		rsync -av host::modname/file{1,2} host::modname/file3 /dest/
		rsync -av host::modname/file1 ::modname/file{3,4}

	Older versions of rsync required using quoted spaces in the SRC, like these examples:

		rsync -av host:’dir1/file1 dir2/file2’ /dest
		rsync host::’modname/dir1/file1 modname/dir2/file2’ /dest

I created a test file tree using

	mkdir /home/rsync-test
	mkdir /home/rsync-test/conf
	mkdir /home/rsync-test/files
	mkdir /home/rsync-test/files/a
	mkdir /home/rsync-test/files/b
	echo "file x" > /home/rsync-test/files/a/x
	echo "file y" > /home/rsync-test/files/b/y
	echo "file z" > /home/rsync-test/files/b/z

and then run

	/usr/bin/rsync --daemon --config=/home/rsync-test/conf/rsyncd.conf --address=127.0.0.1

using this rsyncd.conf:
------------------------------------------------------
	use chroot = yes
	[a]
		comment = a folder
		path = /home/rsync-test/files/a
	[b]
		comment = b folder
		path = /home/rsync-test/files/b
------------------------------------------------------

The command

	rsync 127.0.0.1::b/y ::b/z .

runs as expected, synchronizing files y and z with no errors. However, a problem appears when the files are located in different modules:

	rsync 127.0.0.1::b/y ::a/x .

fails with

	rsync: change_dir "/a" (in b) failed: No such file or directory (2)
	rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1677) [generator=3.1.3]

y has been synchronized, but x was not.  The situation remains the same when the host is explicitly added to the second argument. Similarly, adding the quotes (old style syntax) does not help.

Possibly I am misunderstanding something; this behaviour baffles me.

Thanks for the attention

Furio

#961929#10
Date:
2020-05-31 19:26:27 UTC
From:
To:
When using modules, rsync makes a connection to the daemon, and requests
connection to that module. That module specifies a path that is the root
of the transfer, and may also specify exclusions, user and group IDs,
and all sorts of extra settings e.g. lock file, syslog facility, read
only, etc. . It is way too complicated to be able to switch modules on
the fly during one connection, so the specification only allows one
module to be used with an rsync daemon per connection.

You can see that it assumes that "::a/x" means the file "a/x" in the
module already specified: "b", hence the error "change_dir "/a" (in b)
failed:".

There is very little chance of your usage being supported anytime,
simply due to just about any option being able to be set differently per
module. There is also not much advantage in combining usage of more than
one module per connection, there is little overhead compared to an ssh
connection.


Paul

#961929#15
Date:
2020-06-01 12:09:03 UTC
From:
To:
Thank you very much for the explanation.  Taken note, I will work around this limitation.

It may be worth a small note in the documentation.

Something like "all files must be in the same module" or "a connection can access only one module" in the "Advanced Usage" section of rsync(1).

Furio

#961929#20
Date:
2021-02-08 21:17:17 UTC
From:
To:
Hello Kurt,

Thanks for reporting the issue, it doesn't seem to be related to our
packaging of rsync, could you try contacting upstream about it?

Thanks,