Document the new --specials option and how -D and --devices now work.
[rsync/rsync.git] / rsync.yo
index e14b9c6..0cd056f 100644 (file)
--- a/rsync.yo
+++ b/rsync.yo
@@ -318,7 +318,9 @@ to the detailed description below for a complete description.  verb(
  -p, --perms                 preserve permissions
  -o, --owner                 preserve owner (root only)
  -g, --group                 preserve group
- -D, --devices               preserve devices (root only)
+     --devices               preserve device files (root only)
+     --specials              preserve special files
+ -D                          same as --devices --specials
  -t, --times                 preserve times
  -O, --omit-dir-times        omit directories when preserving times
      --chmod=CHMOD           change destination permissions
@@ -329,8 +331,8 @@ to the detailed description below for a complete description.  verb(
  -B, --block-size=SIZE       force a fixed checksum block-size
  -e, --rsh=COMMAND           specify the remote shell to use
      --rsync-path=PROGRAM    specify the rsync to run on remote machine
+     --existing              ignore non-existing files on receiving side
      --ignore-existing       ignore files that already exist on receiver
-     --ignore-non-existing   ignore files that don't exist on receiver
      --remove-sent-files     sent files/symlinks are removed from sender
      --del                   an alias for --delete-during
      --delete                delete files that don't exist on sender
@@ -372,7 +374,7 @@ to the detailed description below for a complete description.  verb(
      --port=PORT             specify double-colon alternate port number
      --blocking-io           use blocking I/O for the remote shell
      --stats                 give some file-transfer stats
- -m, --human-readable        output numbers in a human-readable format
+ -h, --human-readable        output numbers in a human-readable format
      --si                    like human-readable, but use powers of 1000
      --progress              show progress during transfer
  -P                          same as --partial --progress
@@ -389,7 +391,7 @@ to the detailed description below for a complete description.  verb(
  -4, --ipv4                  prefer IPv4
  -6, --ipv6                  prefer IPv6
      --version               print version number
-h, --help                  show this help screen)
    --help                  show this help screen)
 
 Rsync can also be run as a daemon, in which case the following options are
 accepted: verb(
@@ -402,7 +404,7 @@ accepted: verb(
  -v, --verbose               increase verbosity
  -4, --ipv4                  prefer IPv4
  -6, --ipv6                  prefer IPv6
-h, --help                  show this help screen)
    --help                  show this help screen)
 
 manpageoptions()
 
@@ -413,8 +415,10 @@ The '=' for options that take a parameter is optional; whitespace
 can be used instead.
 
 startdit()
-dit(bf(-h, --help)) Print a short help page describing the options
-available in rsync.
+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 same help output can also be requested by using
+the bf(-h) option without any other args.
 
 dit(bf(--version)) print the rsync version number and exit.
 
@@ -550,8 +554,17 @@ dit(bf(-b, --backup)) With this option, preexisting destination files are
 renamed as each file is transferred or deleted.  You can control where the
 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), the bf(--omit-dir-times)
-option will be enabled.
+
+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
+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. -f "P *~").  This will prevent previously backed-up files from being
+deleted.  Note that if you are supplying your own filter rules, you may
+need to manually insert your own exclude/protect rule somewhere higher up
+in the list so that it has a high enough priority to be effective (e.g., if
+your rules specify a trailing inclusion/exclusion of '*', the auto-added
+rule would never be reached).
 
 dit(bf(--backup-dir=DIR)) In combination with the bf(--backup) option, this
 tells rsync to store all backups in the specified directory. This is
@@ -613,11 +626,11 @@ data is required).
 
 dit(bf(-d, --dirs)) Tell the sending side to include any directories that
 are encountered.  Unlike bf(--recursive), a directory's contents are not copied
-unless the directory was specified on the command-line as either "." or a
-name with a trailing slash (e.g. "foo/").  Without this option or the
+unless the directory name specified is "." or ends with a trailing slash
+(e.g. ".", "dir/.", "dir/", etc.).  Without this option or the
 bf(--recursive) option, rsync will skip all directories it encounters (and
 output a message to that effect for each one).  If you specify both
-bf(--dirs) and bf(--recursive), the latter takes precedence.
+bf(--dirs) and bf(--recursive), bf(--recursive) takes precedence.
 
 dit(bf(-l, --links)) When symlinks are encountered, recreate the
 symlink on the destination.
@@ -683,10 +696,15 @@ receiver is a member of will be preserved.  By default, the preservation
 is done by name, but may fall back to using the ID number in some
 circumstances.  See the bf(--numeric-ids) option for a full discussion.
 
-dit(bf(-D, --devices)) This option causes rsync to transfer character and
+dit(bf(--devices)) This option causes rsync to transfer character and
 block device information to the remote system to recreate these
 devices. This option is only available to the super-user.
 
+dit(bf(--specials)) This option causes rsync to transfer special files
+such as named sockets and fifos.
+
+dit(bf(-D)) The bf(-D) option is equivalent to bf(--devices) bf(--specials).
+
 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
