Document the new auto-added protect filter-rule when using --backup
[rsync/rsync.git] / rsync.yo
index 6fe98a0..8e2e4b7 100644 (file)
--- a/rsync.yo
+++ b/rsync.yo
@@ -552,8 +552,17 @@ dit(bf(-b, --backup)) 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
 bf(--backup-dir) and bf(--suffix) options.
-Note that if you don't specify bf(--backup-dir), the bf(--omit-dir-times)
-option will be enabled.
+
+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
+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. -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
+your rules specify a trailing inclusion/exclusion of '*', the auto-added
+rule would never be reached).
 
 dit(bf(--backup-dir=DIR)) In combination with the bf(--backup) option, this
 tells rsync to store all backups in the specified directory. This is
@@ -853,9 +862,18 @@ running rsync daemon on the remote host.  See the section "USING
 RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION" above.
 
 Command-line arguments are permitted in COMMAND provided that COMMAND is
-presented to rsync as a single argument.  For example:
+presented to rsync as a single argument.  You must use spaces (not tabs
+or other whitespace) to separate the command and args from each other,
+and you can use single- and/or double-quotes to preserve spaces in an
+argument (but not backslashes).  Note that doubling a single-quote
+inside a single-quoted string gives you a single-quote; likewise for
+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"))
+quote(
+tt(    -e 'ssh -p 2234')nl()
+tt(    -e 'ssh -o "ProxyCommand nohup ssh firewall nc -w1 %h %p"')nl()
+)
 
 (Note that ssh users can alternately customize site-specific connect
 options in their .ssh/config file.)
@@ -1267,10 +1285,10 @@ will prevent partial-dir files from being transferred and also prevent the
 untimely deletion of partial-dir items on the receiving side.  An example:
 the above bf(--partial-dir) option would add an "bf(--exclude=.rsync-partial/)"
 rule at the end of any other filter rules.  Note that if you are
-supplying your own filter rules, you may need to manually insert a
-rule for this directory exclusion somewhere higher up in the list so that
+supplying your own exclude 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 bf(--exclude='*') rule, the auto-added rule would never be
+a trailing inclusion/exclusion of '*', the auto-added rule would never be
 reached).
 
 IMPORTANT: the bf(--partial-dir) should not be writable by other users or it