Home Explore Blog CI



man-pages

54th chunk of `rsync.man`
5973fbbc7b0f10dc27fe7fb4b4baf9ebe8cf55f88cafb7a30000000100000fe4
 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  of
              the  compression  algorithm  that occurs when --compress is used.
              The option implies --compress unless "none" was specified,  which
              instead implies --no‐compress.

              The compression options that you may be able to use are:

              o      zstd

              o      lz4

              o      zlibx

              o      zlib

              o      none

              Run  rsync --version  to  see  the default compress list compiled
              into your version (which may differ from the list above).

              Note that if you see an error about an  option  named  --old‐com‐
              press  or --new‐compress, this is rsync trying to send the --com‐
              press‐choice=zlib or --compress‐choice=zlibx option  in  a  back‐
              ward‐compatible manner that more rsync versions understand.  This
              error  indicates  that the older rsync version on the server will
              not allow you to force the compression type.

              Note that the "zlibx" compression algorithm is  just  the  "zlib"
              algorithm  with matched data excluded from the compression stream
              (to try to make it more compatible with an external  zlib  imple‐
              mentation).

       --compress‐level=NUM, --zl=NUM
              Explicitly  set the compression level to use (see --compress, -z)
              instead of letting it default.  The --compress option is  implied
              as  long  as the level chosen is not a "don’t compress" level for
              the compression algorithm that is in effect (e.g.  zlib  compres‐
              sion treats level 0 as "off").

              The  level  values vary depending on the checksum in effect.  Be‐
              cause rsync will negotiate a checksum choice by default (when the
              remote rsync is new enough), it can be good to combine  this  op‐
              tion with a --compress‐choice (--zc) option unless you’re sure of
              the choice in effect.  For example:

                  rsync ‐aiv ‐‐zc=zstd ‐‐zl=22 host:src/ dest/

              For  zlib  &  zlibx  compression the valid values are from 1 to 9
              with 6 being the default.  Specifying  --zl=0  turns  compression
              off, and specifying --zl=-1 chooses the default level of 6.

              For zstd compression the valid values are from -131072 to 22 with
              3 being the default. Specifying 0 chooses the default of 3.

              For  lz4  compression there are no levels, so the value is always
              0.

              If you specify a too‐large or  too‐small  value,  the  number  is
              silently  limited  to  a valid value.  This allows you to specify
              something like --zl=999999999 and be assured that you’ll  end  up
              with  the  maximum compression level no matter what algorithm was
              chosen.

              If you want to know

Title: Rsync Options: --compress-choice, --zc, and --compress-level, --zl
Summary
This section details the `--compress-choice` or `--zc` option, used to override the automatic compression algorithm negotiation when `--compress` is used. It lists available compression options like zstd, lz4, zlibx, zlib, and none. It also explains an error related to `--old-compress` or `--new-compress`. The section then describes the `--compress-level` or `--zl` option, which allows setting a specific compression level instead of using the default. It emphasizes combining this with `--compress-choice` for predictable results and provides level value ranges for different compression algorithms (zlib, zstd, lz4).