@@ -708,6 +726,8 @@ item that should only apply to a file by prefixing it with a 'F'.  For example:
 
 quote(--chmod=Dg+s,ug+w,Fo-w,+X)
 
+It is also legal to specify multiple bf(--chmod) options.
+
 dit(bf(-n, --dry-run)) This tells rsync to not do any file transfers,
 instead it will just report the actions it would have taken.
 
@@ -719,20 +739,32 @@ NOTE: Don't use this option when the destination is a Solaris "tmpfs"
 filesystem. It doesn't seem to handle seeks over null regions
 correctly and ends up corrupting the files.
 
-dit(bf(-x, --one-file-system)) This tells rsync not to cross filesystem
-boundaries  when recursing.  This  is useful for transferring the
-contents of only one filesystem.
+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
+through the hierarchy of each directory that the user specified, and also
+the analogous recursion on the receiving side during deletion.  Also keep
+in mind that rsync treats a "bind" mount to the same device as being on the
+same filesystem.  
+
+If this option is repeated, rsync omits all mount-point directories from
+the copy.  Otherwise, it includes an empty directory at each mount-point it
+encounters (using the attributes of the mounted directory because those of
+the underlying mount-point directory are inaccessible).
+
+If rsync has been told to collapse symlinks (via bf(--copy-links) or
+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.
+
+dit(bf(--existing, --ignore-non-existing)) This tells rsync to skip
+updating files that do not exist yet on the destination.  If this option is
+combined with the bf(--ignore-existing) option, no files will be updated
+(which can be useful if all you want to do is to delete missing files).
 
 dit(bf(--ignore-existing)) This tells rsync to skip updating files that
 already exist on the destination.  See also bf(--ignore-non-existing).
 
-dit(bf(--ignore-non-existing)) This tells rsync to skip updating files that
-do not exist yet on the destination.  If this option is combined with the
-bf(--ignore-existing) option, no files will be updated (which can be useful
-if all you want to do is to delete missing files).  Note that in older
-versions of rsync, this option was named bf(--existing), so this older
-name is still accepted as an alias.
-
 dit(bf(--remove-sent-files)) This tells rsync to remove from the sending
 side the files and/or symlinks that are newly created or whose content is
 updated on the receiving side.  Directories and devices are not removed,
@@ -751,7 +783,7 @@ include/exclude modifiers in the FILTER RULES section).
 
 Prior to rsync 2.6.7, this option would have no effect unless bf(--recursive)
 was in effect.  Beginning with 2.6.7, deletions will also occur when bf(--dirs)
-is specified, but only for directories whose contents are being copied.
+(bf(-d)) is in effect, but only for directories whose contents are being copied.
 
 This option can be dangerous if used incorrectly!  It is a very good idea
 to run first using the bf(--dry-run) option (bf(-n)) to see what files would be
@@ -818,14 +850,15 @@ file that is larger than the specified SIZE. The SIZE value can be
 suffixed with a string to indicate a size multiplier, and
 may be a fractional value (e.g. "bf(--max-size=1.5m)").
 
-The suffixes are as follows: "K" (or "k") is a kilobyte (1024),
-"M" (or "m") is a megabyte (1024*1024), and "G" (or "g") is a
-gigabyte (1024*1024*1024).
-If you want the multiplier to be 1000 instead of 1024, suffix the K, G, or
-M with a "T" (or "t") to indicate that a power of 10 is desired.
+The suffixes are as follows: "K" (or "KiB") is a kibibyte (1024),
+"M" (or "MiB") is a mebibyte (1024*1024), and "G" (or "GiB") is a
+gibibyte (1024*1024*1024).
+If you want the multiplier to be 1000 instead of 1024, use "KB",
+"MB", or "GB".  (Note: lower-case is also accepted for all values.)
 Finally, if the suffix ends in either "+1" or "-1", the value will
 be offset by one byte in the indicated direction.
-Examples: --max-size=1.5mt-1 is 1499999 bytes, and --max-size=2g+1 is
+
+Examples: --max-size=1.5mb-1 is 1499999 bytes, and --max-size=2g+1 is
 2147483649 bytes.
 
 dit(bf(--min-size=SIZE)) This tells rsync to avoid transferring any
@@ -850,9 +883,18 @@ running rsync daemon on the remote host.  See the section "USING
 RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION" above.
 
 Command-line arguments are permitted in COMMAND provided that COMMAND is
-presented to rsync as a single argument.  For example:
+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,
+and you can use single- and/or double-quotes to preserve spaces in an
+argument (but not backslashes).  Note that doubling a single-quote
+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"))
+quote(
+tt(    -e 'ssh -p 2234')nl()
+tt(    -e 'ssh -o "ProxyCommand nohup ssh firewall nc -w1 %h %p"')nl()
+)
 
 (Note that ssh users can alternately customize site-specific connect
 options in their .ssh/config file.)
