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()
As expected, if neither the source or destination path specify a remote
host, the copy occurs locally (see also the bf(--list-only) option).
+Rsync refers to the local side as the "client" and the remote side as the
+"server". Don't confuse "server" with an rsync daemon -- a daemon is always a
+server, but a server can be either a daemon or a remote-shell spawned process.
+
manpagesection(SETUP)
See the file README for installation instructions.
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))
list of accessible paths on the daemon will be shown.
it() if you specify no local destination then a listing of the
specified files on the remote daemon is provided.
- it() you must not specify the bf(--rsh) (bf(-e)) option.
+ it() you must not specify the bf(--rsh) (bf(-e)) option (since
+ that overrides the daemon connection to use ssh -- see USING
+ RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION below).
)
An example that copies all the files in a remote module named "src":
verb( export RSYNC_CONNECT_PROG='ssh proxyhost nc %H 873'
rsync -av targethost1::module/src/ /dest/
- rsync -av rsync:://targethost2/module/src/ /dest/ )
+ rsync -av rsync://targethost2/module/src/ /dest/ )
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 code(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
If you're using one of the remote-shell transports for the transfer, there is
no need to manually start an rsync daemon.
+manpagesection(SORTED TRANSFER ORDER)
+
+Rsync always sorts the specified filenames into its internal transfer list.
+This handles the merging together of the contents of identically named
+directories, makes it easy to remove duplicate filenames, and may confuse
+someone when the files are transferred in a different order than what was
+given on the command-line.
+
+If you need a particular file to be transferred prior to another, either
+separate the files into different rsync calls, or consider using
+bf(--delay-updates) (which doesn't affect the sorted transfer order, but
+does make the final file-updating phase happen much more rapidly).
+
manpagesection(EXAMPLES)
Here are some examples of how I use rsync.
-v, --verbose increase verbosity
--info=FLAGS fine-grained informational verbosity
--debug=FLAGS fine-grained debug verbosity
+ --msgs2stderr special output handling for debugging
-q, --quiet suppress non-error messages
--no-motd suppress daemon-mode MOTD (see caveat)
-c, --checksum skip based on checksum, not mod-time & size
-L, --copy-links transform symlink into referent file/dir
--copy-unsafe-links only "unsafe" symlinks are transformed
--safe-links ignore symlinks that point outside the tree
+ --munge-links munge symlinks to make them safer
-k, --copy-dirlinks transform symlink to dir into referent dir
-K, --keep-dirlinks treat symlinked dir on receiver as dir
-H, --hard-links preserve hard links
-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
+ -S, --sparse turn sequences of nulls into sparse blocks
+ --preallocate allocate dest files before writing
+ --write-devices write to devices as files (implies --inplace)
-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
--remove-source-files sender removes synchronized files (non-dir)
--del an alias for --delete-during
--delete delete extraneous files from dest dirs
- --delete-before receiver deletes before transfer (default)
- --delete-during receiver deletes during xfer, not before
+ --delete-before receiver deletes before xfer, not during
+ --delete-during receiver deletes during the transfer
--delete-delay find deletions during, delete after
- --delete-after receiver deletes after transfer, not before
+ --delete-after receiver deletes after transfer, not during
--delete-excluded also delete excluded files from dest dirs
+ --ignore-missing-args ignore missing source args without error
+ --delete-missing-args delete missing source args from destination
--ignore-errors delete even if there are I/O errors
--force force deletion of dirs even if not empty
--max-delete=NUM don't delete more than NUM files
--delay-updates put all updated files into place at end
-m, --prune-empty-dirs prune empty directory chains from file-list
--numeric-ids don't map uid/gid values by user/group name
+ --usermap=STRING custom username mapping
+ --groupmap=STRING custom groupname mapping
+ --chown=USER:GROUP simple username/groupname mapping
--timeout=SECONDS set I/O timeout in seconds
--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
--files-from=FILE read list of source-file names from FILE
-0, --from0 all *from/filter files are delimited by 0s
-s, --protect-args no space-splitting; wildcard chars only
+ --copy-as=USER[:GROUP] specify user & optional group for the copy
--address=ADDRESS bind address for outgoing socket to daemon
--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
--log-file-format=FMT log updates using the specified FMT
--password-file=FILE read daemon-access password from FILE
--list-only list the files instead of copying them
- --bwlimit=KBPS limit I/O bandwidth; KBytes per second
+ --bwlimit=RATE limit socket I/O bandwidth
--write-batch=FILE write a batched update to FILE
--only-write-batch=FILE like --write-batch but w/o updating dest
--read-batch=FILE read a batched update from FILE
accepted: verb(
--daemon run as an rsync daemon
--address=ADDRESS bind to the specified address
- --bwlimit=KBPS limit I/O bandwidth; KBytes per second
+ --bwlimit=RATE limit socket I/O bandwidth
--config=FILE specify alternate rsyncd.conf file
-M, --dparam=OVERRIDE override global daemon config parameter
--no-detach do not detach from the parent
manpageoptions()
-rsync uses the GNU long options package. Many of the command line
-options have two variants, one short and one long. These are shown
-below, separated by commas. Some options only have a long variant.
-The '=' for options that take a parameter is optional; whitespace
-can be used instead.
+Rsync accepts both long (double-dash + word) and short (single-dash + letter)
+options. The full list of the available options are described below. If an
+option can be specified in more than one way, the choices are comma-separated.
+Some options only have a long variant, not a short. If the option takes a
+parameter, the parameter is only listed after the long variant, even though it
+must also be specified for the short. When specifying a parameter, you can
+either use the form --option=param or replace the '=' with whitespace. The
+parameter may need to be quoted in some manner for it to survive the shell's
+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).
+
+description(
-startdit()
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)
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
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
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.
+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 name is useful when invoking rsync from
+from the remote server. This option is useful when invoking rsync from
cron.
dit(bf(--no-motd)) This option affects the information that is output
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:
+
+verb( rsync alias -a -a@-1)
+verb( 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
uses a "quick check" that (by default) checks if each file's size and time
of last modification match between the sender and receiver. This option
-changes this to compare a 128-bit MD4 checksum for each file that has a
+changes this to compare a 128-bit checksum for each file that has a
matching size. Generating the checksums means that both sides will expend
a lot of disk I/O reading all the data in the files in the transfer (and
this is prior to any reading that will be done to transfer changed files),
automatic after-the-transfer verification has nothing to do with this
option's before-the-transfer "Does this file need to be updated?" check.
+For protocol 30 and beyond (first supported in 3.0.0), the checksum used is
+MD5. For older protocols, the checksum used is MD4.
+
dit(bf(-a, --archive)) This is equivalent to bf(-rlptgoD). It is a quick
way of saying you want recursion and want to preserve almost
everything (with -H being a notable omission).
you want to send several different directories at the same time. For
example, if you used this command:
-quote(tt( rsync -av /foo/bar/baz.c remote:/tmp/))
+verb( rsync -av /foo/bar/baz.c remote:/tmp/)
... this would create a file named baz.c in /tmp/ on the remote
machine. If instead you used
-quote(tt( rsync -avR /foo/bar/baz.c remote:/tmp/))
+verb( rsync -avR /foo/bar/baz.c remote:/tmp/)
then a file named /tmp/foo/bar/baz.c would be created on the remote
machine, preserving its full path. These extra path elements are called
sending side (beginning with 2.6.7), you can insert a dot and a slash into
the source path, like this:
-quote(tt( rsync -avR /foo/./bar/baz.c remote:/tmp/))
+verb( rsync -avR /foo/./bar/baz.c remote:/tmp/)
That would create /tmp/bar/baz.c on the remote machine. (Note that the
dot must be followed by a slash, so "/foo/." would not be abbreviated.)
-(2) For older rsync versions, you would need to use a chdir to limit the
+For older rsync versions, you would need to use a chdir to limit the
source path. For example, when pushing files:
-quote(tt( (cd /foo; rsync -avR bar/baz.c remote:/tmp/) ))
+verb( (cd /foo; rsync -avR bar/baz.c remote:/tmp/) )
(Note that the parens put the two commands into a sub-shell, so that the
"cd" command doesn't remain in effect for future commands.)
If you're pulling files from an older rsync, use this idiom (but only
for a non-daemon transfer):
-quote(
-tt( rsync -avR --rsync-path="cd /foo; rsync" \ )nl()
-tt( remote:bar/baz.c /tmp/)
-)
+verb( rsync -avR --rsync-path="cd /foo; rsync" \ )
+verb( remote:bar/baz.c /tmp/)
dit(bf(--no-implied-dirs)) This option affects the default behavior of the
bf(--relative) option. When it is specified, the attributes of the implied
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 "Pp *~")). This will prevent previously backed-up files from being
+(e.g. bf(-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
(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.
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
where the destination has a file, the transfer would occur regardless of
the timestamps.
-dit(bf(--inplace)) This option changes how rsync transfers a file when the
-file's data needs to be updated: instead of the default method of creating
+This option is a transfer rule, not an exclude, so it doesn't affect the
+data that goes into the file-lists, and thus it doesn't affect deletions.
+It just limits the files that the receiver requests to be transferred.
+
+dit(bf(--inplace)) This option changes how rsync transfers a file when
+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 transfer of large files with block-based changes
+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).
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
checksum verification step, which will cause a file to be resent if the
final verification step fails (rsync uses a normal, non-appending
-bf(--inplace) transfer for the resend).
+bf(--inplace) transfer for the resend). It otherwise has the exact same
+caveats for files that have not grown larger, so don't use this for a
+general copy.
Note: prior to rsync 3.0.0, the bf(--append) option worked like
bf(--append-verify), so if you are interacting with an older rsync (or the
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.
source path itself when bf(--relative) is used. This option has no
additional effect if bf(--copy-links) was also specified.
+Note that the cut-off point is the top of the transfer, which is the part of
+the path that rsync isn't mentioning in the verbose output. If you copy
+"/src/subdir" to "/dest/" then the "subdir" directory is a name inside the
+transfer tree, not the top of the transfer (which is /src) so it is legal for
+created relative symlinks to refer to other names inside the /src and /dest
+directories. If you instead copy "/src/subdir/" (with a trailing slash) to
+"/dest/subdir" that would not allow symlinks to any files outside of "subdir".
+
dit(bf(--safe-links)) This tells rsync to ignore any symbolic links
which point outside the copied tree. All absolute symlinks are
also ignored. Using this option in conjunction with bf(--relative) may
give unexpected results.
+dit(bf(--munge-links)) This option tells rsync to (1) modify all symlinks on
+the receiving side in a way that makes them unusable but recoverable (see
+below), or (2) to unmunge symlinks on the sending side that had been stored in
+a munged state. This is useful if you don't quite trust the source of the data
+to not try to slip in a symlink to a unexpected place.
+
+The way rsync disables the use of symlinks is to prefix each one with the
+string "/rsyncd-munged/". This prevents the links from being used as long as
+that directory does not exist. When this option is enabled, rsync will refuse
+to run if that path is a directory or a symlink to a directory.
+
+The option only affects the client side of the transfer, so if you need it to
+affect the server, specify it via bf(--remote-option). (Note that in a local
+transfer, the client side is the sender.)
+
+This option has no affect on a daemon, since the daemon configures whether it
+wants munged symlinks via its "munge symlinks" parameter. See also the
+"munge-symlinks" perl script in the support directory of the source code.
+
dit(bf(-k, --copy-dirlinks)) This option causes the sending side to treat
a symlink to a directory as though it were a real directory. This is
useful if you don't want symlinks to non-directories to be affected, as
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/./".
+
+)
+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
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
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
putting this line in the file ~/.popt (the following defines the bf(-Z) option,
and includes --no-g to use the default group of the destination dir):
-quote(tt( rsync alias -Z --no-p --no-g --chmod=ugo=rwX))
+verb( rsync alias -Z --no-p --no-g --chmod=ugo=rwX)
You could then use this new option in a command such as this one:
-quote(tt( rsync -avZ src/ dest/))
+verb( rsync -avZ src/ dest/)
(Caveat: make sure that bf(-a) does not follow bf(-Z), or it will re-enable
the two "--no-*" options mentioned above.)
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.
+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" strings to the permission of the files in the
-transfer. The resulting value is treated as though it was the permissions
+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.
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.
dit(bf(-D)) The bf(-D) option is equivalent to bf(--devices) bf(--specials).
+dit(bf(--write-devices)) This tells rsync to treat a device on the receiving
+side as a regular file, allowing the writing of file data into a device.
+
+This option implies the bf(--inplace) option.
+
+Be careful using this, as you should know what devices are present on the
+receiving side of the transfer, especially if running rsync as root.
+
+This option is refused by an rsync daemon.
+
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
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)).
+
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
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
+being run as the super-user. To turn off super-user activities, the
super-user can use bf(--no-super).
dit(bf(--fake-super)) When this option is enabled, rsync simulates
To affect the remote side of a remote-shell connection, use the
bf(--remote-option) (bf(-M)) option:
-quote(tt( rsync -av -M--fake-super /src/ host:/dest/))
+verb( rsync -av -M--fake-super /src/ host:/dest/)
For a local copy, this option affects both the source and the destination.
If you wish a local copy to enable this option just for the destination
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.
-
-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.
+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
+bf(fallocate)(2) system call or Cygwin's bf(posix_fallocate)(3), not the slow
+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
The output of bf(--itemize-changes) is supposed to be exactly the same on a
dry run and a subsequent real run (barring intentional trickery and system
-call failures); if it isn't, that's a bug. Other output is the same to the
-extent practical, but may differ in some areas. Notably, a dry run does not
+call failures); if it isn't, that's a bug. Other output should be mostly
+unchanged, but may differ in some areas. Notably, a dry run does not
send the actual data for file transfers, so bf(--progress) has no effect,
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 are needed.
+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.
+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 specified) 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
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
combined with the bf(--ignore-existing) option, no files will be updated
(which can be useful if all you want to do is delete extraneous files).
+This option is a transfer rule, not an exclude, so it doesn't affect the
+data that goes into the file-lists, and thus it doesn't affect deletions.
+It just limits the files that the receiver requests to be transferred.
+
dit(bf(--ignore-existing)) This tells rsync to skip updating files that
already exist on the destination (this does em(not) ignore existing
directories, or nothing would get done). See also bf(--existing).
+This option is a transfer rule, not an exclude, so it doesn't affect the
+data that goes into the file-lists, and thus it doesn't affect deletions.
+It just limits the files that the receiver requests to be transferred.
+
This option can be useful for those doing backups using the bf(--link-dest)
option when they need to continue a backup run that got interrupted. Since
a bf(--link-dest) run is copied into a new directory hierarchy (when it is
-used properly), using bf(--ignore existing) will ensure that the
+used properly), using bf(--ignore-existing) will ensure that the
already-handled files don't get tweaked (which avoids a change in
permissions on the hard-linked files). This does mean that this option
is only looking at the existing files in the destination hierarchy itself.
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
If the sending side detects any I/O errors, then the deletion of any
files at the destination will be automatically disabled. This is to
prevent temporary filesystem failures (such as NFS errors) on the
-sending side causing a massive deletion of files on the
+sending side from causing a massive deletion of files on the
destination. You can override this with the bf(--ignore-errors) option.
The bf(--delete) option may be combined with one of the --delete-WHEN options
bf(--delete-excluded).
See bf(--delete) (which is implied) for more details on file-deletion.
+dit(bf(--ignore-missing-args)) When rsync is first processing the explicitly
+requested source files (e.g. command-line arguments or bf(--files-from)
+entries), it is normally an error if the file cannot be found. This option
+suppresses that error, and does not try to transfer the file. This does not
+affect subsequent vanished-file errors if a file was initially found to be
+present and later is no longer there.
+
+dit(bf(--delete-missing-args)) This option takes the behavior of (the implied)
+bf(--ignore-missing-args) option a step farther: each missing arg will become
+a deletion request of the corresponding destination file on the receiving side
+(should it exist). If the destination file is a non-empty directory, it will
+only be successfully deleted if --force or --delete are in effect. Other than
+that, this option is independent of any other type of delete processing.
+
+The missing source files are represented by special file-list entries which
+display as a "*missing" entry in the bf(--list-only) output.
+
dit(bf(--ignore-errors)) Tells bf(--delete) to go ahead and delete files
even when there are I/O errors.
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
suffixed with a string to indicate a size multiplier, and
may be a fractional value (e.g. "bf(--max-size=1.5m)").
+This option is a transfer rule, not an exclude, so it doesn't affect the
+data that goes into the file-lists, and thus it doesn't affect deletions.
+It just limits the files that the receiver requests to be transferred.
+
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).
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.
+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
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')nl()
-tt( -e 'ssh -o "ProxyCommand nohup ssh firewall nc -w1 %h %p"')nl()
-)
+verb( -e 'ssh -p 2234')
+verb( -e 'ssh -o "ProxyCommand nohup ssh firewall nc -w1 %h %p"')
(Note that ssh users can alternately customize site-specific connect
options in their .ssh/config file.)
One tricky example is to set a different default directory on the remote
machine for use with the bf(--relative) option. For instance:
-quote(tt( rsync -avR --rsync-path="cd /a/b && rsync" host:c/d /e/))
+verb( rsync -avR --rsync-path="cd /a/b && rsync" host:c/d /e/)
dit(bf(-M, --remote-option=OPTION)) This option is used for more advanced
situations where you want certain effects to be limited to one side of the
transfer only. For instance, if you want to pass bf(--log-file=FILE) and
bf(--fake-super) to the remote system, specify it like this:
-quote(tt( rsync -av -M --log-file=foo -M--fake-super src/ dest/))
+verb( rsync -av -M --log-file=foo -M--fake-super src/ dest/)
If you want to have an option affect only the local side of a transfer when
it normally affects both sides, send its negation to the remote side. Like
this:
-quote(tt( rsync -av -x -M--no-x src/ dest/))
+verb( rsync -av -x -M--no-x src/ dest/)
Be cautious using this, as it is possible to toggle an option that will cause
rsync to have a different idea about what data to expect next over the socket,
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
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
dit(bf(-F)) The bf(-F) option is a shorthand for adding two bf(--filter) rules to
your command. The first time it is used is a shorthand for this rule:
-quote(tt( --filter='dir-merge /.rsync-filter'))
+verb( --filter='dir-merge /.rsync-filter')
This tells rsync to look for per-directory .rsync-filter files that have
been sprinkled through the hierarchy and use their rules to filter the
files in the transfer. If bf(-F) is repeated, it is a shorthand for this
rule:
-quote(tt( --filter='exclude .rsync-filter'))
+verb( --filter='exclude .rsync-filter')
This filters out the .rsync-filter files themselves from the transfer.
allowed to go higher than the source dir. For example, take this
command:
-quote(tt( rsync -a --files-from=/tmp/foo /usr remote:/backup))
+verb( rsync -a --files-from=/tmp/foo /usr remote:/backup)
If /tmp/foo contains the string "bin" (or even "/bin"), the /usr/bin
directory will be created as /backup/bin on the remote host. If it
specify just a prefix of ":" to mean "use the remote end of the
transfer". For example:
-quote(tt( rsync -a --files-from=:/path/file-list src:/ /tmp/copy))
+verb( rsync -a --files-from=:/path/file-list src:/ /tmp/copy)
This would copy all the files specified in the /path/file-list file that
was located on the remote "src" host.
+If the bf(--iconv) and bf(--protect-args) options are specified and the
+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.
+
+)
+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
It does not affect bf(--cvs-exclude) (since all names read from a .cvsignore
file are split on whitespace).
-If the bf(--iconv) and bf(--protect-args) options are specified and the
-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.
-
-dit(bf(-s, --protect-args)) This option sends all filenames and some options to
+dit(bf(-s, --protect-args)) This option sends all filenames and most options to
the remote rsync without allowing the remote shell to interpret them. This
means that spaces are not split in names, and any non-wildcard special
characters are not translated (such as ~, $, ;, &, etc.). Wildcards are
expanded on the remote host by rsync (instead of the shell doing it).
-If you use this option with bf(--iconv), the args will also be translated
+If you use this option with bf(--iconv), the args related to the remote
+side will also be translated
from the local to the remote character-set. The translation happens before
wild-cards are expanded. See also the bf(--files-from) option.
+You may also control this option via the RSYNC_PROTECT_ARGS environment
+variable. If this variable has a non-zero value, this option will be enabled
+by default, otherwise it will be disabled by default. Either state is
+overridden by a manually specified positive or negative version of this option
+(note that bf(--no-s) and bf(--no-protect-args) are the negative versions).
+Since this option was first introduced in 3.0.0, you'll need to make sure it's
+disabled if you ever need to interact with a remote rsync that is older than
+that.
+
+Rsync can also be configured (at build time) to have this option enabled by
+default (with is overridden by both the environment and the command-line).
+This option will eventually become a new default setting at some
+as-yet-undetermined point in the future.
+
+dit(bf(--copy-as=USER[:GROUP])) This option instructs rsync to use the USER and
+(if specified after a colon) the GROUP for the copy operations. This only works
+if the user that is running rsync has the ability to change users. If the group
+is not specified then the user's default groups are used.
+
+The option only affects one side of the transfer unless the transfer is local,
+in which case it affects both sides. Use the bf(--remote-option) to affect the
+remote side, such as bf(-M--copy-as=joe). For a local transfer, see the "lsh"
+support file provides a local-shell helper script that can be used to allow a
+"localhost:" host-spec to be specified without needing to setup any remote
+shells (allowing you to specify remote options that affect the side of the
+transfer that is using the host-spec, and local options for the other side).
+
+This option can help to reduce the risk of an rsync being run as root into or
+out of a directory that might have live changes happening to it and you want to
+make sure that root-level read or write actions of system files are not
+possible. While you could alternatively run all of rsync as the specified user,
+sometimes you need the root-level host-access credentials to be used, so this
+allows rsync to drop root for the copying part of the operation after the
+remote-shell or daemon connection is established.
+
+For example, the following rsync writes the local files as user "joe":
+
+verb( sudo rsync -aiv --copy-as=joe host1:backups/joe/ /home/joe/)
+
+This makes all files owned by user "joe", limits the groups to those that are
+available to that user, and makes it impossible for the joe user to do a timed
+exploit of the path to induce a change to a file that the joe use has no
+permissions to change.
+
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.
has an identical size and modified-time, or a similarly-named file. If
found, rsync uses the fuzzy basis file to try to speed up the transfer.
+If the option is repeated, the fuzzy scan will also be done in any matching
+alternate destination directories that are specified via bf(--compare-dest),
+bf(--copy-dest), or bf(--link-dest).
+
Note that the use of the bf(--delete) option might get rid of any potential
fuzzy-match files, so either use bf(--delete-after) or specify some
filename exclusions if you need to prevent this.
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
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.
possibly ownership) in order for the files to be linked together.
An example:
-quote(tt( rsync -av --link-dest=$PWD/prior_dir host:src_dir/ new_dir/))
+verb( rsync -av --link-dest=$PWD/prior_dir host:src_dir/ new_dir/)
+
+If file's aren't linking, double-check their attributes. Also check if some
+attributes are getting forced outside of rsync's control, such a mount option
+that squishes root to a single user, or mounts a removable drive with generic
+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
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.
Simple character-class matching is supported: each must consist of a list
of letters inside the square brackets (e.g. no special classes, such as
-"[:alpha:]", are supported).
+"[:alpha:]", are supported, and '-' has no special meaning).
The characters asterisk (*) and question-mark (?) have no special meaning.
verb( --skip-compress=gz/jpg/mp[34]/7z/bz2)
-The default list of suffixes that will not be compressed is this (several
-of these are newly added for 3.0.0):
-
-verb( gz/zip/z/rpm/deb/iso/bz2/t[gb]z/7z/mp[34]/mov/avi/ogg/jpg/jpeg)
+The default list of suffixes that will not be compressed is this (in this
+version of rsync):
+
+bf(7z)
+bf(ace)
+bf(avi)
+bf(bz2)
+bf(deb)
+bf(gpg)
+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)
This list will be replaced by your bf(--skip-compress) list in all but one
situation: a copy from a daemon rsync will add your skipped suffixes to
the chroot setting affects rsync's ability to look up the names of the
users and groups and what you can do about it.
+dit(bf(--usermap=STRING, --groupmap=STRING)) These options allow you to
+specify users and groups that should be mapped to other values by the
+receiving side. The bf(STRING) is one or more bf(FROM):bf(TO) pairs of
+values separated by commas. Any matching bf(FROM) value from the sender is
+replaced with a bf(TO) value from the receiver. You may specify usernames
+or user IDs for the bf(FROM) and bf(TO) values, and the bf(FROM) value may
+also be a wild-card string, which will be matched against the sender's
+names (wild-cards do NOT match against ID numbers, though see below for
+why a '*' matches everything). You may instead specify a range of ID
+numbers via an inclusive range: LOW-HIGH. For example:
+
+verb( --usermap=0-99:nobody,wayne:admin,*:normal --groupmap=usr:1,1:usr)
+
+The first match in the list is the one that is used. You should specify
+all your user mappings using a single bf(--usermap) option, and/or all
+your group mappings using a single bf(--groupmap) option.
+
+Note that the sender's name for the 0 user and group are not transmitted
+to the receiver, so you should either match these values using a 0, or use
+the names in effect on the receiving side (typically "root"). All other
+bf(FROM) names match those in use on the sending side. All bf(TO) names
+match those in use on the receiving side.
+
+Any IDs that do not have a name on the sending side are treated as having an
+empty name for the purpose of matching. This allows them to be matched via
+a "*" or using an empty name. For instance:
+
+verb( --usermap=:nobody --groupmap=*:nobody)
+
+When the bf(--numeric-ids) option is used, the sender does not send any
+names, so all the IDs are treated as having an empty name. This means that
+you will need to specify numeric bf(FROM) values if you want to map these
+nameless IDs to different values.
+
+For the bf(--usermap) option to have any effect, the bf(-o) (bf(--owner))
+option must be used (or implied), and the receiver will need to be running
+as a super-user (see also the bf(--fake-super) option). For the bf(--groupmap)
+option to have any effect, the bf(-g) (bf(--groups)) option must be used
+(or implied), and the receiver will need to have permissions to set that
+group.
+
+dit(bf(--chown=USER:GROUP)) This option forces all files to be owned by USER
+with group GROUP. This is a simpler interface than using bf(--usermap) and
+bf(--groupmap) directly, but it is implemented using those options internally,
+so you cannot mix them. If either the USER or GROUP is empty, no mapping for
+the omitted user/group will occur. If GROUP is empty, the trailing colon may
+be omitted, but if USER is empty, a leading colon must be supplied.
+
+If you specify "--chown=foo:bar, this is exactly the same as specifying
+"--usermap=*:foo --groupmap=*:bar", only easier.
+
dit(bf(--timeout=TIMEOUT)) This option allows you to set a maximum I/O
timeout in seconds. If no data is transferred for the specified time
then rsync will exit. The default is 0, which means no timeout.
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').
For a list of the possible escape characters, see the "log format" setting
in the rsyncd.conf manpage.
+The default FORMAT used if bf(--log-file) is specified and this option is not
+is '%i %n%L'.
+
dit(bf(--stats)) This tells rsync to print a verbose set of statistics
on the file transfer, allowing you to tell how effective rsync's delta-transfer
algorithm is for your data. This option is equivalent to bf(--info=stats2)
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.
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.
-This makes big numbers output using larger units, with a K, M, or G suffix. If
-this option was specified once, these units are K (1000), M (1000*1000), and
-G (1000*1000*1000); if the option is repeated, the units are powers of 1024
-instead of 1000.
+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
+is represented by a period or a comma); (2) output numbers in units of 1000
+(with a character suffix for larger units -- see below); (3) output numbers in
+units of 1024.
+
+The default is human-readable level 1. Each bf(-h) option increases the level
+by one. You can take the level down to 0 (to output numbers as pure digits) by
+specifying the bf(--no-human-readable) (bf(--no-h)) option.
+
+The unit letters that are appended in levels 2 and 3 are: K (kilo), M (mega),
+G (giga), or T (tera). For example, a 1234567-byte file would output as 1.23M
+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 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
recursively scanning a hierarchy of files using include/exclude/filter
rules.
+Note that the use of transfer rules, such as the bf(--min-size) option, does
+not affect what goes into the file list, and thus does not leave directories
+empty, even if none of the files in a directory match the transfer rule.
+
Because the file-list is actually being pruned, this option also affects
what directories get deleted when a delete is active. However, keep in
mind that excluded files and directories can prevent existing items from
-being deleted (because an exclude hides source files and protects
-destination files).
+being deleted due to an exclude both hiding source files and protecting
+destination files. See the perishable filter-rule option for how to avoid
+this.
You can prevent the pruning of certain empty directories from the file-list
by using a global "protect" filter. For instance, this option would ensure
When the file transfer finishes, rsync replaces the progress line with a
summary line that looks like this:
-verb( 1238099 100% 146.38kB/s 0:00:08 (xfer#5, to-check=169/396))
+verb( 1,238,099 100% 146.38kB/s 0:00:08 (xfr#5, to-chk=169/396))
-In this example, the file was 1238099 bytes long in total, the average rate
+In this example, the file was 1,238,099 bytes long in total, the average rate
of transfer for the whole file was 146.38 kilobytes per second over the 8
seconds that it took to complete, it was the 5th transfer of a regular file
during the current rsync session, and there are 169 more files for the
receiver to check (to see if they are up-to-date or not) remaining out of
the 396 total files in the file-list.
+In an incremental recursion scan, rsync won't know the total number of files
+in the file-list until it reaches the ends of the scan, but since it starts to
+transfer files during the scan, it will display a line with the text "ir-chk"
+(for incremental recursion check) instead of "to-chk" until the point that it
+knows the full size of the list, at which point it will switch to using
+"to-chk". Thus, seeing "ir-chk" lets you know that the total count of files
+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
+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 a single line.
+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.
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)
need to expand a directory's content), or turn on recursion and exclude
the content of subdirectories: bf(-r --exclude='/*/*').
-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(--bwlimit=RATE)) This option allows you to specify the maximum transfer
+rate for the data sent over the socket, specified in units per second. The
+RATE value can be suffixed with a string to indicate a size multiplier, and may
+be a fractional value (e.g. "bf(--bwlimit=1.5m)"). If no suffix is specified,
+the value will be assumed to be in units of 1024 bytes (as if "K" or "KiB" had
+been appended). See the bf(--max-size) option for a description of all the
+available suffixes. A value of zero specifies no limit.
+
+For backward-compatibility reasons, the rate limit will be rounded to the
+nearest KiB unit, so no rate smaller than 1024 bytes per second is possible.
+
+Rsync writes data over the socket in blocks, and this option both limits the
+size of the blocks that rsync writes, and tries to keep the average transfer
+rate at the requested limit. Some "burstiness" may be seen where rsync writes
+out a block of data and then sleeps to bring the average rate into compliance.
+
+Due to the internal buffering of data, the bf(--progress) option may not be an
+accurate reflection on how fast the data is being sent. This is because some
+files can show up as being rapidly sent when the data is quickly buffered,
+while other can show up as very slow when the flushing of the output buffer
+occurs. This may be fixed in a future version.
dit(bf(--write-batch=FILE)) Record a file that can later be applied to
another identical destination with bf(--read-batch). See the "BATCH MODE"
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
will have no effect. The bf(--version) output will tell you if this
is the case.
-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 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.
makes virtual hosting possible in conjunction with the bf(--config) option.
See also the "address" global option in the rsyncd.conf manpage.
-dit(bf(--bwlimit=KBPS)) This option allows you to specify a maximum
-transfer rate in kilobytes per second for the data the daemon sends.
-The client can still specify a smaller bf(--bwlimit) value, but their
-requested value will be rounded down if they try to exceed it. See the
-client version of this option (above) for some extra details.
+dit(bf(--bwlimit=RATE)) This option allows you to specify the maximum transfer
+rate for the data the daemon sends over the socket. The client can still
+specify a smaller bf(--bwlimit) value, but no larger value will be allowed.
+See the 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.
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)
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() a '*' matches any path component, but 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.
+ 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
)
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()
explicitly included or it would be excluded by the "*")
)
+The following modifiers are accepted after a "+" or "-":
+
+itemization(
+ it() A bf(/) specifies that the include/exclude rule should be matched
+ against the absolute pathname of the current item. For example,
+ "-/ /etc/passwd" would exclude the passwd file any time the transfer
+ was sending files from the "/etc" directory, and "-/ subdir/foo"
+ would always exclude "foo" when it is in a dir named "subdir", even
+ if "foo" is at the root of the current transfer.
+ it() A bf(!) specifies that the include/exclude should take effect if
+ the pattern fails to match. For instance, "-! */" would exclude all
+ non-directories.
+ it() A bf(C) is used to indicate that all the global CVS-exclude rules
+ should be inserted as excludes in place of the "-C". No arg should
+ follow.
+ it() An bf(s) is used to indicate that the rule applies to the sending
+ side. When a rule affects the sending side, it prevents files from
+ being transferred. The default is for a rule to affect both sides
+ unless bf(--delete-excluded) was specified, in which case default rules
+ become sender-side only. See also the hide (H) and show (S) rules,
+ which are an alternate way to specify sending-side includes/excludes.
+ it() An bf(r) is used to indicate that the rule applies to the receiving
+ side. When a rule affects the receiving side, it prevents files from
+ being deleted. See the bf(s) modifier for more info. See also the
+ protect (P) and risk (R) rules, which are an alternate way to
+ specify receiver-side includes/excludes.
+ it() A bf(p) indicates that a rule is perishable, meaning that it is
+ ignored in directories that are being deleted. For instance, the bf(-C)
+ 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)
You can merge whole files into your filter rules by specifying either a
"- foo + bar" is parsed as two rules (assuming that prefix-parsing wasn't
also disabled).
it() You may also specify any of the modifiers for the "+" or "-" rules
- (below) in order to have the rules that are read in from the file
- default to having that modifier set. For instance, "merge,-/ .excl" would
+ (above) in order to have the rules that are read in from the file
+ default to having that modifier set (except for the bf(!) modifier, which
+ would not be useful). For instance, "merge,-/ .excl" would
treat the contents of .excl as absolute-path excludes,
while "dir-merge,s .filt" and ":sC" would each make all their
- per-directory rules apply only on the sending side.
-)
-
-The following modifiers are accepted after a "+" or "-":
-
-itemization(
- it() A bf(/) specifies that the include/exclude rule should be matched
- against the absolute pathname of the current item. For example,
- "-/ /etc/passwd" would exclude the passwd file any time the transfer
- was sending files from the "/etc" directory, and "-/ subdir/foo"
- would always exclude "foo" when it is in a dir named "subdir", even
- if "foo" is at the root of the current transfer.
- it() A bf(!) specifies that the include/exclude should take effect if
- the pattern fails to match. For instance, "-! */" would exclude all
- non-directories.
- it() A bf(C) is used to indicate that all the global CVS-exclude rules
- should be inserted as excludes in place of the "-C". No arg should
- follow.
- it() An bf(s) is used to indicate that the rule applies to the sending
- side. When a rule affects the sending side, it prevents files from
- being transferred. The default is for a rule to affect both sides
- unless bf(--delete-excluded) was specified, in which case default rules
- become sender-side only. See also the hide (H) and show (S) rules,
- which are an alternate way to specify sending-side includes/excludes.
- it() An bf(r) is used to indicate that the rule applies to the receiving
- side. When a rule affects the receiving side, it prevents files from
- being deleted. See the bf(s) modifier for more info. See also the
- protect (P) and risk (R) rules, which are an alternate way to
- specify receiver-side includes/excludes.
- it() A bf(p) indicates that a rule is perishable, meaning that it is
- ignored in directories that are being deleted. For instance, the bf(-C)
- 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.
+ per-directory rules apply only on the sending side. If the merge rule
+ specifies sides to affect (via the bf(s) or bf(r) modifier or both),
+ then the rules in the file must not specify sides (via a modifier or
+ a rule prefix such as bf(hide)).
)
Per-directory rules are inherited in all subdirectories of the directory
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 (or 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.
+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 your convenience, a script file is also created when the write-batch
+option is used: it will be named the same as the batch file with ".sh"
+appended. This script file contains a command-line suitable for updating a
+destination tree using the associated batch file. It can be executed using
+a Bourne (or Bourne-like) shell, optionally passing in an alternate
+destination tree pathname which is then used instead of the original
+destination path. This is useful when the destination tree path on the
+current host differs from the one used to create the batch file.
+
Examples:
quote(
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
+Rsync can also distinguish "safe" and "unsafe" symbolic links. An
+example where this might be used is a web site mirror that wishes to
+ensure that the rsync module that is copied 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
manpagesection(EXIT VALUES)
-startdit()
+description(
dit(bf(0)) Success
dit(bf(1)) Syntax or usage error
dit(bf(2)) Protocol incompatibility
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.
dit(bf(RSYNC_ICONV)) Specify a default bf(--iconv) setting using this
-environment variable.
+environment variable. (First supported in 3.0.0.)
+dit(bf(RSYNC_PROTECT_ARGS)) Specify a non-zero numeric value if you want the
+bf(--protect-args) option to be enabled by default, or a zero value to make
+sure that it is disabled by default. (First supported in 3.1.0.)
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 bf(-e) option.
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()
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)
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
manpagesection(THANKS)
-Especial thanks go out to: John Van Essen, Matt McCutchen, Wesley W. Terpstra,
+Special thanks go out to: John Van Essen, Matt McCutchen, Wesley W. Terpstra,
David Dykstra, Jos Backus, Sebastian Krahmer, Martin Pool, and our
gone-but-not-forgotten compadre, J.W. Schultz.