+dit(bf(--partial-dir=DIR)) A better way to keep partial files than the
+bf(--partial) option is to specify a em(DIR) that will be used to hold the
+partial data (instead of writing it out to the destination file).
+On the next transfer, rsync will use a file found in this
+dir as data to speed up the resumption of the transfer and then delete it
+after it has served its purpose.
+
+Note that if bf(--whole-file) is specified (or implied), any partial-dir
+file that is found for a file that is being updated will simply be removed
+(since
+rsync is sending files without using the incremental rsync algorithm).
+
+Rsync will create the em(DIR) if it is missing (just the last dir -- not
+the whole path). This makes it easy to use a relative path (such as
+"bf(--partial-dir=.rsync-partial)") to have rsync create the
+partial-directory in the destination file's directory when needed, and then
+remove it again when the partial file is deleted.
+
+If the partial-dir value is not an absolute path, rsync will add an exclude
+rule at the end of all your existing excludes. This will prevent the
+sending of any partial-dir files that may exist on the sending side, and
+will also prevent the untimely deletion of partial-dir items on the
+receiving side. An example: the above bf(--partial-dir) option would add
+the equivalent of "bf(-f '-p .rsync-partial/')" at the end of any other
+filter rules.
+
+If you are supplying your own exclude rules, you may need to add your own
+exclude/hide/protect rule for the partial-dir because (1) the auto-added
+rule may be ineffective at the end of your other rules, or (2) you may wish
+to override rsync's exclude choice. For instance, if you want to make
+rsync clean-up any left-over partial-dirs that may be lying around, you
+should specify bf(--delete-after) and add a "risk" filter rule, e.g.
+bf(-f 'R .rsync-partial/'). (Avoid using bf(--delete-before) or
+bf(--delete-during) unless you don't need rsync to use any of the
+left-over partial-dir data during the current run.)
+
+IMPORTANT: the bf(--partial-dir) should not be writable by other users or it
+is a security risk. E.g. AVOID "/tmp".
+
+You can also set the partial-dir value the RSYNC_PARTIAL_DIR environment
+variable. Setting this in the environment does not force bf(--partial) to be
+enabled, but rather it affects where partial files go when bf(--partial) is
+specified. For instance, instead of using bf(--partial-dir=.rsync-tmp)
+along with bf(--progress), you could set RSYNC_PARTIAL_DIR=.rsync-tmp in your
+environment and then just use the bf(-P) option to turn on the use of the
+.rsync-tmp dir for partial transfers. The only times that the bf(--partial)
+option does not look for this environment value are (1) when bf(--inplace) was
+specified (since bf(--inplace) conflicts with bf(--partial-dir)), and (2) when
+bf(--delay-updates) was specified (see below).
+
+For the purposes of the daemon-config's "refuse options" setting,
+bf(--partial-dir) does em(not) imply bf(--partial). This is so that a
+refusal of the bf(--partial) option can be used to disallow the overwriting
+of destination files with a partial transfer, while still allowing the
+safer idiom provided by bf(--partial-dir).
+
+dit(bf(--delay-updates)) This option puts the temporary file from each
+updated file into a holding directory until the end of the
+transfer, at which time all the files are renamed into place in rapid
+succession. This attempts to make the updating of the files a little more
+atomic. By default the files are placed into a directory named ".~tmp~" in
+each file's destination directory, but if you've specified the
+bf(--partial-dir) option, that directory will be used instead. See the
+comments in the bf(--partial-dir) section for a discussion of how this
+".~tmp~" dir will be excluded from the transfer, and what you can do if
+you want rsync to cleanup old ".~tmp~" dirs that might be lying around.
+Conflicts with bf(--inplace) and bf(--append).
+
+This option uses more memory on the receiving side (one bit per file
+transferred) and also requires enough free disk space on the receiving
+side to hold an additional copy of all the updated files. Note also that
+you should not use an absolute path to bf(--partial-dir) unless (1)
+there is no
+chance of any of the files in the transfer having the same name (since all
+the updated files will be put into a single directory if the path is
+absolute)
+and (2) there are no mount points in the hierarchy (since the
+delayed updates will fail if they can't be renamed into place).
+
+See also the "atomic-rsync" perl script in the "support" subdir for an
+update algorithm that is even more atomic (it uses bf(--link-dest) and a
+parallel hierarchy of files).
+
+dit(bf(-m, --prune-empty-dirs)) This option tells the receiving rsync to get
+rid of empty directories from the file-list, including nested directories
+that have no non-directory children. This is useful for avoiding the
+creation of a bunch of useless directories when the sending rsync is
+recursively scanning a hierarchy of files using include/exclude/filter
+rules.
+
+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).
+
+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
+that the directory "emptydir" was kept in the file-list:
+
+quote( --filter 'protect emptydir/')
+
+Here's an example that copies all .pdf files in a hierarchy, only creating
+the necessary destination directories to hold the .pdf files, and ensures
+that any superfluous files and directories in the destination are removed
+(note the hide filter of non-directories being used instead of an exclude):
+
+quote( rsync -avm --del --include='*.pdf' -f 'hide,! */' src/ dest)
+
+If you didn't want to remove superfluous destination files, the more
+time-honored options of "bf(--include='*/' --exclude='*')" would work fine
+in place of the hide-filter (if that is more natural to you).
+