@@ -1139,9 +1181,13 @@ ssh prefers non-blocking I/O.)
 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(--log-format='%i %n%L').
+If you repeat the option, unchanged files will also be output, but only
+if the receiving rsync is at least version 2.6.7 (you can use bf(-vv)
+with older versions of rsync, but that also turns on the output of other
+verbose messages).
 
 The "%i" escape has a cryptic output that is 9 letters long.  The general
-format is like the string bf(UXcstpoga)), where bf(U) is replaced by the
+format is like the string bf(UXcstpog)), where bf(U) is replaced by the
 kind of update being done, bf(X) is replaced by the file-type, and the
 other letters represent attributes that may be output if they are being
 modified.
@@ -1162,7 +1208,8 @@ quote(itemize(
 ))
 
 The file-types that replace the bf(X) are: bf(f) for a file, a bf(d) for a
-directory, an bf(L) for a symlink, and a bf(D) for a device.
+directory, an bf(L) for a symlink, a bf(D) for a device, and a bf(S) for a
+special file (e.g. named sockets and fifos).
 
 The other letters in the string above are the actual letters that
 will be output if the associated attribute for the item is being updated or
@@ -1189,8 +1236,6 @@ quote(itemize(
   sender's value (requires bf(--owner) and root 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(a) is reserved for a future enhanced version that supports
-  extended file attributes, such as ACLs.
 ))
 
 One other output is possible:  when deleting files, the "%i" will output
@@ -1228,7 +1273,7 @@ dit(bf(--stats)) This tells rsync to print a verbose set of statistics
 on the file transfer, allowing you to tell how effective the rsync
 algorithm is for your data.
 
-dit(bf(-m, --human-readable)) Output numbers in a more human-readable format.
+dit(bf(-h, --human-readable)) Output numbers in a more human-readable format.
 Large numbers may be output in larger units, with a K (1024), M (1024*1024),
 or G (1024*1024*1024) suffix.
 
@@ -1264,10 +1309,10 @@ will prevent partial-dir files from being transferred and also prevent the
 untimely deletion of partial-dir items on the receiving side.  An example:
 the above bf(--partial-dir) option would add an "bf(--exclude=.rsync-partial/)"
 rule at the end of any other filter rules.  Note that if you are
-supplying your own filter rules, you may need to manually insert a
-rule for this directory exclusion somewhere higher up in the list so that
+supplying your own exclude rules, you may need to manually insert your own
+exclude/protect rule somewhere higher up in the list so that
 it has a high enough priority to be effective (e.g., if your rules specify
-a trailing bf(--exclude='*') rule, the auto-added rule would never be
+a trailing inclusion/exclusion of '*', the auto-added rule would never be
 reached).
 
 IMPORTANT: the bf(--partial-dir) should not be writable by other users or it
@@ -1295,11 +1340,9 @@ updated file into a holding directory until the end of the
 transfer, at which time all the files are renamed into place in rapid
 succession.  This attempts to make the updating of the files a little more
 atomic.  By default the files are placed into a directory named ".~tmp~" in
-each file's destination directory, but you can override this by specifying
-the bf(--partial-dir) option.  (Note that RSYNC_PARTIAL_DIR has no effect
-on this value, nor is bf(--partial-dir) considered to be implied for the
-purposes of the daemon-config's "refuse options" setting.)
-Conflicts with bf(--inplace).
+each file's destination directory, but if you've specified the
+bf(--partial-dir) option, that directory will be used instead.
+Conflicts with bf(--inplace) and bf(--append).
 
 This option uses more memory on the receiving side (one bit per file
 transferred) and also requires enough free disk space on the receiving
@@ -1567,18 +1610,27 @@ itemize(
   of the transfer.
   it() if the pattern ends with a / then it will only match a
   directory, not a file, link, or device.
-  it() if the pattern contains a wildcard character from the set
-  *?[ then expression matching is applied using the shell filename
-  matching rules. Otherwise a simple string match is used.
-  it() the double asterisk pattern "**" will match slashes while a
-  single asterisk pattern "*" will stop at slashes.
-  it() if the pattern contains a / (not counting a trailing /) or a "**"
+
+  it() rsync chooses between doing a simple string match and wildcard
+  matching by checking if the pattern contains one of these three wildcard
+  characters: '*', '?', and '[' .
+  it() a '*' matches any non-empty path component (it stops at slashes).
+  it() use '**' to match anything, including slashes.
+  it() a '?' matches any character except a slash (/).
+  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.
+  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
   matched only against the final component of the filename.
   (Remember that the algorithm is applied recursively so "full filename"
   can actually be any portion of a path from the starting directory on
   down.)
+  it() a trailing "dir_name/***" will match both the directory (as if
+  "dir_name/" had been specified) and all the files in the directory
+  (as if "dir_name/**" had been specified).  (This behavior is new for
+  version 2.6.7.)
 )
 
 Note that, when using the bf(--recursive) (bf(-r)) option (which is implied by