directory. It does not, however, ensure that you get a full copy of
all the files (since that may not be possible when the names overlap). A
potentially better solution is to list all the source files and create a
safe list of filenames that you pass to the --files‐from option. Any
files that conflict in name would need to be copied to different desti‐
nation directories using more than one copy.
While a copy of a case‐ignoring filesystem to a case‐ignoring filesystem
can work out fairly well, if no --delete‐during or --delete‐before op‐
tion is active, rsync can potentially update an existing file on the re‐
ceiveing side without noticing that the upper‐/lower‐case of the file‐
name should be changed to match the sender.
ADVANCED USAGE
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 ‐aiv host:file1 :file2 host:file{3,4} /dest/
rsync ‐aiv host::modname/file{1,2} host::modname/extra /dest/
rsync ‐aiv host::modname/first ::extra‐file{1,2} /dest/
Note that a daemon connection only supports accessing one module per
copy command, so if the start of a follow‐up path doesn’t begin with the
modname of the first path, it is assumed to be a path in the module
(such as the extra‐file1 & extra‐file2 that are grabbed above).
Really old versions of rsync (2.6.9 and before) only allowed specifying
one remote‐source arg, so some people have instead relied on the remote‐
shell performing space splitting to break up an arg into multiple paths.
Such unintuitive behavior is no longer supported by default (though you
can request it, as described below).
Starting in 3.2.4, filenames are passed to a remote shell in such a way
as to preserve the characters you give it. Thus, if you ask for a file
with spaces in the name, that’s what the remote rsync looks for:
rsync ‐aiv host:’a simple file.pdf’ /dest/
If you use scripts that have been written to manually apply extra quot‐
ing to the remote rsync args (or to require remote arg splitting), you
can ask rsync to let your script handle the extra escaping. This is
done by either adding the --old‐args option to the rsync runs in the
script (which requires a new rsync) or exporting RSYNC_OLD_ARGS=1 and
RSYNC_PROTECT_ARGS=0 (which works with old or new rsync versions).
CONNECTING TO AN RSYNC DAEMON
It is also possible to use rsync without a remote shell as the trans‐
port. In this case you will directly connect to a remote rsync daemon,
typically using TCP port 873. (This obviously requires the daemon to be
running on the remote system, so refer to the STARTING AN RSYNC DAEMON
TO ACCEPT CONNECTIONS section below for information on that.)
Using rsync in this way is the same as using it with a remote shell ex‐
cept that:
o Use either double‐colon syntax or rsync:// URL syntax instead of
the single‐colon (remote shell) syntax.
o The first element of the "path" is actually a module name.
o Additional remote source args can use an abbreviated syntax that
omits the hostname and/or the module name, as discussed in AD‐
VANCED USAGE.
o The remote daemon may print a "message of the day" when you con‐
nect.
o If you specify only the host (with no module or path) then a list
of accessible modules on the daemon is output.
o If you specify a remote source path but no destination, a listing
of the matching files on the remote daemon is