3 Replies Latest reply on Jul 12, 2011 10:06 AM by Dude!

    rsync not copying softlink

    DOA
      Hi all,

      I have to use rsync to synchronize my PROD instance with DR site.
      both side the user are same (appl) and I need to copy whole directories from source to destination with the same ownership and permissions.
      its all hepning very well.

      only problem is, there are some dir in souce side heaving softlink with each other, these dir are copying from source to destination but not creating the softlink between them.

      executing this command to rsync with appl user on source : ( oratop is the dir name which need to copy from source to desti, owner is appl )

      rsync -avzul --stats oratop appl@17.172.90.38:/d04/appltop/

      errror I am gettitng is :

      could not make way for new symlink: prodora/iAS/6iserver
      could not make way for new symlink: prodora/iAS/JRE
      could not make way for new symlink: prodora/iAS/appsoui
      could not make way for new symlink: prodora/iAS/Apache/jdk
      could not make way for new symlink: prodora/iAS/ifs1.1/jws/jre
      could not make way for new symlink: prodora/iAS/oui21/jre/1.3.1/bin
      could not make way for new symlink: prodora/iAS/oui21/jre/1.3.1/lib
      rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1039) [sender=3.0.6]

      please suggest a way to create the softlink between files/directories as they are in source server.

      Thanks in ADV!
        • 1. Re: rsync not copying softlink
          Dude!
          The error can happen if a directory at the source is replaced by a symlink, which requires to remove the directory at the destination in order to create the symlink, but it cannot if the directory is not empty. According to the rsync manpage, I would try the following:

          --force, force deletion of dirs even if not empty
          --delete, delete extraneous files from dest dirs

          For instance:

          rsync -avzul stats force oratop appl@17.172.90.38:/d04/appltop/
          • 2. Re: rsync not copying softlink
            DOA
            Thanks for the reply !

            YES it is working now THANKS, all softlink created on destination with today's date.

            Only thing which is different is ownership of these link, please see below: (Other file/dir are heaving same ownership on both side)

            source:
            lrwxrwxrwx 1 emdadm dba 34 Aug 23 2010 6iserver -> /d04/appltop/prodora/8.0.6
            lrwxrwxrwx 1 emdadm dba 5 Aug 23 2010 appsoui -> oui21
            lrwxrwxrwx 1 emdadm dba 10 Aug 23 2010 JRE -> appsjre118

            Destination:

            lrwxrwxrwx 1 appl dba 5 Jul 12 14:12 appsoui -> oui21
            lrwxrwxrwx 1 appl dba 10 Jul 12 14:12 JRE -> appsjre118
            lrwxrwxrwx 1 appl dba 34 Jul 12 14:12 6iserver -> /d04/appltop/prodora/8.0.6

            How can we set our rsync to restore the original ownership as it is in source.

            Thanks!!!!
            • 3. Re: rsync not copying softlink
              Dude!
              From what I understand, symbolic links are not copied; they are created. Changing the ownership of a symbolic link will change the ownership of the directory or file it is linked too. The ownership of the symlink itself is irrelevant and cannot be changed.