gets appended using the
--backup‐dir and --suffix options.
If you don’t specify --backup‐dir:
1. the --omit‐dir‐times option will be forced on
2. the use of --delete (without --delete‐excluded), causes
rsync to add a "protect" filter‐rule for the backup suffix
to the end of all your existing filters that looks like
this: -f "P *~". This rule prevents 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 your rules specify a trailing inclusion/exclu‐
sion of *, the auto‐added rule would never be reached).
--backup‐dir=DIR
This implies the --backup option, and tells rsync to store all
backups in the specified directory on the receiving side. This
can be used for incremental backups. You can additionally spec‐
ify a backup suffix using the --suffix option (otherwise the
files backed up in the specified directory will keep their origi‐
nal 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.
--suffix=SUFFIX
This option allows you to override the default backup suffix used
with the --backup (-b) option. The default suffix is a ~ if no
--backup‐dir was specified, otherwise it is an empty string.
--update, -u
This forces rsync to skip any files which exist on the destina‐
tion and have a modified time that is newer than the source file.
(If an existing destination file has a modification time equal to
the source file’s, it will be updated if the sizes are differ‐
ent.)
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 time‐
stamps.
This option is a TRANSFER RULE, so don’t expect any exclude side
effects.
A caution for those that choose to combine --inplace with --up‐
date: an interrupted transfer will leave behind a partial file on
the receiving side that has a very recent modified time, so re‐
running the transfer will probably not continue the interrupted
file. As such, it is usually best to avoid combining this with
--inplace unless you have implemented manual steps to handle any
interrupted in‐progress files.
--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 com‐
plete, rsync instead writes the updated data directly to the des‐
tination file.
This has several