Mentioned the --super option.
[rsync/rsync.git] / rsync.yo
index 8e2e4b7..753837b 100644 (file)
--- a/rsync.yo
+++ b/rsync.yo
@@ -36,7 +36,7 @@ itemize(
   it() exclude and exclude-from options similar to GNU tar
   it() a CVS exclude mode for ignoring the same files that CVS would ignore
   it() can use any transparent remote shell, including ssh or rsh
-  it() does not require root privileges
+  it() does not require super-user privileges
   it() pipelining of file transfers to minimize latency costs
   it() support for anonymous or authenticated rsync daemons (ideal for
        mirroring)
@@ -316,11 +316,14 @@ to the detailed description below for a complete description.  verb(
  -H, --hard-links            preserve hard links
  -K, --keep-dirlinks         treat symlinked dir on receiver as dir
  -p, --perms                 preserve permissions
- -o, --owner                 preserve owner (root only)
+ -o, --owner                 preserve owner (super-user only)
  -g, --group                 preserve group
- -D, --devices               preserve devices (root only)
+     --devices               preserve device files (super-user only)
+     --specials              preserve special files
+ -D                          same as --devices --specials
  -t, --times                 preserve times
  -O, --omit-dir-times        omit directories when preserving times
+     --super                 receiver attempts super-user activities
      --chmod=CHMOD           change destination permissions
  -S, --sparse                handle sparse files efficiently
  -n, --dry-run               show what would have been transferred
@@ -329,8 +332,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
@@ -624,11 +627,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.
@@ -682,21 +685,30 @@ umask setting
 (which is the same behavior as other file-copy utilities, such as cp).
 
 dit(bf(-o, --owner)) This option causes rsync to set the owner of the
-destination file to be the same as the source file.  On most systems,
-only the super-user can set file ownership.  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.
+destination file to be the same as the source file.  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).
+This option has no effect if the receiving rsync is not run as the
+super-user and bf(--super) is not specified.
 
 dit(bf(-g, --group)) This option causes rsync to set the group of the
 destination file to be the same as the source file.  If the receiving
-program is not running as the super-user, only groups that the
+program is not running as the super-user (or with the bf(--no-super)
+option), only groups that the
 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
-block device information to the remote system to recreate these
-devices. This option is only available to the super-user.
+dit(bf(--devices)) This option causes rsync to transfer character and
+block device files to the remote system to recreate these devices.
+This option has no effect if the receiving rsync is not run as the
+super-user and bf(--super) is not specified.
+
+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
@@ -711,6 +723,16 @@ 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).
 
+dit(bf(--super)) This tells the receiving side to attempt super-user
+activities even if the receiving rsync wasn't run by the super-user.  These
+activities include: preserving users via the bf(--owner) option, preserving
+all groups (not just the current user's groups) via the bf(--groups)
+option, and copying devices via the bf(--devices) option.  This is useful
+for systems that allow such activities without being the super-user, and
+also for ensuring that you will get errors if the receiving side isn't
+being running as the super-user.  To turn off super-user activities, the
+super-user can use bf(--no-super).
+
 dit(bf(--chmod)) This options tells rsync to apply the listed "chmod" pattern
 to the permission of the files on the destination.  In addition to the normal
 parsing rules specified in the chmod manpage, you can specify an item that
@@ -719,6 +741,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.
 
@@ -730,20 +754,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,
@@ -762,7 +798,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
@@ -1103,9 +1139,9 @@ If em(DIR) is a relative path, it is relative to the destination directory.
 See also bf(--compare-dest) and bf(--copy-dest).
 
 Note that rsync versions prior to 2.6.1 had a bug that could prevent
-bf(--link-dest) from working properly for a non-root user when bf(-o) was specified
-(or implied by bf(-a)).  You can work-around this bug by avoiding the bf(-o) option
-when sending to an old rsync.
+bf(--link-dest) from working properly for a non-super-user when bf(-o) was
+specified (or implied by bf(-a)).  You can work-around this bug by avoiding
+the bf(-o) option when sending to an old rsync.
 
 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
@@ -1160,9 +1196,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.
@@ -1183,7 +1223,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
@@ -1207,11 +1248,9 @@ quote(itemize(
   it() A bf(p) means the permissions are different and are being updated to
   the sender's value (requires bf(--perms)).
   it() An bf(o) means the owner is different and is being updated to the
-  sender's value (requires bf(--owner) and root privileges).
+  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(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
@@ -1468,7 +1507,7 @@ client version of this option (above) for some extra details.
 dit(bf(--config=FILE)) This specifies an alternate config file than
 the default.  This is only relevant when bf(--daemon) is specified.
 The default is /etc/rsyncd.conf unless the daemon is running over
-a remote shell program and the remote user is not root; in that case
+a remote shell program and the remote user is not the super-user; in that case
 the default is rsyncd.conf in the current directory (typically $HOME).
 
 dit(bf(--no-detach)) When running as a daemon, this option instructs
@@ -1586,18 +1625,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