+This tells you the final file size, that it's 100% complete, the final
+transfer rate for the file, the amount of elapsed time it took to transfer
+the file, and the addition of a total-transfer summary in parentheses.
+These additional numbers tell you how many files have been updated, and
+what percent of the total number of files has been scanned.
+
+dit(bf(-P)) The -P option is equivalent to --partial --progress. I
+found myself typing that combination quite often so I created an
+option to make it easier.
+
+dit(bf(--password-file)) This option allows you to provide a password
+in a file for accessing a remote rsync server. Note that this option
+is only useful when accessing an rsync server using the built in
+transport, not when using a remote shell as the transport. The file
+must not be world readable. It should contain just the password as a
+single line.
+
+dit(bf(--bwlimit=KBPS)) This option allows you to specify a maximum
+transfer rate in kilobytes per second. This option is most effective when
+using rsync with large files (several megabytes and up). Due to the nature
+of rsync transfers, blocks of data are sent, then if rsync determines the
+transfer was too fast, it will wait before sending the next data block. The
+result is an average transfer rate equaling the specified limit. A value
+of zero specifies no limit.
+
+dit(bf(--write-batch=FILE)) Record a file that can later be applied to
+another identical destination with --read-batch. See the "BATCH MODE"
+section for details.
+
+dit(bf(--read-batch=FILE)) Apply all of the changes stored in FILE, a
+file previously generated by --write-batch.
+If em(FILE) is "-" the batch data will be read from standard input.
+See the "BATCH MODE" section for details.
+
+dit(bf(-4, --ipv4) or bf(-6, --ipv6)) Tells rsync to prefer IPv4/IPv6
+when creating sockets. This only affects sockets that rsync has direct
+control over, such as the outgoing socket when directly contacting an
+rsync daemon, or the incoming sockets that an rsync daemon uses to
+listen for connections. One of these options may be required in older
+versions of Linux to work around an IPv6 bug in the kernel (if you see
+an "address already in use" error when nothing else is using the port,
+try specifying --ipv6 or --ipv4 when starting the daemon).
+
+dit(bf(--checksum-seed=NUM)) Set the MD4 checksum seed to the integer
+NUM. This 4 byte checksum seed is included in each block and file
+MD4 checksum calculation. By default the checksum seed is generated
+by the server and defaults to the current 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.
+Note that setting NUM to 0 causes rsync to use the default of time()
+for checksum seed.
+
+enddit()
+
+manpagesection(EXCLUDE PATTERNS)
+
+The exclude and include patterns specified to rsync allow for flexible
+selection of which files to transfer and which files to skip.
+
+Rsync builds an ordered list of include/exclude options as specified on
+the command line. Rsync checks each file and directory
+name against each exclude/include pattern in turn. The first matching
+pattern is acted on. If it is an exclude pattern, then that file is
+skipped. If it is an include pattern then that filename is not
+skipped. If no matching include/exclude pattern is found then the
+filename is not skipped.
+
+The filenames matched against the exclude/include patterns are relative
+to the "root of the transfer". If you think of the transfer as a
+subtree of names that are being sent from sender to receiver, the root
+is where the tree starts to be duplicated in the destination directory.
+This root governs where patterns that start with a / match (see below).
+
+Because the matching is relative to the transfer-root, changing the
+trailing slash on a source path or changing your use of the --relative
+option affects the path you need to use in your matching (in addition to
+changing how much of the file tree is duplicated on the destination
+system). The following examples demonstrate this.
+
+Let's say that we want to match two source files, one with an absolute
+path of "/home/me/foo/bar", and one with a path of "/home/you/bar/baz".
+Here is how the various command choices differ for a 2-source transfer:
+
+verb(
+ Example cmd: rsync -a /home/me /home/you /dest
+ +/- pattern: /me/foo/bar
+ +/- pattern: /you/bar/baz
+ Target file: /dest/me/foo/bar
+ Target file: /dest/you/bar/baz
+
+ Example cmd: rsync -a /home/me/ /home/you/ /dest
+ +/- pattern: /foo/bar (note missing "me")
+ +/- pattern: /bar/baz (note missing "you")
+ Target file: /dest/foo/bar
+ Target file: /dest/bar/baz
+
+ Example cmd: rsync -a --relative /home/me/ /home/you /dest
+ +/- pattern: /home/me/foo/bar (note full path)
+ +/- pattern: /home/you/bar/baz (ditto)
+ Target file: /dest/home/me/foo/bar
+ Target file: /dest/home/you/bar/baz
+
+ Example cmd: cd /home; rsync -a --relative me/foo you/ /dest
+ +/- pattern: /me/foo/bar (starts at specified path)
+ +/- pattern: /you/bar/baz (ditto)
+ Target file: /dest/me/foo/bar
+ Target file: /dest/you/bar/baz
+)
+
+The easiest way to see what name you should include/exclude is to just
+look at the output when using --verbose and put a / in front of the name
+(use the --dry-run option if you're not yet ready to copy any files).
+
+Note that, when using the --recursive (-r) option (which is implied by -a),
+every subcomponent of
+every path is visited from the top down, so include/exclude patterns get
+applied recursively to each subcomponent.
+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.
+
+Note also that the --include and --exclude options take one pattern
+each. To add multiple patterns use the --include-from and
+--exclude-from options or multiple --include and --exclude options.
+
+The patterns can take several forms. The rules are:
+
+itemize(
+
+ it() if the pattern starts with a / then it is matched against the
+ start of the filename, otherwise it is matched against the end of
+ the filename.
+ This is the equivalent of a leading ^ in regular expressions.
+ Thus "/foo" would match a file called "foo" at the transfer-root
+ (see above for how this is different from the filesystem-root).
+ On the other hand, "foo" would match any file called "foo"
+ anywhere in the tree because the algorithm is applied recursively from
+ top down; it behaves as if each path component gets a turn at being the
+ end of the file name.
+
+ 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 "**"
+ then it is matched against the full filename, including any leading
+ directory. If the pattern doesn't contain a / or a "**", then it is
+ matched only against the final component of the filename. Again,
+ remember that the algorithm is applied recursively so "full filename" can
+ actually be any portion of a path below the starting directory.
+
+ it() if the pattern starts with "+ " (a plus followed by a space)
+ then it is always considered an include pattern, even if specified as
+ part of an exclude option. The prefix is discarded before matching.
+
+ it() if the pattern starts with "- " (a minus followed by a space)
+ then it is always considered an exclude pattern, even if specified as
+ part of an include option. The prefix is discarded before matching.
+
+ it() if the pattern is a single exclamation mark ! then the current
+ include/exclude list is reset, removing all previously defined patterns.
+)
+
+The +/- rules are most useful in a list that was read from a file, allowing
+you to have a single exclude list that contains both include and exclude
+options in the proper order.
+
+Remember that the matching occurs at every step in the traversal of the
+directory hierarchy, so you must be sure that all the parent directories of
+the files you want to include are not excluded. This is particularly
+important when using a trailing '*' rule. For instance, this won't work:
+
+verb(
+ + /some/path/this-file-will-not-be-found
+ + /file-is-included
+ - *
+)
+
+This fails because the parent directory "some" is excluded by the '*' rule,
+so rsync never visits any of the files in the "some" or "some/path"
+directories. One solution is to ask for all directories in the hierarchy
+to be included by using a single rule: --include='*/' (put it somewhere
+before the --exclude='*' rule). Another solution is to add specific
+include rules for all the parent dirs that need to be visited. For
+instance, this set of rules works fine:
+
+verb(
+ + /some/
+ + /some/path/
+ + /some/path/this-file-is-found
+ + /file-also-included
+ - *
+)
+
+Here are some examples of exclude/include matching:
+
+itemize(
+ it() --exclude "*.o" would exclude all filenames matching *.o
+ it() --exclude "/foo" would exclude a file called foo in the transfer-root directory
+ it() --exclude "foo/" would exclude any directory called foo
+ it() --exclude "/foo/*/bar" would exclude any file called bar two
+ levels below a directory called foo in the transfer-root directory
+ it() --exclude "/foo/**/bar" would exclude any file called bar two
+ or more levels below a directory called foo in the transfer-root directory
+ it() --include "*/" --include "*.c" --exclude "*" would include all
+ directories and C source files
+ it() --include "foo/" --include "foo/bar.c" --exclude "*" would include
+ only foo/bar.c (the foo/ directory must be explicitly included or
+ it would be excluded by the "*")
+)
+
+manpagesection(BATCH MODE)
+
+bf(Note:) Batch mode should be considered experimental in this version
+of rsync. The interface and behavior have now stabilized, though, so
+feel free to try this out.
+
+Batch mode can be used to apply the same set of updates to many
+identical systems. Suppose one has a tree which is replicated on a
+number of hosts. Now suppose some changes have been made to this
+source tree and those changes need to be propagated to the other
+hosts. In order to do this using batch mode, rsync is run with the
+write-batch option to apply the changes made to the source tree to one
+of the destination trees. The write-batch option causes the rsync
+client to store in a "batch file" all the information needed to repeat
+this operation against other, identical destination trees.
+
+To apply the recorded changes to another destination tree, run rsync
+with the read-batch option, specifying the name of the same batch
+file, and the destination tree. Rsync updates the destination tree
+using the information stored in the batch file.
+
+For convenience, one additional file is creating when the write-batch
+option is used. This file's name is created by appending
+".sh" to the batch filename. The .sh file contains
+a command-line suitable for updating a destination tree using that
+batch file. It can be executed using a Bourne(-like) shell, optionally
+passing in an alternate destination tree pathname which is then used
+instead of the original path. This is useful when the destination tree
+path differs from the original destination tree path.
+
+Generating the batch file once saves having to perform the file
+status, checksum, and data block generation more than once when
+updating multiple destination trees. Multicast transport protocols can
+be used to transfer the batch update files in parallel to many hosts
+at once, instead of sending the same data to every host individually.
+
+Examples:
+
+verb(
+ $ rsync --write-batch=foo -a host:/source/dir/ /adest/dir/
+ $ scp foo* remote:
+ $ ssh remote ./foo.sh /bdest/dir/
+)
+
+verb(
+ $ rsync --write-batch=foo -a /source/dir/ /adest/dir/
+ $ ssh remote rsync --read-batch=- -a /bdest/dir/ <foo
+)
+
+In these examples, rsync is used to update /adest/dir/ from /source/dir/
+and the information to repeat this operation is stored in "foo" and
+"foo.sh". The host "remote" is then updated with the batched data going
+into the directory /bdest/dir. The differences between the two examples
+reveals some of the flexibility you have in how you deal with batches:
+
+itemize(
+
+ it() The first example shows that the initial copy doesn't have to be
+ local -- you can push or pull data to/from a remote host using either the
+ remote-shell syntax or rsync daemon syntax, as desired.
+
+ it() The first example uses the created "foo.sh" file to get the right
+ rsync options when running the read-batch command on the remote host.
+
+ it() The second example reads the batch data via standard input so that
+ the batch file doesn't need to be copied to the remote machine first.
+ This example avoids the foo.sh script because it needed to use a modified
+ --read-batch option, but you could edit the script file if you wished to
+ make use of it (just be sure that no other option is trying to use
+ standard input, such as the "--exclude-from=-" option).
+
+)
+
+Caveats:
+
+The read-batch option expects the destination tree that it is updating
+to be identical to the destination tree that was used to create the
+batch update fileset. When a difference between the destination trees
+is encountered the update might be discarded with no error (if the file
+appears to be up-to-date already) or the file-update may be attempted
+and then, if the file fails to verify, the update discarded with an
+error. This means that it should be safe to re-run a read-batch operation
+if the command got updated. If you wish to force the batched-update to
+always be attempted regardless of the file's size and date, use the -I
+option. If an error occurs, the destination tree will probably be in a
+partially updated state. In that case, rsync can
+be used in its regular (non-batch) mode of operation to fix up the
+destination tree.
+
+The rsync version used on all destinations must be at least as new as the
+one used to generate the batch file.
+
+The --dry-run (-n) option does not work in batch mode and yields a runtime
+error.
+
+When reading a batch file, rsync will force the value of certain options
+to match the data in the batch file if you didn't set them to the same
+as the batch-writing command. Other options can (and should) be changed.
+For instance
+--write-batch changes to --read-batch, --files-from is dropped, and the
+--include/--exclude options are not needed unless --delete is specified
+without --delete-excluded.
+
+The code that creates the BATCH.sh file transforms any include/exclude
+options into a single list that is appended as a "here" document to the
+shell script file. An advanced user can use this to modify the exclude
+list if a change in what gets deleted by --delete is desired. A normal
+user can ignore this detail and just use the shell script as an easy way
+to run the appropriate --read-batch command for the batched data.
+
+See bf(http://www.ils.unc.edu/i2dsi/unc_rsync+.html) for papers and technical
+reports.
+
+manpagesection(SYMBOLIC LINKS)
+
+Three basic behaviors are possible when rsync encounters a symbolic
+link in the source directory.
+
+By default, symbolic links are not transferred at all. A message
+"skipping non-regular" file is emitted for any symlinks that exist.
+
+If bf(--links) is specified, then symlinks are recreated with the same
+target on the destination. Note that bf(--archive) implies
+bf(--links).
+
+If bf(--copy-links) is specified, then symlinks are "collapsed" by
+copying their referent, rather than the symlink.
+
+rsync also distinguishes "safe" and "unsafe" symbolic links. An
+example where this might be used is a web site mirror that wishes
+ensure the rsync module they copy does not include symbolic links to
+bf(/etc/passwd) in the public section of the site. Using
+bf(--copy-unsafe-links) will cause any links to be copied as the file
+they point to on the destination. Using bf(--safe-links) will cause
+unsafe links to be omitted altogether.
+
+Symbolic links are considered unsafe if they are absolute symlinks
+(start with bf(/)), empty, or if they contain enough bf("..")
+components to ascend from the directory being copied.
+
+manpagesection(DIAGNOSTICS)
+
+rsync occasionally produces error messages that may seem a little
+cryptic. The one that seems to cause the most confusion is "protocol
+version mismatch - is your shell clean?".
+
+This message is usually caused by your startup scripts or remote shell
+facility producing unwanted garbage on the stream that rsync is using
+for its transport. The way to diagnose this problem is to run your
+remote shell like this:
+
+verb(
+ ssh remotehost /bin/true > out.dat
+)
+
+then look at out.dat. If everything is working correctly then out.dat
+should be a zero length file. If you are getting the above error from
+rsync then you will probably find that out.dat contains some text or
+data. Look at the contents and try to work out what is producing
+it. The most common cause is incorrectly configured shell startup
+scripts (such as .cshrc or .profile) that contain output statements
+for non-interactive logins.
+
+If you are having trouble debugging include and exclude patterns, then
+try specifying the -vv option. At this level of verbosity rsync will
+show why each individual file is included or excluded.
+
+manpagesection(EXIT VALUES)
+
+startdit()
+dit(bf(0)) Success
+dit(bf(1)) Syntax or usage error
+dit(bf(2)) Protocol incompatibility
+dit(bf(3)) Errors selecting input/output files, dirs
+dit(bf(4)) Requested action not supported: an attempt
+was made to manipulate 64-bit files on a platform that cannot support
+them; or an option was specified that is supported by the client and
+not by the server.
+dit(bf(5)) Error starting client-server protocol
+dit(bf(10)) Error in socket I/O
+dit(bf(11)) Error in file I/O
+dit(bf(12)) Error in rsync protocol data stream
+dit(bf(13)) Errors with program diagnostics
+dit(bf(14)) Error in IPC code
+dit(bf(20)) Received SIGUSR1 or SIGINT
+dit(bf(21)) Some error returned by waitpid()
+dit(bf(22)) Error allocating core memory buffers
+dit(bf(23)) Partial transfer due to error
+dit(bf(24)) Partial transfer due to vanished source files
+dit(bf(30)) Timeout in data send/receive
+enddit()
+
+manpagesection(ENVIRONMENT VARIABLES)
+
+startdit()
+
+dit(bf(CVSIGNORE)) The CVSIGNORE environment variable supplements any
+ignore patterns in .cvsignore files. See the --cvs-exclude option for
+more details.
+
+dit(bf(RSYNC_RSH)) The RSYNC_RSH environment variable allows you to
+override the default shell used as the transport for rsync. Command line
+options are permitted after the command name, just as in the -e option.
+
+dit(bf(RSYNC_PROXY)) The RSYNC_PROXY environment variable allows you to
+redirect your rsync client to use a web proxy when connecting to a
+rsync daemon. You should set RSYNC_PROXY to a hostname:port pair.
+
+dit(bf(RSYNC_PASSWORD)) Setting RSYNC_PASSWORD to the required
+password allows you to run authenticated rsync connections to an rsync
+daemon without user intervention. Note that this does not supply a
+password to a shell transport such as ssh.
+
+dit(bf(USER) or bf(LOGNAME)) The USER or LOGNAME environment variables
+are used to determine the default username sent to an rsync server.
+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.