Home Explore Blog CI



man-pages

87th chunk of `rsync.man`
0fd1d98434b26fdf8add6b6d3c6c2817b9c7cbf117b7ab4a0000000100000fe0
 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

Title: Rsync Batch Mode Caveats, Compatibility, and Symbolic Links
Summary
This passage details important caveats for using rsync's batch mode, emphasizing the need for identical destination trees during read-batch operations and the consequences of discrepancies, which may lead to warnings, errors, or partially updated states. It advises using the -I option to force updates regardless of file size and date. The text also highlights version compatibility requirements between rsync instances used for writing and reading batch files and notes how certain options are automatically adjusted during batch reading. Furthermore, it discusses how filter/include/exclude options are transformed in the BATCH.sh file and mentions the evolution of rsync's batch mode implementation. Finally, it outlines rsync's behavior regarding symbolic links: skipping by default, recreating with the same target when using --links (implied by --archive), or copying as actual files when using --copy-links.