The Samba-Bugzilla – Bug 3241
Multiple source to dest transfers in one invocation (to same host)
Last modified: 2006-03-12 02:56:58 UTC
At the moment I might run two rsync commands:
% rsync file1 remotehost:/a/
% rsync file2 file3 remotehost:/b/
This means making two connections to remotehost. If I wanted to copy all the
files to the same directory on remotehost then of course I'd write a single
rsync command, and this would be faster. But if they are going to different
directories then I must invoke rsync twice, even though it's the same
It would be nice (especially when copying to remote sites with high network
latency) to have a single rsync command do multiple copies, even if you don't
want a single destination directory on the remote host. I would suggest some
% rsync --to remotehost:/a/ file1 --to remotehost:/b/ file2 file3
rsync would connect once to remotehost and then transfer file1, file2 and file3
to the appropriate places.
I have seen feature requests to make rsync copy the same file to several
different hosts, and I've looked at batch mode in the documentation, but I think
this feature request is different.
You can do this using --relative and a little trickery:
ln -s /srcdir a
ln -s /srcdir b
rsync -avR --no-implied-dirs a/file1 b/file2 b/file3 remotehost:/
That may not be as convenient as supporting multiple destinations, but it does have the benefit of working right now.
I don't think that the change you suggested is likely to ever happen.