Man page: Move the description of --info=progress2 to a better place.
[rsync/rsync.git] / rsync.yo
index 54cfe11..fcb8b43 100644 (file)
--- a/rsync.yo
+++ b/rsync.yo
@@ -356,9 +356,11 @@ to the detailed description below for a complete description.  verb(
  -D                          same as --devices --specials
  -t, --times                 preserve modification times
  -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
+     --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)
  -x, --one-file-system       don't cross filesystem boundaries
@@ -736,6 +738,12 @@ specify a backup suffix using the bf(--suffix) option
 (otherwise the files backed up in the specified directory
 will keep their original filenames).
 
+Note that if you specify a relative path, the backup directory will be
+relative to the destination directory, so you probably want to specify
+either an absolute path or a path that starts with "../".  If an rsync
+daemon is the receiver, the backup dir cannot go outside the module's path
+hierarchy, so take extra care not to delete it or copy into it.
+
 dit(bf(--suffix=SUFFIX)) This option allows you to override the default
 backup suffix used with the bf(--backup) (bf(-b)) option. The default suffix is a ~
 if no -bf(-backup-dir) was specified, otherwise it is an empty string.
@@ -761,24 +769,36 @@ its data needs to be updated: instead of the default method of creating
 a new copy of the file and moving it into place when it is complete, rsync
 instead writes the updated data directly to the destination file.
 
-This has several effects: (1) in-use binaries cannot be updated (either the
-OS will prevent this from happening, or binaries that attempt to swap-in
-their data will misbehave or crash), (2) the file's data will be in an
-inconsistent state during the transfer, (3) a file's data may be left in an
-inconsistent state after the transfer if the transfer is interrupted or if
-an update fails, (4) a file that does not have write permissions can not be
-updated, and (5) the efficiency of rsync's delta-transfer algorithm may be
-reduced if some data in the destination file is overwritten before it can
-be copied to a position later in the file (one exception to this is if you
-combine this option with bf(--backup), since rsync is smart enough to use
-the backup file as the basis file for the transfer).
+This has several effects:
+
+quote(itemization(
+  it() Hard links are not broken.  This means the new data will be visible
+  through other hard links to the destination file.  Moreover, attempts to
+  copy differing source files onto a multiply-linked destination file will
+  result in a "tug of war" with the destination data changing back and forth.
+  it() In-use binaries cannot be updated (either the OS will prevent this from
+  happening, or binaries that attempt to swap-in their data will misbehave or
+  crash).
+  it() The file's data will be in an inconsistent state during the transfer
+  and will be left that way if the transfer is interrupted or if an update
+  fails.
+  it() A file that rsync cannot write to cannot be updated. While a super user
+  can update any file, a normal user needs to be granted write permission for
+  the open of the file for writing to be successful.
+  it() The efficiency of rsync's delta-transfer algorithm may be reduced if
+  some data in the destination file is overwritten before it can be copied to
+  a position later in the file.  This does not apply if you use bf(--backup),
+  since rsync is smart enough to use the backup file as the basis file for the
+  transfer.
+))
 
 WARNING: you should not use this option to update files that are being
 accessed by others, so be careful when choosing to use this for a copy.
 
 This option is useful for transferring large files with block-based changes
 or appended data, and also on systems that are disk bound, not network
-bound.
+bound.  It can also help keep a copy-on-write filesystem snapshot from
+diverging the entire contents of a file that only has minor changes.
 
 The option implies bf(--partial) (since an interrupted transfer does not delete
 the file), but conflicts with bf(--partial-dir) and bf(--delay-updates).
@@ -881,6 +901,17 @@ bf(--force) or bf(--delete) is in effect).
 See also bf(--keep-dirlinks) for an analogous option for the receiving
 side.
 
+bf(--copy-dirlinks) applies to all symlinks to directories in the source.  If
+you want to follow only a few specified symlinks, a trick you can use is to
+pass them as additional source args with a trailing slash, using bf(--relative)
+to make the paths match up right.  For example:
+
+quote(tt(rsync -r --relative src/./ src/./follow-me/ dest/))
+
+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/./".
+
 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
@@ -904,17 +935,25 @@ to modify your receiving hierarchy.
 See also bf(--copy-dirlinks) for an analogous option for the sending side.
 
 dit(bf(-H, --hard-links)) This tells rsync to look for hard-linked files in
-the transfer and link together the corresponding files on the receiving
-side.  Without this option, hard-linked files in the transfer are treated
+the source and link together the corresponding files on the destination.
+Without this option, hard-linked files in the source are treated
 as though they were separate files.
 
