Allow some pre-/post-xfer exec shell restrictions.
[rsync.git] / rsync.yo
index 06410e7f5706c645b27a52131d19e9dd487832d6..71008576c4b437b183b6cd46ba481e3e855dce6a 100644 (file)
--- a/rsync.yo
+++ b/rsync.yo
@@ -1,5 +1,5 @@
 mailto(rsync-bugs@samba.org)
-manpage(rsync)(1)(29 Jun 2008)()()
+manpage(rsync)(1)(28 Jan 2018)()()
 manpagename(rsync)(a fast, versatile, remote (and local) file-copying tool)
 manpagesynopsis()
 
@@ -103,7 +103,10 @@ This would transfer all files matching the pattern *.c from the
 current directory to the directory src on the machine foo. If any of
 the files already exist on the remote system then the rsync
 remote-update protocol is used to update the file by sending only the
-differences. See the tech report for details.
+differences in the data.  Note that the expansion of wildcards on the
+commandline (*.c) into a list of files is handled by the shell before
+it runs rsync and not by rsync itself (exactly the same as all other
+posix-style programs).
 
 quote(tt(rsync -avz foo:src/bar /data/tmp))
 
@@ -233,6 +236,10 @@ 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 varibable is set, that
+program will be used to run the RSYNC_CONNECT_PROG command instead of
+using the default shell of the 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
@@ -373,10 +380,11 @@ to the detailed description below for a complete description.  verb(
  -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
  -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
@@ -410,7 +418,7 @@ to the detailed description below for a complete description.  verb(
      --contimeout=SECONDS    set daemon connection timeout in seconds
  -I, --ignore-times          don't skip files that match size and time
      --size-only             skip files that match in size
-     --modify-window=NUM     compare mod-times with reduced accuracy
+ -@, --modify-window=NUM     set the accuracy for mod-time comparisons
  -T, --temp-dir=DIR          create temporary files in directory DIR
  -y, --fuzzy                 find similar file for basis if no dest file
      --compare-dest=DIR      also compare received files relative to DIR
@@ -434,6 +442,7 @@ to the detailed description below for a complete description.  verb(
      --port=PORT             specify double-colon alternate port number
      --sockopts=OPTIONS      specify custom TCP options
      --blocking-io           use blocking I/O for the remote shell
+     --outbuf=N|L|B          set out buffering to None, Line, or Block
      --stats                 give some file-transfer stats
  -8, --8-bit-output          leave high-bit chars unescaped in output
  -h, --human-readable        output numbers in a human-readable format
@@ -489,7 +498,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)
@@ -512,6 +522,12 @@ fine-grained settings override the implied settings of bf(-v).  Both
 bf(--info) and bf(--debug) have a way to ask for help that tells you
 exactly what flags are set for each increase in verbosity.
 
+However, do keep in mind that a daemon's "max verbosity" setting will limit how
+high of a level the various individual flags can be set on the daemon side.
+For instance, if the max is 2, then any info and/or debug flag that is set to
+a higher value than what would be set by bf(-vv) will be downgraded to the
+bf(-vv) level in the daemon's logging.
+
 dit(bf(--info=FLAGS))
 This option lets you have fine-grained control over the
 information
@@ -533,10 +549,10 @@ information on what is output and when.
 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.
 
 dit(bf(--debug=FLAGS))
-This option lets you have fine-grained control over the
-debug
+This option lets you have fine-grained control over the debug
 output you want to see.  An individual flag name may be followed by a level
 number, with 0 meaning to silence that output, 1 being the default output
 level, and higher numbers increasing the output of that flag (for those
@@ -548,20 +564,29 @@ are added for each increase in the verbose level.  Some examples:
 verb(    rsync -avvv --debug=none src/ dest/
     rsync -avA --del --debug=del2,acl 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.
 
 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
 protocol (which normally outputs info messages via stdout).  This is mainly
 intended for debugging in order to avoid changing the data sent via the
 protocol, since the extra protocol data can change what is being tested.
-Keep in mind that a daemon connection does not have a stderr channel to send
+The option does not affect the remote side of a transfer without using
+bf(--remote-option) -- e.g. bf(-M--msgs2stderr).
+Also keep in mind that a daemon connection does not have a stderr channel to send
 messages back to the client side, so if you are doing any daemon-transfer
 debugging using this option, you should start up a daemon using bf(--no-detach)
 so that you can see the stderr output on the daemon side.
 
+This option has the side-effect of making stderr output get line-buffered so
+that the merging of the output of 3 programs happens in a more readable manner.
+
 dit(bf(-q, --quiet)) This option decreases the amount of information you
 are given during the transfer, notably suppressing information messages
 from the remote server. This option is useful when invoking rsync from
@@ -586,13 +611,23 @@ time to just looking for files that have changed in size.  This is useful
 when starting to use rsync after using another mirroring system which may
 not preserve timestamps exactly.
 
-dit(bf(--modify-window)) When comparing two timestamps, rsync treats the
+dit(bf(-@, --modify-window)) When comparing two timestamps, rsync treats the
 timestamps as being equal if they differ by no more than the modify-window
-value.  This is normally 0 (for an exact match), but you may find it useful
-to set this to a larger value in some situations.  In particular, when
-transferring to or from an MS Windows FAT filesystem (which represents
-times with a 2-second resolution), bf(--modify-window=1) is useful
-(allowing times to differ by up to 1 second).
+value.  The default is 0, which matches just integer seconds.  If you specify a
+negative value (and the receiver is at least version 3.1.3) then nanoseconds
+will also be taken into account.  Specifying 1 is useful for copies to/from MS
+Windows FAT filesystems, because FAT represents times with a 2-second
+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))
+
+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
+ext3 and ext4, or if the receiving rsync is older than 3.1.3.
 
 dit(bf(-c, --checksum)) This changes the way rsync checks if the files have
 been changed and are in need of a transfer.  Without this option, rsync
@@ -751,7 +786,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
@@ -783,7 +818,7 @@ the destination and have a modified time that is newer than the source
 file.  (If an existing destination file has a modification time equal to the
 source file's, it will be updated if the sizes are different.)
 
-Note that this does not affect the copying of symlinks or other special
+Note that this does not affect the copying of dirs, symlinks, or other special
 files.  Also, a difference of file format between the sender and receiver
 is always considered to be important enough for an update, no matter what
 date is on the objects.  In other words, if the source has a directory
@@ -843,9 +878,12 @@ 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
+should thus use include/exclude/filter rules to ensure that such a transfer is
+only affecting files that you know to be growing via appended data.
 
 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
@@ -876,6 +914,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.
 
@@ -942,6 +983,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
@@ -1085,9 +1129,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
@@ -1161,6 +1223,17 @@ 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).
 This option is inferred if you use bf(--backup) without bf(--backup-dir).
 
+This option also has the side-effect of avoiding early creation of directories
+in incremental recursion copies.  The default bf(--inc-recursive) copying
+normally does an early-create pass of all the sub-directories in a parent
+directory in order for it to be able to then set the modify time of the parent
+directory right away (without having to delay that until a bunch of recursive
+copying has finished).  This early-create idiom is not necessary if directory
+modify times are not being preserved, so it is skipped.  Since early-create
+directories don't have accurate mode, mtime, or ownership, the use of this
+option can help when someone wants to avoid these partially-finished
+directories.
+
 dit(bf(-J, --omit-link-times)) This tells rsync to omit symlinks when
 it is preserving modification times (see bf(--times)).
 
@@ -1206,20 +1279,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
@@ -1235,14 +1318,27 @@ 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)) This option overrides the checksum algoriths.
+If one algorithm name is specified, it is used for both the transfer checksums
+and (assuming bf(--checksum) is specifed) the pre-transfer checksumming. If two
+comma-separated names are supplied, the first name affects the transfer
+checksums, and the second name affects the pre-transfer checksumming.
+
+The algorithm choices are "auto", "md4", "md5", and "none".  If "none" is
+specified for the first 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 name, the bf(--checksum) option cannot be used. The
+"auto" option is the default, where rsync bases its algorithm choice on the
+protocol version (for backward compatibility with older rsync versions).
+
 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
