rsync daemon syntax, as de‐
sired.
o The first example uses the created "foo.sh" file to get the right
rsync options when running the read‐batch command on the remote
host.
o The second example reads the batch data via standard input so
that the batch file doesn’t need to be copied to the remote ma‐
chine first. This example avoids the foo.sh script because it
needed to use a modified --read‐batch option, but you could edit
the script file if you wished to make use of it (just be sure
that no other option is trying to use standard input, such as the
--exclude‐from=- option).
Caveats:
The read‐batch option expects the destination tree that it is updating
to be identical to the destination tree that was used to create the
batch update fileset. When a difference between the destination trees
is encountered the update might be discarded with a warning (if the file
appears to be up‐to‐date already) or the file‐update may be attempted
and then, if the file fails to verify, the update discarded with an er‐
ror. This means that it should be safe to re‐run a read‐batch operation
if the command got interrupted. If you wish to force the batched‐update
to always be attempted regardless of the file’s size and date, use the
-I option (when reading the batch). If an error occurs, the destination
tree will probably be in a partially updated state. In that case, rsync
can be used in its regular (non‐batch) mode of operation to fix up the
destination tree.
The rsync version used on all destinations must be at least as new as
the one used to generate the batch file. Rsync will die with an error
if the protocol version in the batch file is too new for the batch‐read‐
ing rsync to handle. See also the --protocol option for a way to have
the creating rsync generate a batch file that an older rsync can under‐
stand. (Note that batch files changed format in version 2.6.3, so mix‐
ing versions older than that with newer versions will not work.)
When reading a batch file, rsync will force the value of certain options
to match the data in the batch file if you didn’t set them to the same
as the batch‐writing command. Other options can (and should) be
changed. For instance --write‐batch changes to --read‐batch, --files‐
from is dropped, and the --filter / --include / --exclude options are
not needed unless one of the --delete options is specified.
The code that creates the BATCH.sh file transforms any filter/in‐
clude/exclude options into a single list that is appended as a "here"
document to the shell script file. An advanced user can use this to
modify the exclude list if a change in what gets deleted by --delete is
desired. A normal user can ignore this detail and just use the shell
script as an easy way to run the appropriate --read‐batch command for
the batched data.
The original batch mode in rsync was based on "rsync+", but the latest
version uses a new implementation.
SYMBOLIC LINKS
Three basic behaviors are possible when rsync encounters a symbolic link
in the source directory.
By default, symbolic links are not transferred at all. A message "skip‐
ping non‐regular" file is emitted for any symlinks that exist.
If --links is specified, then symlinks are added to the transfer (in‐
stead of being noisily ignored), and the default handling is to recreate
them with the same target on the destination. Note that --archive im‐
plies --links.
If --copy‐links is specified, then symlinks