receiving side to hold an additional copy of all the updated
files. Note also that you should not use an absolute path to
--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 de‐
layed updates will fail if they can’t be renamed into
place).
See also the "atomic‐rsync" python script in the "support" subdir
for an update algorithm that is even more atomic (it uses --link‐
dest and a parallel hierarchy of files).
--prune‐empty‐dirs, -m
This option tells the receiving rsync to get rid of empty direc‐
tories from the file‐list, including nested directories that have
no non‐directory children. This is useful for avoiding the cre‐
ation of a bunch of useless directories when the sending rsync is
recursively scanning a hierarchy of files using include/ex‐
clude/filter rules.
This option can still leave empty directories on the receiving
side if you make use of TRANSFER_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 due to an exclude both
hiding source files and protecting destination files. See the
perishable filter‐rule option for how to avoid this.
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:
‐‐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‐directo‐
ries being used instead of an exclude):
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 --include=’*/’ --exclude=’*’ would
work fine in place of the hide‐filter (if that is more natural to
you).
--progress
This option tells rsync to print information showing the progress
of the transfer. This gives a bored user something to watch.
With a modern rsync this is the same as specifying
--info=flist2,name,progress, but any user‐supplied settings for
those info flags takes precedence (e.g.
--info=flist0 --progress).
While rsync is transferring a regular file, it updates a progress
line that looks like this:
782448 63% 110.64kB/s 0:00:04
In this example, the receiver has reconstructed 782448 bytes or
63% of the sender’s file, which is being reconstructed at a rate
of 110.64 kilobytes per second, and the transfer will finish in 4
seconds if the current rate is maintained until the end.
These statistics can be misleading if rsync’s delta‐transfer al‐
gorithm is in use. For example,