With this option, preexisting destination files are renamed as each file is transferred or deleted.
You can control where the backup file goes and what (if any) suffix gets appended using the
--backup-dir and --suffix options.
Note that if you don’t specify --backup-dir, (1) the --omit-dir-times option will be implied, and (2)
if --delete is also in effect (without --delete-excluded), rsync will add a "protect" filter-rule for
the backup suffix to the end of all your existing excludes (e.g. -f "P *~"). This will prevent previ‐
ously 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/exclusion
of ’*’, the auto-added rule would never be reached).
In combination with the --backup option, this tells rsync to store all backups in the specified direc‐
tory on the receiving side. This can be used for incremental backups. You can additionally specify a
backup suffix using the --suffix option (otherwise the files backed up in the specified directory will
keep their original filenames).
Note that if you specify a relative path, the backup directory will be relative to the destination
directory, so you probably want to specify either an absolute path or a path that starts with "../".
If an rsync daemon is the receiver, the backup dir cannot go outside the module’s path hierarchy, so
take extra care not to delete it or copy into it.
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.