-When you are updating a non-empty destination, this option only ensures
-that files that are hard-linked together on the source are hard-linked
-together on the destination.  It does NOT currently endeavor to break
-already existing hard links on the destination that do not exist between
-the source files.  Note, however, that if one or more extra-linked files
-have content changes, they will become unlinked when updated (assuming you
-are not using the bf(--inplace) option).
+This option does NOT necessarily ensure that the pattern of hard links on the
+destination exactly matches that on the source.  Cases in which the
+destination may end up with extra hard links include the following:
+
+quote(itemization(
+  it() If the destination contains extraneous hard-links (more linking than
+  what is present in the source file list), the copying algorithm will not
+  break them explicitly.  However, if one or more of the paths have content
+  differences, the normal file-update process will break those extra links
+  (unless you are using the bf(--inplace) option).
+  it() If you specify a bf(--link-dest) directory that contains hard links,
+  the linking of the destination files against the bf(--link-dest) files can
+  cause some paths in the destination to become linked together due to the
+  bf(--link-dest) associations.
+))
 
 Note that rsync can only detect hard links between files that are inside
 the transfer set.  If rsync updates a file that has extra hard-link
@@ -927,7 +966,10 @@ see the bf(--inplace) option for more caveats).
 If incremental recursion is active (see bf(--recursive)), rsync may transfer
 a missing hard-linked file before it finds that another link for that contents
 exists elsewhere in the hierarchy.  This does not affect the accuracy of
-the transfer, just its efficiency.  One way to avoid this is to disable
+the transfer (i.e. which files are hard-linked together), just its efficiency
+(i.e. copying the data for a new, early copy of a hard-linked file that could
+have been found later in the transfer in another member of the hard-linked
+set of files).  One way to avoid this inefficiency is to disable
 incremental recursion using the bf(--no-inc-recursive) option.
 
 dit(bf(-p, --perms)) This option causes the receiving rsync to set the
@@ -1005,16 +1047,20 @@ The source and destination systems must have compatible ACL entries for this
 option to work properly.  See the bf(--fake-super) option for a way to backup
 and restore ACLs that are not compatible.
 
-dit(bf(-X, --xattrs)) This option causes rsync to update the remote
-extended attributes to be the same as the local ones.
+dit(bf(-X, --xattrs)) This option causes rsync to update the destination
+extended attributes to be the same as the source ones.
 
 For systems that support extended-attribute namespaces, a copy being done by a
 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).
+
 dit(bf(--chmod)) This option tells rsync to apply one or more
-comma-separated "chmod" strings to the permission of the files in the
+comma-separated "chmod" modes to the permission of the files in the
 transfer.  The resulting value is treated as though it were the permissions
 that the sending side supplied for the file, which means that this option
 can seem to have no effect on existing files if bf(--perms) is not enabled.
@@ -1022,10 +1068,17 @@ can seem to have no effect on existing files if bf(--perms) is not enabled.
 In addition to the normal parsing rules specified in the bf(chmod)(1)
 manpage, you can specify an item that should only apply to a directory by
 prefixing it with a 'D', or specify an item that should only apply to a
-file by prefixing it with a 'F'.  For example:
+file by prefixing it with a 'F'.  For example, the following will ensure
+that all directories get marked set-gid, that no files are other-writable,
+that both are user-writable and group-writable, and that both have
+consistent executability across all bits:
 
 quote(--chmod=Dg+s,ug+w,Fo-w,+X)
 
+Using octal mode numbers is also allowed:
+
+quote(--chmod=D2775,F664)
+
 It is also legal to specify multiple bf(--chmod) options, as each
 additional option is just appended to the list of changes to make.
 
@@ -1078,6 +1131,9 @@ 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(-J, --omit-link-times)) This tells rsync to omit symlinks when
+it is preserving modification times (see bf(--times)).
+
 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
@@ -1123,9 +1179,16 @@ 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.
 
-NOTE: Don't use this option when the destination is a Solaris "tmpfs"
-filesystem. It seems to have problems seeking over null regions,
-and ends up corrupting the files.
+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
+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.
+
+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.
 
 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
@@ -1198,6 +1261,19 @@ dit(bf(--remove-source-files)) This tells rsync to remove from the sending
 side the files (meaning non-directories) that are a part of the transfer
 and have been successfully duplicated on the receiving side.
 
