Home Explore Blog CI



man-pages

25th chunk of `rsync.man`
1560aeaad9275544c19aa5a48908ff63a8251dd10b4609b90000000100000fe1
 any  match‐
              ing  file  on the receiver from being deleted when the symlink is
              deemed to be unsafe and is skipped.

              This option must be combined with --links (or --archive) to  have
              any  symlinks in the transfer to conditionally ignore. Its effect
              is superseded by --copy‐unsafe‐links.

              Using this option in conjunction with --relative may  give  unex‐
              pected results.

              See the SYMBOLIC LINKS section for multi‐option info.

       --munge‐links
              This option affects just one side of the transfer and tells rsync
              to  munge  symlink  values  when it is receiving files or unmunge
              symlink values when it is sending files.  The munged values  make
              the symlinks unusable on disk but allows the original contents of
              the symlinks to be recovered.

              The  server‐side  rsync  often  enables  this  option without the
              client’s knowledge, such as in an  rsync  daemon’s  configuration
              file  or  by  an  option  given  to the rrsync (restricted rsync)
              script.  When specified on the client side,  specify  the  option
              normally  if it is the client side that has/needs the munged sym‐
              links, or use -M--munge‐links to give the option  to  the  server
              when  it  has/needs  the  munged  symlinks.  Note that on a local
              transfer, the client is the sender, so specifying the option  di‐
              rectly  unmunges  symlinks while specifying it as a remote option
              munges symlinks.

              This option has no effect when sent to a daemon via  --remote‐op‐
              tion  because  the daemon configures whether it wants munged sym‐
              links via its "munge symlinks" parameter.

              The symlink value is munged/unmunged once it is in the  transfer,
              so  any  option that transforms symlinks into non‐symlinks occurs
              prior to the munging/unmunging except for --safe‐links, which  is
              a choice that the receiver makes, so it bases its decision on the
              munged/unmunged  value.   This  does  mean that if a receiver has
              munging enabled, that using --safe‐links will cause all  symlinks
              to be ignored (since they are all absolute).

              The  method  that  rsync  uses to munge the symlinks is to prefix
              each one’s value with the string  "/rsyncd‐munged/".   This  pre‐
              vents the links from being used as long as the directory does not
              exist.   When this option is enabled, rsync will refuse to run if
              that path is a directory or a symlink to a directory  (though  it
              only  checks  at  startup).  See also the "munge‐symlinks" python
              script in the support directory of the source code for a  way  to
              munge/unmunge one or more symlinks in‐place.

       --copy‐dirlinks, -k
              This  option  causes the sending side to treat a symlink to a di‐
              rectory as though it were a real directory.  This  is  useful  if
              you  don’t  want  symlinks  to non‐directories to be affected, as
              they would be using --copy‐links.

              Without this option, if the sending side has replaced a directory
              with a symlink to a directory, the  receiving  side  will  delete
              anything  that  is in the way of the new symlink, including a di‐
              rectory hierarchy (as long as --force or --delete is in effect).

              See also --keep‐dirlinks for an analogous option for the  receiv‐
              ing side.

              --copy‐dirlinks  applies  to  all  symlinks to directories in the
              source.  If you want to follow only a few specified  symlinks,  a
              trick  you can use is to pass them

Title: Rsync Symlink Munging, Copying Directory Links
Summary
This section describes rsync's '--munge-links' option, which modifies symlink values to render them unusable while preserving their original content. It's often enabled server-side and involves prefixing symlink values with '/rsyncd-munged/'. The section also explains '--copy-dirlinks' (-k), which treats symlinks to directories as real directories on the sending side, useful when you want to prevent regular symlinks from being affected while copying directory links.