Beginning in version 2.6.4, multiple --link‐dest directories may
be provided, which will cause rsync to search the list in the or‐
der specified for an exact match (there is a limit of 20 such di‐
rectories). If a match is found that differs only in attributes,
a local copy is made and the attributes updated. If a match is
not found, a basis file from one of the DIRs will be selected to
try to speed up the transfer.
This option works best when copying into an empty destination hi‐
erarchy, as existing files may get their attributes tweaked, and
that can affect alternate destination files via hard‐links.
Also, itemizing of changes can get a bit muddled. Note that
prior to version 3.1.0, an alternate‐directory exact match would
never be found (nor linked into the destination) when a destina‐
tion file already exists.
Note that if you combine this option with --ignore‐times, rsync
will not link any files together because it only links identical
files together as a substitute for transferring the file, never
as an additional check after the file is updated.
If DIR is a relative path, it is relative to the destination di‐
rectory. See also --compare‐dest and --copy‐dest.
Note that rsync versions prior to 2.6.1 had a bug that could pre‐
vent --link‐dest from working properly for a non‐super‐user when
--owner (-o) was specified (or implied). You can work‐around
this bug by avoiding the -o option (or using --no‐o) when sending
to an old rsync.
--compress, -z
With this option, rsync compresses the file data as it is sent to
the destination machine, which reduces the amount of data being
transmitted -- something that is useful over a slow connection.
Rsync supports multiple compression methods and will choose one
for you unless you force the choice using the --compress‐choice
(--zc) option.
Run rsync --version to see the default compress list compiled
into your version.
When both sides of the transfer are at least 3.2.0, rsync chooses
the first algorithm in the client’s list of choices that is also
in the server’s list of choices. If no common compress choice is
found, rsync exits with an error. If the remote rsync is too old
to support checksum negotiation, its list is assumed to be
"zlib".
The default order can be customized by setting the environment
variable RSYNC_COMPRESS_LIST to a space‐separated list of accept‐
able compression names. If the string contains a "&" character,
it is separated into the "client string & server string", other‐
wise the same string applies to both. If the string (or string
portion) contains no non‐whitespace characters, the default com‐
press list is used. Any unknown compression names are discarded
from the list, but a list with only invalid names results in a
failed negotiation.
There are some older rsync versions that were configured to re‐
ject a -z option and require the use of -zz because their com‐
pression library was not compatible with the default zlib com‐
pression method. You can usually ignore this weirdness unless
the rsync server complains and tells you to specify -zz.
--compress‐choice=STR, --zc=STR
This option can be used to override the automatic negotiation