@@ -1261,6 +1357,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
@@ -1416,15 +1515,17 @@ using bf(--delete-after), and it used to be non-functional unless the
 bf(--recursive) option was also enabled.
 
 dit(bf(--max-delete=NUM)) This tells rsync not to delete more than NUM
-files or directories.  If that limit is exceeded, a warning is output
-and rsync exits with an error code of 25 (new for 3.0.0).
+files or directories.  If that limit is exceeded, all further deletions are
+skipped through the end of the transfer.  At the end, rsync outputs a warning
+(including a count of the skipped deletions) and exits with an error code
+of 25 (unless some more important error condition also occurred).
 
-Also new for version 3.0.0, you may specify bf(--max-delete=0) to be warned
+Beginning with version 3.0.0, you may specify bf(--max-delete=0) to be warned
 about any extraneous files in the destination without removing any of them.
 Older clients interpreted this as "unlimited", so if you don't know what
 version the client is, you can use the less obvious bf(--max-delete=-1) as
 a backward-compatible way to specify that no deletions be allowed (though
-older versions didn't warn when the limit was exceeded).
+really old versions didn't warn when the limit was exceeded).
 
 dit(bf(--max-size=SIZE)) This tells rsync to avoid transferring any
 file that is larger than the specified SIZE. The SIZE value can be
@@ -1446,11 +1547,15 @@ be offset by one byte in the indicated direction.
 Examples: --max-size=1.5mb-1 is 1499999 bytes, and --max-size=2g+1 is
 2147483649 bytes.
 
+Note that rsync versions prior to 3.1.0 did not allow bf(--max-size=0).
+
 dit(bf(--min-size=SIZE)) This tells rsync to avoid transferring any
 file that is smaller than the specified SIZE, which can help in not
 transferring small, junk files.
 See the bf(--max-size) option for a description of SIZE and other information.
 
+Note that rsync versions prior to 3.1.0 did not allow bf(--min-size=0).
+
 dit(bf(-B, --block-size=BLOCKSIZE)) This forces the block size used in
 rsync's delta-transfer algorithm to a fixed value.  It is normally selected based on
 the size of each file being updated.  See the technical report for details.
@@ -1529,7 +1634,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
@@ -1678,6 +1783,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
@@ -1714,6 +1822,9 @@ 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
 file in the same directory as the associated destination file.
+Beginning with rsync 3.1.1, the temp-file names inside the specified DIR will
+not be prefixed with an extra dot (though they will still have a random suffix
+added).
 
 This option is most often used when the receiving disk partition does not
 have enough free space to hold a copy of the largest file in the transfer.
@@ -1763,6 +1874,8 @@ directory).  If a file is found in em(DIR) that is identical to the
 sender's file, the file will NOT be transferred to the destination
 directory.  This is useful for creating a sparse backup of just files that
 have changed from an earlier backup.
