| Turn off implied options by prefixing it with |
--no-devices, --no-perms have different defaults in various circumstances
--no-whole-file, --no-blocking-io, --no-dirs).
--archive and omitt
The order of the options is important:
--recursive would end up being turned on, the opposite of
The side-effects of the
--files-from option are NOT positional, as it affects the default state of
several options and slightly changes the meaning of
| Implied if there is a single source arg and no destination |
(1) a copy command that includes a destination will be forced to only list or
(2) to specify more than one source arg (note: be sure to include the destination).
(3) a source with a wild-card is expanded by the shell into multiple args,
rsync --archive --verbose --list-only *.sh
| perform a trial run that doesn't make any changes (produces similar report as a real run).
| synonym for |
-recursive --links --perms --times --group --owner --devices --specials
( ACL and eXtended attributes may not be preserved(?) ed)
--files-from is specified
--recursive is not implied.
Does not include preserving hardlinks,
--compress it will reenable the "
| Options that effect how files are determined to be the same and don't need to be transfered.|
Default: skip files with the same size and modification timestamp.
| Useful when a system which does not preserve timestamps well.
| If the destination has a newer modified time it is skipped. |
If a destination file has a modification time equal to the source file's,
If the sizes are different it will be updated.
A difference of type always requires an update, for example: if the source is a directory and the destination is a file, the transfer always occurs.
Does not affect the copying of symlinks or other special files.
| timestamps considered equal if they differ by no more than the |
Default 0 (exact match).
MS Windows FAT filesystem represents times with a 2-second resolution
--modify-window=1 allows times to differ by up to 1 second.
| compare a MD5 128-bit checksums for files that have matching sizes.|
Sever degradation of performance affecting both sides of the transfer with a lot of disk I/O reading all the
data in the files in the transfer prior to and in addition to
reading/writing that will be done to if the file needs to be transfered.
The sending side generates checksums while doing the file-system scan that builds the list of the available files.
The receiver generates checksums when scanning for changed files, and will checksum any file that has the same size
as the corresponding sender's file: files with either a changed size or a changed checksum are selected for transfer.
This is unrelated to the verification that each file was correctly reconstructed on the receiving side by checking a
whole-file checksum that is generated as the file is transferred,
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.
| update files by appending data onto the
end of the file, which presumes that the data that already
exists on the receiving side is identical with the start of the file on the sending side. |
If a file needs to be transferred and its size on the receiver is the same or longer than the size on the sender, the file is skipped.
This does not interfere with updating 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.
--inplace, does not conflict with
--sparse (since it is always extending a file's length).
--append 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
--inplace transfer for the resend).
Increases the amount of information displayed during the transfer. |
By default, rsync works silently.
-verbose gives information about what files are being transferred and a brief summary at the end.
-verbose -verbose adds information on what files are being skipped .
Following only seen with
master.html is over max-size
[sender] hiding file email/Trash because of pattern Trash*.
Filenames are displayed in
%n%L by default,
the name of the file, and if the item is a link, where it points.
At the first level of verbosity no mention if a file gets its attributes changed is included.
--itemize-changes or add
%i to the
the output (on the client) increases to mention all items that are changed in any way.
More than two are used for debugging
| decreases the amount of information reported. |
Useful when invoking from cron.
--itemize-changes to see what a command is going to do.
| options affecting report
Default format |
Repeating the option causes unchanged files to be output,.
When deleting files,
| . ||item is not being updated (attributes may be modified).
| || |
| file is being sent.
| || |
|file is being received
| || |
| change/creation is occurring for
the item |
(such as the creation of a directory or the changing of a symlink, etc.).
| || |
| hard link to another item (requires |
| || |
|itemized-output area contains a message (example: "deleting").
|special file (examples: named sockets and fifos). |
|The other letters in the the associated attribute being updated
| no change.
| new item |
|space|| identical item
| reasons for transfer
| regular file has a different checksum (requires |
symlink, device, or special file has a changed value.
|size of a regular file
|time of last modification (requires |
|time of last modification will be set to the transfer time |
if a file/symlink/device is updated without
a symlink is changed and the receiver can't set its time.
|permissions are different (requires |
|owner is different (requires |
--owner and super-user privileges).
|group is different (requires |
--group and the authority to set the group).
|ACL (Access Control List) information changed.
|extended attribute information changed.
%i" will output the string "*deleting" if approiate.
| string of field specifiers. |
%n%L (name and, if the item is a link, where it points).
See "log format" in
Each file, dir, etc. that gets updated in a significant way (a transferred file,
a recreated symlink/device, or a touched directory) will be output.
--itemize-changes the logging of names includes any item changed.
The out-format string is output prior to a file's transfer.
If a transfer-statistic option is requested, logging is done at the end of the file's transfer.
When this late logging is in effect and
specified, the name of the file being transferred is output prior to its progress information followed by the out-format output.
For a non-daemon transfer. |
If specified as a client option, transfer logging will be enabled with a default format of
Example: Remote side logs what is happening:
rsync --archive --verbose --rsync-path="rsync --log-file=/tmp/rlog" src/ dest/
Useful to diagnose why a connection is closing unexpectedly.
With an empty string, updated files will not be mentioned in the log file. |
enables "transfer logging" unless the string is empty, in which case transfer logging is turned off.
See log format in
%i %n%L i.e. name link.
| K, M, or G. units are K (1000), M (1000*1000), and G (1000*1000*1000); |
-h -h , units are powers of 1024 .
| output statistics
Number of files: 88417
Number of files transferred: 0
Total file size: 5008416760 bytes
Total transferred file size: 0 bytes
Literal data: 0 bytes
Matched data: 0 bytes
File list size: 2710302
File list generation time: 1.156 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 20
Total bytes received: 2710322
sent 20 bytes received 2710322 bytes 285299.16 bytes/sec
total size is 5008416760 speedup is 1847.89
| Implies |
While transferring a regular file, updates a progress line like :
782448 63% 110.64kB/s 0:00:04
The transfer might finish in :04 seconds
Statistics can be misleading with the delta-transfer algorithm.
For example, if the file is a log previously sent the reported rate will drop dramatically when the receiver gets to the
new data, and the transfer will take much longer to finish than predicted.
When a file transfer finishes, the progress line is replaced with a summary line like :
1238099 100% 146.38kB/s 0:00:08 (xfer#5, to-check=169/396)
This was the 5th regular file transfered, 169 more files for the receiver to check out of the 396 files
--delete-before, --delete-after, --prune-empty-dirs, and
The default with
--del --delete-during to request this deletion mode explicitly).
--delete-delay is a better choice than using
Incremental recursion can be disabled using
| Use relative paths. |
The full path names specified on the command line are sent to the server rather than just the last parts of the filenames.
Useful when sending several different directories at the same time. For example:
rsync -av /foo/bar/baz.c remote:/tmp/
rsync -avR /foo/bar/baz.c remote:/tmp/
/tmp/foo/bar/baz.c preserving its full path.
These extra path elements are called "implied directories" (i.e. the "foo" and the "foo/bar" directories in the above example).
rsync sends these implied directories as real directories in the file list, even if a path
element is really a symlink on the sending side. This prevents
unexpected behaviors when copying the full path of a file that you didn't realize had a symlink in its path.
To duplicate a server-side symlink, include both the symlink via its path, and referent directory via its real path.
To limit the amount of path information that is sent as implied directories for each path,
insert a dot and a slash into the source path.
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
| affects the default behavior of |
The attributes of the implied directories from the source names are not included in the transfer.
This means that the corresponding path elements on the destination system are left unchanged if they exist, and any
missing implied directories are created with default attributes.
This allows these implied path elements to have big differences, such as being a symlink to a directory on the receiving side.
For instance, if a command-line arg or a files-from entry told rsync to transfer the file "path/foo/file", the directories
"path" and "path/foo" are implied when
--relative is used. If "path/foo" is a symlink to "bar" on the destination system, the
receiving rsync would ordinarily delete "path/foo", recreate it as a directory, and receive the file into the new directory.
--no-implied-dirs, the receiving rsync updates "path/foo/file" using the existing path elements, which means
that the file ends up being created in "path/bar".
Another way to accomplish this link preservation is to use the
--keep-dirlinks option (which will also affect symlinks to directories in the rest of the transfer).
| Preexisting destination files are renamed as
each file is transferred or deleted. Controls where the backup file goes and what (if any) suffix gets appended. Use
--suffix (watch free space on destination).
Prevents previously backed-up files from being deleted. If you
are supplying filter rules, insert own exclude/protect rule higher up in the
list so that it has a high enough priority to be effective (e.g., if your rules specify a trailing inclusion/exclusion of
'*', the auto-added rule would never be reached).
--omit-dir-times will be implied, and
--delete is also in effect (without
--delete-excluded), rsync will add a
"protect" filter-rule for the backup suffix to the end of all existing excludes (e.g.
-f "P *~").
| In combination with |
--backup , to
store all backups in the specified directory on the receiving
side. This can be used for incremental backups.
| override the default backup suffix
used with |
Default suffix is
~ if no
--backup-dir was specified, otherwise it is an empty string.
| When a files data needs to be updated: |
Writes the updated data directly to the destination file instead of the Normal creating a copy of the file and moved into place when it is complete.
- 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),
- file data will inconsistent during the transfer,
- file data may be left in an inconsistent state after the transfer if the transfer is interrupted or fails,
- a file that does not have write permissions can not be updated, and
- 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
--backup, since rsync will use the backup file as the basis file for the transfer to prevent this.
WARNING: Do not use this to update files being accessed by others.
Useful for transferring large files with block-based changes or appended data, and also on systems that are disk bound, not network bound.
--partial (since an interrupted transfer does not delete the file),
equivalent to |
--partial --progress. Make it much easier to specify these two options for a long transfer that may be interrupted.
Tell the sending side to include any directories that are encountered. Unlike |
--recursive, a directory's contents are not
copied unless the directory name specified is "." or ends with a trailing slash (e.g. ".", "dir/.", "dir/", etc.). Without this
--recursive , rsync will skip all directories it encounters (and output a message to that effect for each
--recursive takes precedence.
--dirs is implied by
--list-only (including an implied
--list-only usage) if
wasn't specified (so that directories are seen in the listing).
--no-dirs to turn this off.
Link handling skip to attribute handling
| recreate symlinks on the destination.
| for symlinks, the item that they point to (the referent) is copied.
| copy the referent of symlinks that point outside the copied tree. |
Absolute symlinks are treated like ordinary files, and as are symlinks in the source path itself when
--relative is used.
Has no additional effect if
--copy-links was also specified.
| ignore any symbolic links which point outside the copied tree and absolute symlinks |
--relative may give unexpected results.
| sending side treats a symlink to a
directory as though it were a real directory. |
Useful if you don't want symlinks to non-directories to be affected, as they would be using
Without this , if the sending side has replaced a directory with a symlink to a directory, the receiving side will
delete anything that is in the way of the new symlink, including a directory hierarchy (as long as
--delete is in effect).
--keep-dirlinks for an analogous option for the receiving side.
| receiving side treats a symlink to a
directory as though it were a real directory, only if it matches a real directory from the sender. |
Without this the receiver's symlink would be deleted and replaced with a real directory.
For example, transfer a directory "foo" that contains a file "file", but "foo" is a symlink to directory "bar" on the receiver.
--keep-dirlinks, the receiver deletes symlink "foo", recreates it as a directory, and receives the file into the new directory.
--keep-dirlinks, the receiver keeps the symlink and "file" ends up in "bar".
caution: when using
--keep-dirlinks, you must trust all the symlinks in the copy!
If it is possible for an untrusted user to create their own symlink to any directory, the user could then (on a subsequent copy)
replace the symlink with a real directory and affect the content of whatever directory the symlink references.
For backup copies, use a bind mount instead of a symlink to modify your receiving hierarchy.
See also --copy-dirlinks for an analogous option for the sending side.
| hard-linked files in the transfer are linked to the corresponding files on the receiving side.|
Without this option, hard-linked files in the transfer are treated as though they were separate files.
When updating a non-empty destination, ensures that files that are hard-linked together on the source
are hard-linked together on the destination.
Does NOT break existing hard links on the destination that do not exist between the source files.
If one or more extra-linked files have content changes, they will become unlinked when updated (if not using
Rsync can only detect hard links between files that are in the transfer set. If rsync updates a file that has
extra hard-link connections to files outside the transfer, that linkage will be broken.
--inplace to avoid this breakage, there may be
unintended changes due to lingering hard links (see
If incremental recursion is active 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,
To avoid this disable incremental recursion with
Attributes, Meta-data, i.e. file permissions, Access Control Lists, owner, group …
| set the destination permissions to be the same as the source permissions. |
--chmod to modify what are considered to be the source permissions.
With Existing files retain permissions, (
--executability might change the execute permission.)
New files Have access permissions set to the source permissions masked with the receiving
directory's default permissions (either the receiving process's
the permissions specified via the destination directory's default AccessControlList.
mod bits are disabled except where a new directory inherits
setgid from its parent.
To give new files the destination-default permissions (while leaving existing files
rsync alias --compress --no--perms --no--group --chmod=ugo=rwX
then use : rsync -avZ src/ dest/
| apply comma-separated |
chmod strings to the permission of the files in the transfer.
as if they were the permissions supplied by the sender.
Can seem to have no effect on existing files if
--perms is not enabled.
An item that should only apply to a directory is prefixed with
D', or to a file if prefixed with '
--chmods are permitted.
--executability for how the resulting permission value can be applied to the files in the transfer.
| preserve the executability (or nonexecutability) of regular files when |
--perms is not enabled.
A regular file is considered to be executable if at least one 'x' is turned on in its permissions. When an existing destination
file's executability differs from that of the corresponding source file, rsync modifies the destination file's permissions as follows:
To make a file non-executable, rsync turns off all its 'x' permissions.
To make a file executable, rsync turns on each 'x' permission that has a corresponding 'r' permission enabled.
| update the ACLs, implies |
--fake-super to backup and restore ACLs that are not compatible.
| update the remote extended attributes.|
When done by super-user, copies all namespaces except system.*.
A normal user only copies the user.* namespace.
To to backup and restore non-user namespaces as a normal user, see
| preserve owner (other than receiving user)|
Default: the owner is set to the user on the receiving side.
only if the receiver is super-user (see
Caution: The preservation of ownership will associate matching names but if it falls back to using the ID number (see
--numeric-ids it will surely be incorrect!!.
|preserve group |
If the receiving program is not running as the super-user (or if --no-super was specified).
Only groups that the invoking user on the receiving side is a member of will be preserved.
Without this option, the group is set to the default group of the invoking user on the receiving side.
The preservation of group information will associate matching
names by default, but may fall back to using the ID number
| preserve modification times (implied with |
If times are not preserved (in addition to corrupting the modification time on the destination) the next time a transfer is performed,
the evaluation which excludes files that have not been modified will be incorrect. The deltatransfer algorithm will minimize the update.
| omit directories when preserving modification times (see |
Suggested if NFS is sharing the directories on the receiving side.
| receiving side attempts to execute super-user activities even if it wasn't run by the super-user. |
Include: preserving users via the
preserving all groups (not just the current user's groups) via
--groups , and
copying devices via
Useful for systems that allow such activities without being the super-user and
ensuring errors if the receiving side isn't being run as the super-user.
To turn off super-user activities, the super-user can use
| simulate super-user activities by saving/restoring the privileged attributes via special extended attributes.|
Includes the file's owner and group (if it is not the default), the file's device info (device & special files are
created as empty text files), and any permission bits that won't be allowed to be set on the real file (e.g. the real file gets
u-s,g-s,o-t for safety) or that would limit the owner's access
(since the real super-user can always access/change a file, the
files we create can always be accessed/changed by the creating user).
Handles ACLs (if
--acls was specified) and non-user extended attributes (if
--xattrs was specified).
backup data without using a super-user, and to store ACLs from incompatible systems.
Only affects the side where the option is used. To affect the remote side of a remote-shell connection, specify an rsync path:
rsync -av --rsync-path="rsync --fake-super" /src/ host:/dest/
Since there is only one "side" in a local copy, this option affects both the sending and receiving of files.
specify a copy using "localhost" to avoid this, possibly using the "lsh" shell script (from the support directory)
as a substitute for an actual remote shell (see --rsh).
overridden by both
See "fake super" in
| sparse files efficiently so they take up less space on the destination. |
--inplace as it is not possible to overwrite data in a sparse fashion.
NOTE: Don't use if destination is Solaris
tmpfs . There are problems seeking over null regions, and corrupts the files.
| delta-transfer algorithm is not used.|
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 (example: when the "disk" is actually a networked filesystem).
Default when source and destination are local paths, if no batch writing option is in effect.
| avoid crossing a filesystem boundary when recursing. |
This does not limit the ability to specify items to copy from multiple filesystems, just rsync's recursion
through the hierarchy of each directory that the user specified,
and also the analogous recursion on the receiving side during deletion.
A "bind" mount to the same device is considered being on the same filesystem.
If repeated, rsync omits all mount-point directories.
Otherwise, it includes an empty directory at each mount-point it encounters (using the attributes of the
mounted directory because those of the underlying mount-point directory are inaccessible).
If collapse symlinks (via
--copy-unsafe-links), a symlink to a directory on another device
is treated like a mount-point. Symlinks to non-directories are unaffected by this option.
| skip creating files and directories
that do not exist on the destination. |
If combined with the
--ignore-existing , no files will be updated (useful to delete extraneous files).
This is a transfer rule, not an exclude, 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.
| skip updating files that already exist on
the destination (this does NOT ignore existing directories, or nothing would get done). See also --existing.
This is a transfer rule, not an exclude, so it doesn't affect the data that goes into the file-lists, and doesn't affect deletions. |
It limits the files that the receiver requests to be transferred.
Useful for doing backups using
--link-dest when continung a n interrupted backup.
Since a --link-dest run is copied into a new directory hierarchy (when it is used properly),
using --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.
| Removing Files
| Attempts to delete more than |
N files or directories
results in a warning and exit with an error code 25 .
--max-delete=0 generates warning about files in the destination without removing them.
| Removing Files from the receiving side
| files > that aren't on the sending side for directories being synchronized. |
It is expected that rsync previously sent the whole directory ( using
using a wildcard for the directory's contents (e.g.
(A wildcard is expanded by the shell and rsync gets a list of files, not the files' parent directory. )
Files excluded from the transfer are also excluded from being deleted unless
or mark the rules as only matching on the sending side
See include/exclude modifiers .
Deletions will also occur when
--dirs is enabled for directories whose contents are being copied.
--dry-run option to see what files are going to be deleted.
If the sending side detects I/O errors, deletion of any files will be disabled,
Especially useful with NFS errors on the sending side)
May be combined with one of the
--delete-WHEN options as well as
| all deletions are done before any transfer starts. |
Helpful when the destination filesystem is low on space.
Introduces a delay before the start of the transfer which might cause the transfer to timeout
Forces non-incremental recursion algorithm that requires rsync to scan all the files in the transfer into
memory at once (see
| File deletions are done as the transfer occurs.|
The per-directory delete scan is done before each directory is checked for updates,
| File deletions are done after the transfer completes. |
Useful when combined with
--fuzzy, and is more efficient
--delete-after (can behave differently, since
--delete-after computes the deletions in a separate pass after all updates are done).
If the number of removed files is very large a temporary file is created with the list. If it cannot be created rsync will use
--recursive is doing an incremental scan).
| file deletions are done after the transfer has completed. |
Useful when sending new per-directory merge files as a part of the transfer and
you want their exclusions to take effect for the delete phase of the current transfer.
Forces rsync to use non-incremental recursion algorithm that requires rsync to scan all the file names in the transfer into memory at once.
In addition to deleting the files not present on the sending side, |
delete files on the receiving side that are excluded (see --exclude).
See the FILTER RULES section for a way to make individual exclusions behave this way on the receiver, and for a way to protect
| Delete a directory when it is to be replaced by a file, `even if the directory contains files.
Only relevant if deletions are not active (see --delete for details).
--delete deletes files even when there are I/O errors.Danger
remove from the sending side files successfully duplicated . (non-directories)
| options to restrict activities
| Supress transferring files larger than |
may be a fractional (e.g.
A transfer rule limits the files that the receiver requests to be transferred
not an exclude, doesn't affect the file-lists or deletions.
Suffixes (case insensitive)
- KB (1,000) : K KiB kilibyte (1024):
- MB ( 1,000,000) :M MiB megibyte (1024*1024)
- GB (1,000 MB) :G GiB gibibyte (1024*1024*1024)
-1 to offset by one byte.
--max-size=1.5mb-1 is 1,499,999 bytes, and
--max-size=2g+1 is 2,147,483,649 bytes.
| avoid transferring any file that is smaller
mb, which can help in not transferring
small, junk files. See the --max-size option for a description of SIZE and other information.
| forces the block size in delta-transfer algorithm to a fixed value.|
Selected based on the size of each file being updated. See technical report.
| Remote shell for communication. default: |
prefer to use rsh on a local network.
[user@]host::module/path, the remote shell will be used to run an rsync daemon on the
remote host, and all data will be transmitted through that
remote shell connection, not a socket
connection to a running rsync daemon on the remote host.
See using rsync-daemon features via a remote-shell connection
Command-line arguments are permitted in
rmsh provided that
is presented to rsync as a single argument.
Use spaces (not tabs or other whitespace) to separate
rmsh into the command and arguments.
Use apostrophe and/or quotes to preserve spaces in an argument (not backslashes).
Doubling an apostrophe inside a apostrophe'd string results in apostrophe ( likewise for quotes )
(attention to which quotes the shell is parsing and which quotes rsync is parsing).
-e 'ssh -p 2234'
-e 'ssh -o "ProxyCommand nohup ssh firewall nc -w1 %h %p"'
.ssh/config for site specific options.
RSYNC_RSH environment variable specifies remote shell program,
which accepts the same range of values as
See --blocking-io which is affected by this option.
|character and block device files are created on remote system.|
receiving rsync must be super-user (see also the --super and --fake-super options).
| transfer special files such as named sockets and fifos.
| equivalent to |
| When rsync is not in the remote path |
fullName is run with a shell and can be any program, script, or
command sequence , so long as it does not corrupt the standard-in &
standard-out that rsync is using to communicate.
To set a different default directory on the remote for use with
rsync -avR --rsync-path="cd /a/b && rsync" host:c/d /e/
| options controling files to be transfered
| copy directories recursively. See --dirs .
| add rules to selectively include/exclude files. Useful in combination with a recursive transfer. |
--filter options are permitted.
rule contains whitespace, quote it.
An underscore can be used to replace the space that separates a rule from its arg. See FILTER RULES
.rsync-filter files sprinkled through the hierarchy
and use their rules to filter the files.
Filters out the
.rsync-filter files themselves .
file contains exclude patterns (one per line).
Blank lines and lines starting with
# are ignored.
-, the list will be read from standard input.
Exclude files that shouldn't be transfered, similar to CVS|
These are marked perishable see filter rules
- The exclude list is initialized with :
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/
- Files in the
CVSIGNORE environment variable (delimited by whitespace).
- Files listed in
- Files in a directory containing a
- Files matching a pattern in
These patterns are split on whitespace. See CVS
--filter rules with
CVS excludes are appended regardless of where the -C was placed on the commandline.
This makes them a lower priority than any rules specified explicitly.
To control where these get inserted into filter rules,
-C as a command-line option and use a combination of
--filter=-C (either on the command-line or by
putting the ":C" and "-C" rules into a filter file with other rules).
:C turns on the per-directory scanning for the
-C does a one-time import of the CVS excludes.
| as with |
Specify the exact list of files (as read from |
- for standard input).
Adjusts the default behavior to make transferring the files and directories easier:
--relative is implied, presering path information
--dirs is implied, creating directories
--archive does not imply
--recursive so specify it.
These side-effects change the default state of
The position of
--files-from on the command line has no bearing on how other options are parsed (i.e.
--archive works the same before or after
--files-from, as does
The filenames that are read from
file are all relative to the source dir --
any leading slashes are removed and no "
.." references are allowed to go higher than the source dir. For example,
rsync -a --files-from=rsyncfiles /usr remote:/backup
rsyncfiles contains the string "
bin" (or even "
/usr/bin directory will be created as
/backup/bin on the destination.
If it contains "
bin/" (note the trailing slash), the immediate contents of the directory would also be sent (without needing to be explicitly mentioned in the file
In both cases, if
--recursive was enabled,
that dir's entire hierarchy would also be transferred (keep in mind that
--recursive needs to be specified explicitly with
since it is not implied by
Note that the effect of (enabled by default)
--relative is to duplicate only the path info that is read from the file -- it does not force the duplication of the source-spec path (
/usr in this case).
In addition, the --files-from file can be read from the remote host instead of the local host if you specify a "host:" in front
of the file (the host must match one end of the transfer). As a short-cut, you can specify just a prefix of ":" to mean "use the
remote end of the transfer". For example:
rsync -a --files-from=:/path/file-list src:/ /tmp/copy
Copy all the files specified in the /path/file-list file that was located on the remote "src" host.
--protect-args are specified and the
--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.
| rules/filenames are terminated by a null ('00') , |
--exclude-from, --include-from, --files-from, and any merged files specified in a
--filter rule. Does not affect
| sends filenames and most options
without allowing the 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 by rsync (not the shell).
if used with