+Note that you should only use this option on source files that are quiescent.
+If you are using this to move files that show up in a particular directory over
+to another host, make sure that the finished files get renamed into the source
+directory, not directly written into it, so that rsync can't possibly transfer
+a file that is not yet fully written.  If you can't first write the files into
+a different directory, you should use a naming idiom that lets rsync avoid
+transferring files that are not yet finished (e.g. name the file "foo.new" when
+it is written, rename it to "foo" when it is done, and then use the option
+bf(--exclude='*.new') for the rsync transfer).
+
+Starting with 3.1.0, rsync will skip the sender-side removal (and output an
+error) if the file's size or modify time has not stayed unchanged.
+
 dit(bf(--delete)) This tells rsync to delete extraneous files from the
 receiving side (ones that aren't on the sending side), but only for the
 directories that are being synchronized.  You must have asked rsync to
@@ -1436,7 +1512,7 @@ initial items are marked as perishable -- see the FILTER RULES section):
 
 quote(quote(tt(RCS SCCS CVS CVS.adm RCSLOG cvslog.* tags TAGS .make.state
 .nse_depinfo *~ #* .#* ,* _$* *$ *.old *.bak *.BAK *.orig *.rej .del-*
-*.a *.olb *.o *.obj *.so *.exe *.Z *.elc *.ln core .svn/ .git/ .bzr/)))
+*.a *.olb *.o *.obj *.so *.exe *.Z *.elc *.ln core .svn/ .git/ .hg/ .bzr/)))
 
 then, files listed in a $HOME/.cvsignore are added to the list and any
 files listed in the CVSIGNORE environment variable (all cvsignore names
@@ -1566,6 +1642,12 @@ bf(--files-from) filenames are being sent from one host to another, the
 filenames will be translated from the sending host's charset to the
 receiving host's charset.
 
+NOTE: sorting the list of files in the --files-from input helps rsync to be
+more efficient, as it will avoid re-visiting the path elements that are shared
+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.
+
 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
@@ -1760,17 +1842,22 @@ bf(gz)
 bf(iso)
 bf(jpeg)
 bf(jpg)
+bf(lz)
 bf(lzma)
 bf(lzo)
 bf(mov)
 bf(mp3)
 bf(mp4)
 bf(ogg)
+bf(png)
 bf(rar)
 bf(rpm)
 bf(rzip)
 bf(tbz)
 bf(tgz)
+bf(tlz)
+bf(txz)
+bf(xz)
 bf(z)
 bf(zip)
 
@@ -2013,10 +2100,23 @@ with 2 or more bf(-v) options.
 
 The current statistics are as follows: quote(itemization(
   it() bf(Number of files) is the count of all "files" (in the generic
-  sense), which includes directories, symlinks, etc.
-  it() bf(Number of files transferred) is the count of normal files that
-  were updated via rsync's delta-transfer algorithm, which does not include created
-  dirs, symlinks, etc.
+  sense), which includes directories, symlinks, etc.  The total count will
+  be followed by a list of counts by filetype (if the total is non-zero).
+  For example: "(reg: 5, dir: 3, link: 2, dev: 1, special: 1)" lists the
+  totals for regular files, directories, symlinks, devices, and special
+  files.  If any of value is 0, it is completely omitted from the list.
+  it() bf(Number of created files) is the count of how many "files" (generic
+  sense) were created (as opposed to updated).  The total count will be
+  followed by a list of counts by filetype (if the total is non-zero).
+  it() bf(Number of deleted files) is the count of how many "files" (generic
+  sense) were created (as opposed to updated).  The total count will be
+  followed by a list of counts by filetype (if the total is non-zero).
+  Note that this line is only output if deletions are in effect, and only
+  if protocol 31 is being used (the default for rsync 3.1.x).
+  it() bf(Number of regular files transferred) is the count of normal files
+  that were updated via rsync's delta-transfer algorithm, which does not
+  include dirs, symlinks, etc.  Note that rsync 3.1.0 added the word
+  "regular" into this heading.
   it() bf(Total file size) is the total sum of all file sizes in the transfer.
   This does not count any size for directories or special files, but does
   include the size of symlinks.
@@ -2071,8 +2171,9 @@ in level-2 (assuming that a period is your local decimal point).
 
 Backward compatibility note:  versions of rsync prior to 3.1.0 do not support
 human-readable level 1, and they default to level 0.  Thus, specifying one or
-two bf(-h) options behaves the same in old and new versions as long as you
-didn't specify a bf(--no-h) option prior to one or more bf(-h) options.
+two bf(-h) options will behave in a comparable manner in old and new versions
+as long as you didn't specify a bf(--no-h) option prior to one or more bf(-h)
+options.  See the bf(--list-only) option for one difference.
 
 dit(bf(--partial)) By default, rsync will delete any partially
 transferred file if the transfer is interrupted. In some circumstances
@@ -2244,10 +2345,6 @@ in the file list is still going to increase (and each time it does, the count
 of files left to check  will increase by the number of the files added to the
 list).
 
-dit(bf(-P)) The bf(-P) option is equivalent to bf(--partial) bf(--progress).  Its
-purpose is to make it much easier to specify these two options for a long
-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
@@ -2255,6 +2352,10 @@ 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(-P)) The bf(-P) option is equivalent to bf(--partial) bf(--progress).  Its
+purpose is to make it much easier to specify these two options for a long
+transfer that may be interrupted.
+
 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
@@ -2279,6 +2380,14 @@ without using this option.  For example:
 
 verb(    rsync -av --list-only foo* dest/)
 
+Starting with rsync 3.1.0, the sizes output by bf(--list-only) are affected
+by the bf(--human-readable) option.  By default they will contain digit
+separators, but higher levels of readability will output the sizes with
+unit suffixes.  Note also that the column width for the size output has
+increased from 11 to 14 characters for all human-readable levels.  Use
+bf(--no-h) if you want just digits in the sizes, and the old column width
+of 11 characters.
+
 Compatibility note:  when requesting a remote listing of files from an rsync
 that is version 2.6.3 or older, you may encounter an error if you ask for a
 non-recursive listing.  This is because a file listing implies the bf(--dirs)