+This option is typically used to copy into an empty (or newly created)
+directory.
 
 Beginning in version 2.6.4, multiple bf(--compare-dest) directories may be
 provided, which will cause rsync to search the list in the order specified
@@ -1775,6 +1888,10 @@ selected to try to speed up the transfer.
 If em(DIR) is a relative path, it is relative to the destination directory.
 See also bf(--copy-dest) and bf(--link-dest).
 
+NOTE: beginning with version 3.1.0, rsync will remove a file from a non-empty
+destination hierarchy if an exact match is found in one of the compare-dest
+hierarchies (making the end result more closely match a fresh copy).
+
 dit(bf(--copy-dest=DIR)) This option behaves like bf(--compare-dest), but
 rsync will also copy unchanged files found in em(DIR) to the destination
 directory using a local copy.
@@ -1805,17 +1922,18 @@ 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
 selected to try to speed up the transfer.
 
 This option works best when copying into an empty destination hierarchy, as
-rsync treats existing files as definitive (so it never looks in the link-dest
-dirs when a destination file already exists), and as malleable (so it might
-change the attributes of a destination file, which affects all the hard-linked
-versions).
+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 destination file
+already exists.
 
 Note that if you combine this option with bf(--ignore-times), rsync will not
 link any files together because it only links identical files together as a
@@ -1837,7 +1955,20 @@ 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
 because it takes advantage of the implicit information in the matching data
-blocks that are not explicitly sent over the connection.
+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.
+
+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.
 
 See the bf(--skip-compress) option for the default list of file suffixes
 that will not be compressed.
