LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   rsync - how to suppress "skipping non-regular file" messages (https://www.linuxquestions.org/questions/linux-newbie-8/rsync-how-to-suppress-skipping-non-regular-file-messages-880073/)

arashi256 05-11-2011 08:06 AM

rsync - how to suppress "skipping non-regular file" messages
 
Using rsync, which switch will allow rsync to suppress the "skipping non-regular file" messages in the output while still being reasonably verbose for everything else?

Snark1994 05-11-2011 09:02 AM

The relevant section of the man page is:
Code:

      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
      "skipping non-regular" file is emitted for any symlinks that exist.

      If --links is specified, then symlinks are recreated with the same tar-
      get on the destination.  Note that --archive implies --links.

      If  --copy-links is specified, then symlinks are "collapsed" by copying
      their referent, rather than the symlink.

      Rsync can also distinguish "safe"  and  "unsafe"  symbolic  links.  An
      example  where  this  might be used is a web site mirror that wishes to
      ensure that the rsync module that is copied does not  include  symbolic
      links  to  /etc/passwd  in  the  public  section  of  the  site.  Using
      --copy-unsafe-links will cause any links to be copied as the file  they
      point  to  on  the  destination.  Using --safe-links will cause unsafe
      links to be omitted altogether.  (Note that you  must  specify  --links
      for --safe-links to have any effect.)

      Symbolic  links  are  considered  unsafe  if they are absolute symlinks
      (start with /), empty, or if they contain  enough  ".."  components  to
      ascend from the directory being copied.

      Here's  a summary of how the symlink options are interpreted.  The list
      is in order of precedence, so if your combination of options isn't men-
      tioned, use the first line that is a complete subset of your options:

      --copy-links
              Turn all symlinks into normal files (leaving no symlinks for any
              other options to affect).

      --links --copy-unsafe-links
              Turn all unsafe symlinks into files and duplicate all safe  sym-
              links.

      --copy-unsafe-links
              Turn  all unsafe symlinks into files, noisily skip all safe sym-
              links.

      --links --safe-links
              Duplicate safe symlinks and skip unsafe ones.

      --links
              Duplicate all symlinks.

My guess is probably that you want the "--links --copy-unsafe-links" switch, but it depends on exactly which behaviour you want :)


All times are GMT -5. The time now is 02:57 AM.