Bug 3241 - Multiple source to dest transfers in one invocation (to same host)
Summary: Multiple source to dest transfers in one invocation (to same host)
Status: CLOSED WONTFIX
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 2.6.6
Hardware: All Linux
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-04 03:46 UTC by Ed Avis
Modified: 2006-03-12 02:56 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Avis 2005-11-04 03:46:12 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
destination host.

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
syntax like

% 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.
Comment 1 Wayne Davison 2006-02-01 20:05:56 UTC
You can do this using --relative and a little trickery:

cd /emptydir
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.