@@ -2001,6 +2132,13 @@ rsync defaults to using
 blocking I/O, otherwise it defaults to using non-blocking I/O.  (Note that
 ssh prefers non-blocking I/O.)
 
+dit(bf(--outbuf=MODE)) This sets the output buffering mode.  The mode can be
+None (aka Unbuffered), Line, or Block (aka Full).  You may specify as little
+as a single letter for the mode, and use upper or lower case.
+
+The main use of this option is to change Full buffering to Line buffering
+when rsync's output is going to a file or pipe.
+
 dit(bf(-i, --itemize-changes)) Requests a simple itemized list of the
 changes that are being made to each file, including attribute changes.
 This is exactly the same as specifying bf(--out-format='%i %n%L').
@@ -2188,6 +2326,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
@@ -2385,15 +2526,16 @@ transfer that may be interrupted.
 
 There is also a bf(--info=progress2) option that outputs statistics based
 on the whole transfer, rather than individual files.  Use this flag without
-outputting a filename (e.g. avoid bf(-v) or specify bf(--info=name0) if you
+outputting a filename (e.g. avoid bf(-v) or specify bf(--info=name0)) if you
 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).)
 
-dit(bf(--password-file)) This option allows you to provide a password in a
-file for accessing an rsync daemon.  The file must not be world readable.
-It should contain just the password as the first line of the file (all
-other lines are ignored).
+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
+lines are ignored).  Rsync will exit with an error if bf(FILE) is world
+readable or if a root-run rsync command finds a non-root-owned file.
 
 This option does not supply a password to a remote shell transport such as
 ssh; to learn how to do that, consult the remote shell's documentation.
@@ -2478,6 +2620,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
@@ -2525,22 +2670,23 @@ If rsync was complied without support for IPv6, the bf(--ipv6) option
 will have no effect.  The bf(--version) output will tell you if this
 is the case.
 
-dit(bf(--checksum-seed=NUM)) Set the checksum seed to the integer
-NUM.  This 4 byte checksum seed is included in each block and file
-checksum calculation.  By default the checksum seed is generated
-by the server and defaults to the current code(time()).  This option
-is used to set a specific checksum seed, which is useful for
-applications that want repeatable block and file 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()
+dit(bf(--checksum-seed=NUM)) Set the checksum seed to the integer NUM.  This 4
+byte checksum seed is included in each block and MD4 file checksum calculation
+(the more modern MD5 file checksums don't use a seed).  By default the checksum
+seed is generated by the server and defaults to the current code(time()).  This
+option is used to set a specific checksum seed, which is useful for
+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.
+
+)
 
 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.
@@ -2620,7 +2766,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)
 
@@ -2716,6 +2863,10 @@ itemization(
   it() a '[' introduces a character class, such as [a-z] or [[:alpha:]].
   it() in a wildcard pattern, a backslash can be used to escape a wildcard
   character, but it is matched literally when no wildcards are present.
+  This means that there is an extra level of backslash removal when a
+  pattern contains wildcard characters compared to a pattern that has none.
+  e.g. if you add a wildcard to "foo\bar" (which matches the backslash) you
+  would need to use "foo\\bar*" to avoid the "\b" becoming just "b".
   it() if the pattern contains a / (not counting a trailing /) or a "**",
   then it is matched against the full pathname, including any leading
   directories. If the pattern doesn't contain a / or a "**", then it is
@@ -2730,16 +2881,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()
@@ -2814,6 +2969,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)
@@ -3253,7 +3412,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
@@ -3277,11 +3436,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.
@@ -3306,7 +3465,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()
 
@@ -3334,7 +3493,7 @@ url(http://rsync.samba.org/)(http://rsync.samba.org/)
 
 manpagesection(VERSION)
 
-This man page is current for version 3.0.3 of rsync.
+This man page is current for version 3.1.3 of rsync.
 
 manpagesection(INTERNAL OPTIONS)
 
@@ -3348,7 +3507,7 @@ ssh login.
 
 manpagesection(CREDITS)
 
-rsync is distributed under the GNU public license.  See the file
+rsync is distributed under the GNU General Public License.  See the file
 COPYING for details.
 
 A WEB site is available at