Tweak the --zz option to --zc (aka --compress-choice).
[rsync.git] / rsync.yo
index 897182860d4f483d46d2633ee781a0d98bb5472b..37421c94c53a65cd7387cd1ad176e38138ea82b6 100644 (file)
--- a/rsync.yo
+++ b/rsync.yo
@@ -1,5 +1,5 @@
 mailto(rsync-bugs@samba.org)
-manpage(rsync)(1)(21 Dec 2015)()()
+manpage(rsync)(1)(28 Jan 2018)()()
 manpagename(rsync)(a fast, versatile, remote (and local) file-copying tool)
 manpagesynopsis()
 
@@ -76,7 +76,7 @@ server, but a server can be either a daemon or a remote-shell spawned process.
 
 manpagesection(SETUP)
 
-See the file README for installation instructions.
+See the file README.md for installation instructions.
 
 Once installed, you can use rsync to any machine that you can access via
 a remote shell (as well as some that you can access using the rsync
@@ -200,7 +200,9 @@ itemization(
        list of accessible paths on the daemon will be shown.
        it() if you specify no local destination then a listing of the
        specified files on the remote daemon is provided.
-       it() you must not specify the bf(--rsh) (bf(-e)) option.
+       it() you must not specify the bf(--rsh) (bf(-e)) option (since
+       that overrides the daemon connection to use ssh -- see USING
+       RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION below).
 )
 
 An example that copies all the files in a remote module named "src":
@@ -230,12 +232,16 @@ example:
 
 verb(  export RSYNC_CONNECT_PROG='ssh proxyhost nc %H 873'
   rsync -av targethost1::module/src/ /dest/
-  rsync -av rsync:://targethost2/module/src/ /dest/ )
+  rsync -av rsync://targethost2/module/src/ /dest/ )
 
 The command specified above uses ssh to run nc (netcat) on a proxyhost,
 which forwards all data to port 873 (the rsync daemon) on the targethost
 (%H).
 
+Note also that if the RSYNC_SHELL environment variable is set, that
+program will be used to run the RSYNC_CONNECT_PROG command instead of
+using the default shell of the code(system()) call.
+
 manpagesection(USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION)
 
 It is sometimes useful to use various features of an rsync daemon (such as
@@ -372,14 +378,18 @@ to the detailed description below for a complete description.  verb(
      --specials              preserve special files
  -D                          same as --devices --specials
  -t, --times                 preserve modification times
+ -U, --atimes                preserve access (use) times
+     --open-noatime          avoid changing the atime on opened files
  -O, --omit-dir-times        omit directories from --times
  -J, --omit-link-times       omit symlinks from --times
      --super                 receiver attempts super-user activities
      --fake-super            store/recover privileged attrs using xattrs
- -S, --sparse                handle sparse files efficiently
+ -S, --sparse                turn sequences of nulls into sparse blocks
      --preallocate           allocate dest files before writing
+     --write-devices         write to devices as files (implies --inplace)
  -n, --dry-run               perform a trial run with no changes made
  -W, --whole-file            copy files whole (w/o delta-xfer algorithm)
+     --checksum-choice=STR   choose the checksum algorithms
  -x, --one-file-system       don't cross filesystem boundaries
  -B, --block-size=SIZE       force a fixed checksum block-size
  -e, --rsh=COMMAND           specify the remote shell to use
@@ -433,6 +443,7 @@ to the detailed description below for a complete description.  verb(
      --files-from=FILE       read list of source-file names from FILE
  -0, --from0                 all *from/filter files are delimited by 0s
  -s, --protect-args          no space-splitting; wildcard chars only
+     --copy-as=USER[:GROUP]  specify user & optional group for the copy
      --address=ADDRESS       bind address for outgoing socket to daemon
      --port=PORT             specify double-colon alternate port number
      --sockopts=OPTIONS      specify custom TCP options
@@ -493,7 +504,8 @@ command-line parsing.  Keep in mind that a leading tilde (~) in a filename is
 substituted by your shell, so --option=~/foo will not change the tilde into
 your home directory (remove the '=' for that).
 
-startdit()
+description(
+
 dit(bf(--help)) Print a short help page describing the options
 available in rsync and exit.  For backward-compatibility with older
 versions of rsync, the help will also be output if you use the bf(-h)
@@ -561,10 +573,14 @@ verb(    rsync -avvv --debug=none src/ dest/
 Note that some debug messages will only be output when bf(--msgs2stderr) is
 specified, especially those pertaining to I/O and buffer debugging.
 
-This option was added to 3.1.0, so an older rsync on the server side might
-reject your attempts at fine-grained control (if one or more flags needed
-to be send to the server and the server was too old to understand them).
-See also the "max verbosity" caveat above when dealing with a daemon.
+Beginning in 3.2.0, this option is no longer auto-forwared to the server side
+in order to allow you to specify different debug values for each side of the
+transfer, as well as to specify a new debug option that is only present in one
+of the rsync versions.  If you want to duplicate the same option on both sides,
+using brace expansion is an easy way to save you some typing. This works in
+zsh and bash:
+
+verb(    rsync -aiv {-M,}--debug=del2 src/ dest/ )
 
 dit(bf(--msgs2stderr)) This option changes rsync to send all its output
 directly to stderr rather than to send messages to the client side via the
@@ -616,8 +632,8 @@ resolution (allowing times to differ from the original by up to 1 second).
 If you want all your transfers to default to comparing nanoseconds, you can
 create a ~/.popt file and put these lines in it:
 
-quote(tt(   rsync alias -a -a@-1))
-quote(tt(   rsync alias -t -t@-1))
+verb(    rsync alias -a -a@-1)
+verb(    rsync alias -t -t@-1)
 
 With that as the default, you'd need to specify bf(--modify-window=0) (aka
 bf(-@0)) to override it and ignore nanoseconds, e.g. if you're copying between
@@ -645,8 +661,9 @@ checksum that is generated as the file is transferred, but that
 automatic after-the-transfer verification has nothing to do with this
 option's before-the-transfer "Does this file need to be updated?" check.
 
-For protocol 30 and beyond (first supported in 3.0.0), the checksum used is
-MD5.  For older protocols, the checksum used is MD4.
+The checksum used is auto-negotiated between the client and the server, but
+can be overridden using either the bf(--checksum-choice) option or an
+environment variable that is discussed in that option's section.
 
 dit(bf(-a, --archive)) This is equivalent to bf(-rlptgoD). It is a quick
 way of saying you want recursion and want to preserve almost
@@ -705,12 +722,12 @@ just the last parts of the filenames. This is particularly useful when
 you want to send several different directories at the same time. For
 example, if you used this command:
 
-quote(tt(   rsync -av /foo/bar/baz.c remote:/tmp/))
+verb(    rsync -av /foo/bar/baz.c remote:/tmp/)
 
 ... this would create a file named baz.c in /tmp/ on the remote
 machine. If instead you used
 
-quote(tt(   rsync -avR /foo/bar/baz.c remote:/tmp/))
+verb(    rsync -avR /foo/bar/baz.c remote:/tmp/)
 
 then a file named /tmp/foo/bar/baz.c would be created on the remote
 machine, preserving its full path.  These extra path elements are called
@@ -731,24 +748,22 @@ implied directories for each path you specify.  With a modern rsync on the
 sending side (beginning with 2.6.7), you can insert a dot and a slash into
 the source path, like this:
 
-quote(tt(   rsync -avR /foo/./bar/baz.c remote:/tmp/))
+verb(    rsync -avR /foo/./bar/baz.c remote:/tmp/)
 
 That would create /tmp/bar/baz.c on the remote machine.  (Note that the
 dot must be followed by a slash, so "/foo/." would not be abbreviated.)
 For older rsync versions, you would need to use a chdir to limit the
 source path.  For example, when pushing files:
 
-quote(tt(   (cd /foo; rsync -avR bar/baz.c remote:/tmp/) ))
+verb(    (cd /foo; rsync -avR bar/baz.c remote:/tmp/) )
 
 (Note that the parens put the two commands into a sub-shell, so that the
 "cd" command doesn't remain in effect for future commands.)
 If you're pulling files from an older rsync, use this idiom (but only
 for a non-daemon transfer):
 
-quote(
-tt(   rsync -avR --rsync-path="cd /foo; rsync" \ )nl()
-tt(       remote:bar/baz.c /tmp/)
-)
+verb(  rsync -avR --rsync-path="cd /foo; rsync" \ )
+verb(       remote:bar/baz.c /tmp/)
 
 dit(bf(--no-implied-dirs)) This option affects the default behavior of the
 bf(--relative) option.  When it is specified, the attributes of the implied
@@ -780,7 +795,7 @@ backup file goes and what (if any) suffix gets appended using the
 bf(--backup-dir) and bf(--suffix) options.
 
 Note that if you don't specify bf(--backup-dir), (1) the
-bf(--omit-dir-times) option will be implied, and (2) if bf(--delete) is
+bf(--omit-dir-times) option will be forced on, and (2) if bf(--delete) is
 also in effect (without bf(--delete-excluded)), rsync will add a "protect"
 filter-rule for the backup suffix to the end of all your existing excludes
 (e.g. bf(-f "P *~")).  This will prevent previously backed-up files from being
@@ -872,9 +887,7 @@ the same or longer than the size on the sender, the file is skipped.  This
 does not interfere with the updating of a file's non-content attributes
 (e.g. permissions, ownership, etc.) when the file does not need to be
 transferred, nor does it affect the updating of any non-regular files.
-Implies bf(--inplace),
-but does not conflict with bf(--sparse) (since it is always extending a
-file's length).
+Implies bf(--inplace).
 
 The use of bf(--append) can be dangerous if you aren't 100% sure that the files
 that are longer have only grown by the appending of data onto the end.  You
@@ -885,7 +898,9 @@ dit(bf(--append-verify)) This works just like the bf(--append) option, but
 the existing data on the receiving side is included in the full-file
 checksum verification step, which will cause a file to be resent if the
 final verification step fails (rsync uses a normal, non-appending
-bf(--inplace) transfer for the resend).
+bf(--inplace) transfer for the resend). It otherwise has the exact same
+caveats for files that have not grown larger, so don't use this for a
+general copy.
 
 Note: prior to rsync 3.0.0, the bf(--append) option worked like
 bf(--append-verify), so if you are interacting with an older rsync (or the
@@ -910,6 +925,9 @@ There is also a backward-compatibility helper option, bf(--old-dirs) (or
 bf(--old-d)) that tells rsync to use a hack of "-r --exclude='/*/*'" to get
 an older rsync to list a single directory without recursing.
 
+)
+description(
+
 dit(bf(-l, --links)) When symlinks are encountered, recreate the
 symlink on the destination.
 
@@ -928,6 +946,14 @@ are also treated like ordinary files, and so are any symlinks in the
 source path itself when bf(--relative) is used.  This option has no
 additional effect if bf(--copy-links) was also specified.
 
+Note that the cut-off point is the top of the transfer, which is the part of
+the path that rsync isn't mentioning in the verbose output.  If you copy
+"/src/subdir" to "/dest/" then the "subdir" directory is a name inside the
+transfer tree, not the top of the transfer (which is /src) so it is legal for
+created relative symlinks to refer to other names inside the /src and /dest
+directories. If you instead copy "/src/subdir/" (with a trailing slash) to
+"/dest/subdir" that would not allow symlinks to any files outside of "subdir".
+
 dit(bf(--safe-links)) This tells rsync to ignore any symbolic links
 which point outside the copied tree. All absolute symlinks are
 also ignored. Using this option in conjunction with bf(--relative) may
@@ -976,6 +1002,9 @@ This works because rsync calls bf(lstat)(2) on the source arg as given, and the
 trailing slash makes bf(lstat)(2) follow the symlink, giving rise to a directory
 in the file-list which overrides the symlink found during the scan of "src/./".
 
+)
+description(
+
 dit(bf(-K, --keep-dirlinks)) This option causes the receiving side to treat
 a symlink to a directory as though it were a real directory, but only if it
 matches a real directory from the sender.  Without this option, the
@@ -1068,11 +1097,11 @@ behavior easier to type, you could define a popt alias for it, such as
 putting this line in the file ~/.popt (the following defines the bf(-Z) option,
 and includes --no-g to use the default group of the destination dir):
 
-quote(tt(   rsync alias -Z --no-p --no-g --chmod=ugo=rwX))
+verb(    rsync alias -Z --no-p --no-g --chmod=ugo=rwX)
 
 You could then use this new option in a command such as this one:
 
-quote(tt(   rsync -avZ src/ dest/))
+verb(    rsync -avZ src/ dest/)
 
 (Caveat: make sure that bf(-a) does not follow bf(-Z), or it will re-enable
 the two "--no-*" options mentioned above.)
@@ -1119,9 +1148,27 @@ super-user copies all namespaces except system.*.  A normal user only copies
 the user.* namespace.  To be able to backup and restore non-user namespaces as
 a normal user, see the bf(--fake-super) option.
 
-Note that this option does not copy rsyncs special xattr values (e.g. those
-used by bf(--fake-super)) unless you repeat the option (e.g. -XX).  This
-"copy all xattrs" mode cannot be used with bf(--fake-super).
+The above name filtering can be overridden by using one or more filter options
+with the bf(x) modifier. When you specify an xattr-affecting filter rule, rsync
+requires that you do your own system/user filtering, as well as any additional
+filtering for what xattr names are copied and what names are allowed to be
+deleted.  For example, to skip the system namespace, you could specify:
+
+quote(--filter='-x system.*')
+
+To skip all namespaces except the user namespace, you could specify a
+negated-user match:
+
+quote(--filter='-x! user.*')
+
+To prevent any attributes from being deleted, you could specify a receiver-only
+rule that excludes all names:
+
+quote(--filter='-xr *')
+
+Note that the bf(-X) option does not copy rsync's special xattr values (e.g.
+those used by bf(--fake-super)) unless you repeat the option (e.g. -XX).
+This "copy all xattrs" mode cannot be used with bf(--fake-super).
 
 dit(bf(--chmod)) This option tells rsync to apply one or more
 comma-separated "chmod" modes to the permission of the files in the
@@ -1182,6 +1229,16 @@ such as named sockets and fifos.
 
 dit(bf(-D)) The bf(-D) option is equivalent to bf(--devices) bf(--specials).
 
+dit(bf(--write-devices)) This tells rsync to treat a device on the receiving
+side as a regular file, allowing the writing of file data into a device.
+
+This option implies the bf(--inplace) option.
+
+Be careful using this, as you should know what devices are present on the
+receiving side of the transfer, especially if running rsync as root.
+
+This option is refused by an rsync daemon.
+
 dit(bf(-t, --times)) This tells rsync to transfer modification times along
 with the files and update them on the remote system.  Note that if this
 option is not used, the optimization that excludes files that have not been
@@ -1190,6 +1247,25 @@ cause the next transfer to behave as if it used bf(-I), causing all files to be
 updated (though rsync's delta-transfer algorithm will make the update fairly efficient
 if the files haven't actually changed, you're much better off using bf(-t)).
 
+dit(bf(-U, --atimes)) This tells rsync to set the access (use) times of the
+destination files to the same value as the source files.
+
+If repeated, it also sets the bf(--open-noatime) option, which can help you
+to make the sending and receiving systems have the same access times on the
+transferred files without needing to run rsync an extra time after a file is
+transferred.
+
+Note that some older rsync versions (prior to 3.2.0) may have been built with
+a pre-release bf(--atimes) patch that does not imply bf(--open-noatime) when
+this option is repeated.
+
+dit(bf(--open-noatime)) This tells rsync to open files with the O_NOATIME
+flag (on systems that support it) to avoid changing the access time of the
+files that are being transferred. If your OS does not support the O_NOATIME
+flag then rsync will silently ignore this option. Note also that some
+filesystems are mounted to avoid updating the atime on read access even
+without the O_NOATIME flag being set.
+
 dit(bf(-O, --omit-dir-times)) This tells rsync to omit directories when
 it is preserving modification times (see bf(--times)).  If NFS is sharing
 the directories on the receiving side, it is a good idea to use bf(-O).
@@ -1238,7 +1314,7 @@ The bf(--fake-super) option only affects the side where the option is used.
 To affect the remote side of a remote-shell connection, use the
 bf(--remote-option) (bf(-M)) option:
 
-quote(tt(  rsync -av -M--fake-super /src/ host:/dest/))
+verb(    rsync -av -M--fake-super /src/ host:/dest/)
 
 For a local copy, this option affects both the source and the destination.
 If you wish a local copy to enable this option just for the destination
@@ -1251,20 +1327,30 @@ This option is overridden by both bf(--super) and bf(--no-super).
 See also the "fake super" setting in the daemon's rsyncd.conf file.
 
 dit(bf(-S, --sparse)) Try to handle sparse files efficiently so they take
-up less space on the destination.  Conflicts with bf(--inplace) because it's
-not possible to overwrite data in a sparse fashion.
+up less space on the destination.  If combined with bf(--inplace) the
+file created might not end up with sparse blocks with some combinations
+of kernel version and/or filesystem type.  If bf(--whole-file) is in
+effect (e.g. for a local copy) then it will always work because rsync
+truncates the file prior to writing out the updated version.
+
+Note that versions of rsync older than 3.1.3 will reject the combination of
+bf(--sparse) and bf(--inplace).
 
 dit(bf(--preallocate)) This tells the receiver to allocate each destination
-file to its eventual size before writing data to the file.  Rsync will only use
-the real filesystem-level preallocation support provided by Linux's
+file to its eventual size before writing data to the file.  Rsync will only
+use the real filesystem-level preallocation support provided by Linux's
 bf(fallocate)(2) system call or Cygwin's bf(posix_fallocate)(3), not the slow
-glibc implementation that writes a zero byte into each block.
+glibc implementation that writes a null byte into each block.
 
 Without this option, larger files may not be entirely contiguous on the
 filesystem, but with this option rsync will probably copy more slowly.  If the
 destination is not an extent-supporting filesystem (such as ext4, xfs, NTFS,
 etc.), this option may have no positive effect at all.
 
+If combined with bf(--sparse), the file will only have sparse blocks (as
+opposed to allocated sequences of null bytes) if the kernel version and
+filesystem type support creating holes in the allocated data.
+
 dit(bf(-n, --dry-run)) This makes rsync perform a trial run that doesn't
 make any changes (and produces mostly the same output as a real run).  It
 is most commonly used in combination with the bf(-v, --verbose) and/or
@@ -1280,14 +1366,50 @@ the "bytes sent", "bytes received", "literal data", and "matched data"
 statistics are too small, and the "speedup" value is equivalent to a run
 where no file transfers were needed.
 
-dit(bf(-W, --whole-file)) With this option rsync's delta-transfer algorithm
-is not used and the whole file is sent as-is instead.  The transfer may be
+dit(bf(-W, --whole-file)) This option disables rsync's delta-transfer algorithm,
+which causes all transferred files to be sent whole.  The transfer may be
 faster if this option is used when the bandwidth between the source and
 destination machines is higher than the bandwidth to disk (especially when the
 "disk" is actually a networked filesystem).  This is the default when both
 the source and destination are specified as local paths, but only if no
 batch-writing option is in effect.
 
+dit(bf(--checksum-choice=STR, --cc=STR)) This option overrides the checksum algorithms.
+If one algorithm name is specified, it is used for both the transfer checksums
+and (assuming bf(--checksum) is specified) the pre-transfer checksums. If two
+comma-separated names are supplied, the first name affects the transfer
+checksums, and the second name affects the pre-transfer checksums (bf(-c)).
+
+The algorithm choices are "auto", "xxh64" (aka "xxhash"), "MD5", "MD4", and "none".
+
+If "none" is specified for the first (or only) name, the bf(--whole-file) option
+is forced on and no checksum verification is performed on the transferred data.
+If "none" is specified for the second (or only) name, the bf(--checksum) option
+cannot be used.
+
+The "auto" option is the default, where rsync bases its algorithm choice on a
+negotation between the client and the server as follows:
+
+If both the client and the server are at least version 3.2.0, they will
+exchange a list of checksum names and choose the first one in the list that
+they have in common.
+This typically means that they will choose xxh64 if they both support it
+and fall back to MD5.
+If one side of the transfer is not new enough to support this checksum
+negotation, then a value is chosen based on the protocol version (which
+chooses between MD5 and various flavors of MD4 based on protocol age).
+
+You can also override the checksum using the RSYNC_CHECKSUM_LIST environment
+variable by setting it to a space-separated list of checksum names that you
+consider acceptable. If no common checksum is found, the client exits with an
+error. This method does not allow you to specify the transfer checksum
+separately from the pre-transfer checksum, and it ignores "auto" and all
+unknown checksum names.  If the remote rsync is not new enough to handle a
+checksum negotiation list, the list is silently ignored unless it contains the
+string "FAIL".
+
+The use of the bf(--checksum-choice) option overrides this environment list.
+
 dit(bf(-x, --one-file-system)) This tells rsync to avoid crossing a
 filesystem boundary when recursing.  This does not limit the user's ability
 to specify items to copy from multiple filesystems, just rsync's recursion
@@ -1306,6 +1428,9 @@ bf(--copy-unsafe-links)), a symlink to a directory on another device is
 treated like a mount-point.  Symlinks to non-directories are unaffected
 by this option.
 
+)
+description(
+
 dit(bf(--existing, --ignore-non-existing)) This tells rsync to skip
 creating files (including directories) that do not exist
 yet on the destination.  If this option is
@@ -1327,7 +1452,7 @@ It just limits the files that the receiver requests to be transferred.
 This option can be useful for those doing backups using the bf(--link-dest)
 option when they need to continue a backup run that got interrupted.  Since
 a bf(--link-dest) run is copied into a new directory hierarchy (when it is
-used properly), using bf(--ignore existing) will ensure that the
+used properly), using bf(--ignore-existing) will ensure that the
 already-handled files don't get tweaked (which avoids a change in
 permissions on the hard-linked files).  This does mean that this option
 is only looking at the existing files in the destination hierarchy itself.
@@ -1518,6 +1643,15 @@ shell connection, rather than through a direct socket connection to a
 running rsync daemon on the remote host.  See the section "USING
 RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION" above.
 
+Beginning with rsync 3.2.0, the RSYNC_PORT environment variable will be
+set when a daemon connection is being made via a remote-shell
+connection.  It is set to 0 if the default daemon port is being assumed,
+or it is set to the value of the rsync port that was specified via
+either the bf(--port) option or a non-empty port value in an rsync://
+URL.  This allows the script to discern if a non-default port is being
+requested, allowing for things such as an SSL or stunnel helper script
+to connect to a default or alternate port.
+
 Command-line arguments are permitted in COMMAND provided that COMMAND is
 presented to rsync as a single argument.  You must use spaces (not tabs
 or other whitespace) to separate the command and args from each other,
@@ -1527,10 +1661,8 @@ inside a single-quoted string gives you a single-quote; likewise for
 double-quotes (though you need to pay attention to which quotes your
 shell is parsing and which quotes rsync is parsing).  Some examples:
 
-quote(
-tt(    -e 'ssh -p 2234')nl()
-tt(    -e 'ssh -o "ProxyCommand nohup ssh firewall nc -w1 %h %p"')nl()
-)
+verb(    -e 'ssh -p 2234')
+verb(    -e 'ssh -o "ProxyCommand nohup ssh firewall nc -w1 %h %p"')
 
 (Note that ssh users can alternately customize site-specific connect
 options in their .ssh/config file.)
@@ -1551,27 +1683,27 @@ communicate.
 One tricky example is to set a different default directory on the remote
 machine for use with the bf(--relative) option.  For instance:
 
-quote(tt(    rsync -avR --rsync-path="cd /a/b && rsync" host:c/d /e/))
+verb(    rsync -avR --rsync-path="cd /a/b && rsync" host:c/d /e/)
 
 dit(bf(-M, --remote-option=OPTION)) This option is used for more advanced
 situations where you want certain effects to be limited to one side of the
 transfer only.  For instance, if you want to pass bf(--log-file=FILE) and
 bf(--fake-super) to the remote system, specify it like this:
 
-quote(tt(    rsync -av -M --log-file=foo -M--fake-super src/ dest/))
+verb(    rsync -av -M --log-file=foo -M--fake-super src/ dest/)
 
 If you want to have an option affect only the local side of a transfer when
 it normally affects both sides, send its negation to the remote side.  Like
 this:
 
-quote(tt(    rsync -av -x -M--no-x src/ dest/))
+verb(    rsync -av -x -M--no-x src/ dest/)
 
 Be cautious using this, as it is possible to toggle an option that will cause
 rsync to have a different idea about what data to expect next over the socket,
 and that will make it fail in a cryptic fashion.
 
 Note that it is best to use a separate bf(--remote-option) for each option you
-want to pass.  This makes your useage compatible with the bf(--protect-args)
+want to pass.  This makes your usage compatible with the bf(--protect-args)
 option.  If that option is off, any spaces in your remote options will be split
 by the remote shell unless you take steps to protect them.
 
@@ -1580,7 +1712,7 @@ When performing a local transfer, the "local" side is the sender and the
 
 Note some versions of the popt option-parsing library have a bug in them that
 prevents you from using an adjacent arg with an equal in it next to a short
-option letter (e.g. tt(-M--log-file=/tmp/foo).  If this bug affects your
+option letter (e.g. tt(-M--log-file=/tmp/foo)).  If this bug affects your
 version of popt, you can use the version of popt that is included with rsync.
 
 dit(bf(-C, --cvs-exclude)) This is a useful shorthand for excluding a
@@ -1631,14 +1763,14 @@ See the FILTER RULES section for detailed information on this option.
 dit(bf(-F)) The bf(-F) option is a shorthand for adding two bf(--filter) rules to
 your command.  The first time it is used is a shorthand for this rule:
 
-quote(tt(   --filter='dir-merge /.rsync-filter'))
+verb(    --filter='dir-merge /.rsync-filter')
 
 This tells rsync to look for per-directory .rsync-filter files that have
 been sprinkled through the hierarchy and use their rules to filter the
 files in the transfer.  If bf(-F) is repeated, it is a shorthand for this
 rule:
 
-quote(tt(   --filter='exclude .rsync-filter'))
+verb(    --filter='exclude .rsync-filter')
 
 This filters out the .rsync-filter files themselves from the transfer.
 
@@ -1692,7 +1824,7 @@ source dir -- any leading slashes are removed and no ".." references are
 allowed to go higher than the source dir.  For example, take this
 command:
 
-quote(tt(   rsync -a --files-from=/tmp/foo /usr remote:/backup))
+verb(  rsync -a --files-from=/tmp/foo /usr remote:/backup)
 
 If /tmp/foo contains the string "bin" (or even "/bin"), the /usr/bin
 directory will be created as /backup/bin on the remote host.  If it
@@ -1713,7 +1845,7 @@ instead of the local host if you specify a "host:" in front of the file
 specify just a prefix of ":" to mean "use the remote end of the
 transfer".  For example:
 
-quote(tt(   rsync -a --files-from=:/path/file-list src:/ /tmp/copy))
+verb(  rsync -a --files-from=:/path/file-list src:/ /tmp/copy)
 
 This would copy all the files specified in the /path/file-list file that
 was located on the remote "src" host.
@@ -1729,6 +1861,9 @@ between adjacent entries.  If the input is not sorted, some path elements
 (implied directories) may end up being scanned multiple times, and rsync will
 eventually unduplicate them after they get turned into file-list elements.
 
+)
+description(
+
 dit(bf(-0, --from0)) This tells rsync that the rules/filenames it reads from a
 file are terminated by a null ('\0') character, not a NL, CR, or CR+LF.
 This affects bf(--exclude-from), bf(--include-from), bf(--files-from), and any
@@ -1761,6 +1896,36 @@ default (with is overridden by both the environment and the command-line).
 This option will eventually become a new default setting at some
 as-yet-undetermined point in the future.
 
+dit(bf(--copy-as=USER[:GROUP])) This option instructs rsync to use the USER and
+(if specified after a colon) the GROUP for the copy operations. This only works
+if the user that is running rsync has the ability to change users. If the group
+is not specified then the user's default groups are used.
+
+The option only affects one side of the transfer unless the transfer is local,
+in which case it affects both sides. Use the bf(--remote-option) to affect the
+remote side, such as bf(-M--copy-as=joe). For a local transfer, the "lsh"
+support file provides a local-shell helper script that can be used to allow a
+"localhost:" host-spec to be specified without needing to setup any remote
+shells (allowing you to specify remote options that affect the side of the
+transfer that is using the host-spec, and local options for the other side).
+
+This option can help to reduce the risk of an rsync being run as root into or
+out of a directory that might have live changes happening to it and you want to
+make sure that root-level read or write actions of system files are not
+possible. While you could alternatively run all of rsync as the specified user,
+sometimes you need the root-level host-access credentials to be used, so this
+allows rsync to drop root for the copying part of the operation after the
+remote-shell or daemon connection is established.
+
+For example, the following rsync writes the local files as user "joe":
+
+verb(   sudo rsync -aiv --copy-as=joe host1:backups/joe/ /home/joe/)
+
+This makes all files owned by user "joe", limits the groups to those that are
+available to that user, and makes it impossible for the joe user to do a timed
+exploit of the path to induce a change to a file that the joe user has no
+permissions to change.
+
 dit(bf(-T, --temp-dir=DIR)) This option instructs rsync to use DIR as a
 scratch directory when creating temporary copies of the files transferred
 on the receiving side.  The default behavior is to create each temporary
@@ -1856,7 +2021,7 @@ The files must be identical in all preserved attributes (e.g. permissions,
 possibly ownership) in order for the files to be linked together.
 An example:
 
-quote(tt(  rsync -av --link-dest=$PWD/prior_dir host:src_dir/ new_dir/))
+verb(  rsync -av --link-dest=$PWD/prior_dir host:src_dir/ new_dir/)
 
 If file's aren't linking, double-check their attributes.  Also check if some
 attributes are getting forced outside of rsync's control, such a mount option
@@ -1865,7 +2030,7 @@ ownership (such as OS X's "Ignore ownership on this volume" option).
 
 Beginning in version 2.6.4, multiple bf(--link-dest) directories may be
 provided, which will cause rsync to search the list in the order specified
-for an exact match.
+for an exact match (there is a limit of 20 such directories).
 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 em(DIR)s will be
@@ -1895,27 +2060,48 @@ dit(bf(-z, --compress)) 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.
 
-Note that this option typically achieves better compression ratios than can
-be achieved by using a compressing remote shell or a compressing transport
+The "zlib" compression method typically achieves better compression ratios than
+can be achieved by using a compressing remote shell or a compressing transport
 because it takes advantage of the implicit information in the matching data
 blocks that are not explicitly sent over the connection.  This matching-data
-compression comes at a cost of CPU, though, and can be disabled by repeating
-the bf(-z) option, but only if both sides are at least version 3.1.1.
+compression comes at a cost of CPU, though, and can be disabled by using the
+"zlibx" compresson method instead.  This can be selected by repeating the
+bf(-z) option or specifying bf(--compress-choice=zlibx), but it only works if
+both sides of the transfer are at least version 3.1.1.
 
-Note that if your version of rsync was compiled with an external zlib (instead
-of the zlib that comes packaged with rsync) then it will not support the
-old-style compression, only the new-style (repeated-option) compression.  In
-the future this new-style compression will likely become the default.
-
-The client rsync requests new-style compression on the server via the
-bf(--new-compress) option, so if you see that option rejected it means that
-the server is not new enough to support bf(-zz).  Rsync also accepts the
-bf(--old-compress) option for a future time when new-style compression
-becomes the default.
+Note that if you see an error about an option named bf(--old-compress) or
+bf(--new-compress), this is rsync trying to send the bf(--compress-choice=zlib)
+or bf(--compress-choice=zlibx) option in a backward-compatible manner that more
+rsync versions understand. This error indicates that the older rsync version
+will not allow you to force the compression type.
 
 See the bf(--skip-compress) option for the default list of file suffixes
 that will not be compressed.
 
+dit(bf(--compress-choice=STR, --zc=STR)) This option can be used to override the
+automatic selection of the compression algorithm that is the default when
+bf(--compress) is used.
+
+Currently the STR can be "zlibx", "zlib", or "none".
+
+The "zlibx" algorithm is given preference over "zlib" if both sides of the
+transfer are at least version 3.2.0, otherwise it will choose "zlib" unless you
+override it via something like bf(-zz).  These 2 algorithms are the stame
+except that "zlibx" does not try to include matched data that was not
+transferred in the compression computations.
+
+If "none" is specified, that is equivalent to using bf(--no-compress).
+
+This option implies bf(--compress) unless "none" was specified.
+
+You can also override the compression negotation using the RSYNC_COMPRESS_LIST
+environment variable by setting it to a space-separated list of compression
+names that you consider acceptable. If no common compress choice is found, the
+client exits with an error. It ignores "auto" and all unknown compression
+names.  If the remote rsync is not new enough to handle a compression
+negotiation list, the list is silently ignored unless it contains the string
+"FAIL".
+
 dit(bf(--compress-level=NUM)) Explicitly set the compression level to use
 (see bf(--compress)) instead of letting it default.  If NUM is non-zero,
 the bf(--compress) option is implied.
@@ -1957,14 +2143,18 @@ bf(mov)
 bf(mp3)
 bf(mp4)
 bf(ogg)
+bf(ogv)
 bf(png)
 bf(rar)
 bf(rpm)
 bf(rzip)
+bf(squashfs)
 bf(tbz)
 bf(tgz)
 bf(tlz)
 bf(txz)
+bf(webm)
+bf(webp)
 bf(xz)
 bf(z)
 bf(zip)
@@ -2147,7 +2337,10 @@ quote(itemization(
   sender's value (requires bf(--owner) and super-user privileges).
   it() A bf(g) means the group is different and is being updated to the
   sender's value (requires bf(--group) and the authority to set the group).
-  it() The bf(u) slot is reserved for future use.
+  it() A bf(u) means the access (use) time is different and is being updated to
+  the sender's value (requires bf(--atimes)).  An alternate value of bf(U)
+  means that the access time will be set to the transfer time, which happens
+  when a symlink or directory is updated.
   it() The bf(a) means that the ACL information changed.
   it() The bf(x) means that the extended attribute information changed.
 ))
@@ -2269,6 +2462,9 @@ and a hash (#), followed by exactly 3 octal digits.  For example, a newline
 would output as "\#012".  A literal backslash that is in a filename is not
 escaped unless it is followed by a hash and 3 digits (0-9).
 
+)
+description(
+
 dit(bf(-h, --human-readable)) Output numbers in a more human-readable format.
 There are 3 possible levels:  (1) output numbers with a separator between each
 set of 3 digits (either a comma or a period, depending on if the decimal point
@@ -2278,7 +2474,7 @@ units of 1024.
 
 The default is human-readable level 1.  Each bf(-h) option increases the level
 by one.  You can take the level down to 0 (to output numbers as pure digits) by
-specifing the bf(--no-human-readable) (bf(--no-h)) option.
+specifying the bf(--no-human-readable) (bf(--no-h)) option.
 
 The unit letters that are appended in levels 2 and 3 are: K (kilo), M (mega),
 G (giga), or T (tera).  For example, a 1234567-byte file would output as 1.23M
@@ -2312,7 +2508,9 @@ Rsync will create the em(DIR) if it is missing (just the last dir -- not
 the whole path).  This makes it easy to use a relative path (such as
 "bf(--partial-dir=.rsync-partial)") to have rsync create the
 partial-directory in the destination file's directory when needed, and then
-remove it again when the partial file is deleted.
+remove it again when the partial file is deleted.  Note that the directory
+is only removed if it is a relative pathname, as it is expected that an
+absolute path is to a directory that is reserved for partial-dir work.
 
 If the partial-dir value is not an absolute path, rsync will add an exclude
 rule at the end of all your existing excludes.  This will prevent the
@@ -2346,6 +2544,11 @@ option does not look for this environment value are (1) when bf(--inplace) was
 specified (since bf(--inplace) conflicts with bf(--partial-dir)), and (2) when
 bf(--delay-updates) was specified (see below).
 
+When a modern rsync resumes the transfer of a file in the partial-dir, that
+partial file is now updated in-place instead of creating yet another tmp-file
+copy (so it maxes out at dest + tmp instead of dest + partial + tmp).  This
+requires both ends of the transfer to be at least version 3.2.0.
+
 For the purposes of the daemon-config's "refuse options" setting,
 bf(--partial-dir) does em(not) imply bf(--partial).  This is so that a
 refusal of the bf(--partial) option can be used to disallow the overwriting
@@ -2471,6 +2674,19 @@ want to see how the transfer is doing without scrolling the screen with a
 lot of names.  (You don't need to specify the bf(--progress) option in
 order to use bf(--info=progress2).)
 
+Finally, you can get an instant progress report by sending rsync a signal of
+either SIGINFO or SIGVTALRM. On BSD systems, a SIGINFO is generated by typing a
+Ctrl+T (Linux doesn't currently support a SIGINFO signal). When the client-side
+process receives one of those signals, it sets a flag to output a single
+progress report which is output when the current file transfer finishes (so it
+may take a little time if a big file is being handled when the signal arrives).
+A filename is output (if needed) followed by the --info=progress2 format of
+progress info.  If you don't know which of the 3 rsync processes is the client
+process, it's OK to signal all of them (since the non-client processes ignore
+the signal).
+
+CAUTION: sending SIGVTALRM to an older rsync (pre-3.2.0) will kill it.
+
 dit(bf(--password-file=FILE)) This option allows you to provide a password for
 accessing an rsync daemon via a file or via standard input if bf(FILE) is
 bf(-).  The file should contain just the password on the first line (all other
@@ -2560,6 +2776,9 @@ file previously generated by bf(--write-batch).
 If em(FILE) is bf(-), the batch data will be read from standard input.
 See the "BATCH MODE" section for details.
 
+)
+description(
+
 dit(bf(--protocol=NUM)) Force an older protocol version to be used.  This
 is useful for creating a batch file that is compatible with an older
 version of rsync.  For instance, if rsync 2.6.4 is being used with the
@@ -2616,13 +2835,14 @@ applications that want repeatable block checksums, or in the case where the
 user wants a more random checksum seed.  Setting NUM to 0 causes rsync to use
 the default of code(time()) for checksum seed.
 
-enddit()
+)
 
 manpagesection(DAEMON OPTIONS)
 
 The options allowed when starting an rsync daemon are as follows:
 
-startdit()
+description(
+
 dit(bf(--daemon)) This tells rsync that it is to run as a daemon.  The
 daemon you start running may be accessed using an rsync client using
 the bf(host::module) or bf(rsync://host/module/) syntax.
@@ -2702,7 +2922,8 @@ is the case.
 
 dit(bf(-h, --help)) When specified after bf(--daemon), print a short help
 page describing the options available for starting an rsync daemon.
-enddit()
+
+)
 
 manpagesection(FILTER RULES)
 
@@ -2816,16 +3037,20 @@ itemization(
 )
 
 Note that, when using the bf(--recursive) (bf(-r)) option (which is implied by
-bf(-a)), every subcomponent of every path is visited from the top down, so
-include/exclude patterns get applied recursively to each subcomponent's
-full name (e.g. to include "/foo/bar/baz" the subcomponents "/foo" and
-"/foo/bar" must not be excluded).
-The exclude patterns actually short-circuit the directory traversal stage
-when rsync finds the files to send.  If a pattern excludes a particular
-parent directory, it can render a deeper include pattern ineffectual
-because rsync did not descend through that excluded section of the
-hierarchy.  This is particularly important when using a trailing '*' rule.
-For instance, this won't work:
+bf(-a)), every subdir component of every path is visited left to right, with
+each directory having a chance for exclusion before its content.  In this way
+include/exclude patterns are applied recursively to the pathname of each node
+in the filesystem's tree (those inside the transfer).  The exclude patterns
+short-circuit the directory traversal stage as rsync finds the files to send.
+
+For instance, to include "/foo/bar/baz", the directories "/foo" and "/foo/bar"
+must not be excluded.  Excluding one of those parent directories prevents the
+examination of its content, cutting off rsync's recursion into those paths and
+rendering the include for "/foo/bar/baz" ineffectual (since rsync can't match
+something it never sees in the cut-off section of the directory hierarchy).
+
+The concept path exclusion is particularly important when using a trailing '*'
+rule.  For instance, this won't work:
 
 quote(
 tt(+ /some/path/this-file-will-not-be-found)nl()
@@ -2900,6 +3125,10 @@ itemization(
   option's default rules that exclude things like "CVS" and "*.o" are
   marked as perishable, and will not prevent a directory that was removed
   on the source from being deleted on the destination.
+  it() An bf(x) indicates that a rule affects xattr names in xattr copy/delete
+  operations (and is thus ignored when matching file/dir names). If no
+  xattr-matching rules are specified, a default xattr filtering rule is
+  used (see the bf(--xattrs) option).
 )
 
 manpagesection(MERGE-FILE FILTER RULES)
@@ -3339,7 +3568,7 @@ show why each individual file is included or excluded.
 
 manpagesection(EXIT VALUES)
 
-startdit()
+description(
 dit(bf(0)) Success
 dit(bf(1)) Syntax or usage error
 dit(bf(2)) Protocol incompatibility
@@ -3363,11 +3592,11 @@ dit(bf(24)) Partial transfer due to vanished source files
 dit(bf(25)) The --max-delete limit stopped deletions
 dit(bf(30)) Timeout in data send/receive
 dit(bf(35)) Timeout waiting for daemon connection
-enddit()
+)
 
 manpagesection(ENVIRONMENT VARIABLES)
 
-startdit()
+description(
 dit(bf(CVSIGNORE)) The CVSIGNORE environment variable supplements any
 ignore patterns in .cvsignore files. See the bf(--cvs-exclude) option for
 more details.
@@ -3392,7 +3621,7 @@ are used to determine the default username sent to an rsync daemon.
 If neither is set, the username defaults to "nobody".
 dit(bf(HOME)) The HOME environment variable is used to find the user's
 default .cvsignore file.
-enddit()
+)
 
 manpagefiles()
 
@@ -3420,7 +3649,7 @@ url(http://rsync.samba.org/)(http://rsync.samba.org/)
 
 manpagesection(VERSION)
 
-This man page is current for version 3.1.2 of rsync.
+This man page is current for version 3.1.3 of rsync.
 
 manpagesection(INTERNAL OPTIONS)