rsync error: symlink has no referent












6















I am trying to configure rsnapshot (which uses rsync) to backup a Windows server but I am having trouble with rsync being unable to follow a symlink on the server to be backed up.



Setup:




  • Windows Server 2008 R2 with Cygwin installed which holds files to be backed up

  • ArchLinux server on the same network which should backup files from the Windows server

  • The Windows server has sshd installed and functioning

  • The Windows server does not have a running rsync daemon (As far as I can tell), but I can use rsync over ssh to connect to the Windows server from the Linux sever and copy files.

  • Because an application keeps some of the files to be backed up constantly open, the Windows server is configured to create Volume Shadow Copies of the drive that contains the data to be backed up


  • I use the following script to create a link to the latest shadow copy volume so that it can be accessed by rsync:



    #!/bin/sh
    # Mount the latest shadow copy for the specified volume

    VOLUME="D:"
    LINK_NAME="E:\latest-data-shadow-copy"


    SHADOW_VOLUME=`vssadmin list shadows /for=$VOLUME | grep "Shadow Copy Volume:" | tail -1 | tr -s ' ' | cut -d ' ' -f5`
    SHADOW_VOLUME+="\"

    rm $LINK_NAME
    cmd.exe /c mklink /d "$LINK_NAME" "$SHADOW_VOLUME"



The Problem



When I try to run rsnapshot to backup the data on the symlinked shadow copy volume, it returns the following error:



    symlink has no referent: "/cygdrive/e/latest-data-shadow-copy"


This is the rsync command that rsnapshot calls:



    /usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r --rsh=/usr/bin/ssh 'user@windowsip:/cygdrive/e/latest-data-shadow-copy/data-folder/' /media/backup-drive-1/.sync/


However if I try to use scp to copy files from the symlinked shadow copy volume it works fine:



    scp user@windowsip:/cygdrive/e/latest-data-shadow-copy/data-folder/test-file.txt test-file.txt


As far as I can figure out, this seems to suggest that the cause of the rsync error is that it is being run in chroot on the Windows server preventing it from accessing the symlinked shadow copy volume.



I tried creating a /etc/rsync.conf and adding the following:



    use chroot = no


but it has no effect on the error. I assume this is because this is a config file for the rsync daemon which I am not running.



Questions




  • What is preventing rsync from accessing the symlinked shadow copy while scp can access the files without issue?

  • If the issue is the use chroot rsync setting, how do I change it if I am not running an rsync daemon?


Thank you for your responses in advance!










share|improve this question

























  • Is it that scp trusts the system calls to resolve "/cygdrive/e/latest-data-shadow-copy", and rsync tries to resolve it itself? If you give the target of that link to rsync, does it work?

    – ShadSterling
    Nov 16 '14 at 2:06
















6















I am trying to configure rsnapshot (which uses rsync) to backup a Windows server but I am having trouble with rsync being unable to follow a symlink on the server to be backed up.



Setup:




  • Windows Server 2008 R2 with Cygwin installed which holds files to be backed up

  • ArchLinux server on the same network which should backup files from the Windows server

  • The Windows server has sshd installed and functioning

  • The Windows server does not have a running rsync daemon (As far as I can tell), but I can use rsync over ssh to connect to the Windows server from the Linux sever and copy files.

  • Because an application keeps some of the files to be backed up constantly open, the Windows server is configured to create Volume Shadow Copies of the drive that contains the data to be backed up


  • I use the following script to create a link to the latest shadow copy volume so that it can be accessed by rsync:



    #!/bin/sh
    # Mount the latest shadow copy for the specified volume

    VOLUME="D:"
    LINK_NAME="E:\latest-data-shadow-copy"


    SHADOW_VOLUME=`vssadmin list shadows /for=$VOLUME | grep "Shadow Copy Volume:" | tail -1 | tr -s ' ' | cut -d ' ' -f5`
    SHADOW_VOLUME+="\"

    rm $LINK_NAME
    cmd.exe /c mklink /d "$LINK_NAME" "$SHADOW_VOLUME"



The Problem



When I try to run rsnapshot to backup the data on the symlinked shadow copy volume, it returns the following error:



    symlink has no referent: "/cygdrive/e/latest-data-shadow-copy"


This is the rsync command that rsnapshot calls:



    /usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r --rsh=/usr/bin/ssh 'user@windowsip:/cygdrive/e/latest-data-shadow-copy/data-folder/' /media/backup-drive-1/.sync/


However if I try to use scp to copy files from the symlinked shadow copy volume it works fine:



    scp user@windowsip:/cygdrive/e/latest-data-shadow-copy/data-folder/test-file.txt test-file.txt


As far as I can figure out, this seems to suggest that the cause of the rsync error is that it is being run in chroot on the Windows server preventing it from accessing the symlinked shadow copy volume.



I tried creating a /etc/rsync.conf and adding the following:



    use chroot = no


but it has no effect on the error. I assume this is because this is a config file for the rsync daemon which I am not running.



Questions




  • What is preventing rsync from accessing the symlinked shadow copy while scp can access the files without issue?

  • If the issue is the use chroot rsync setting, how do I change it if I am not running an rsync daemon?


Thank you for your responses in advance!










share|improve this question

























  • Is it that scp trusts the system calls to resolve "/cygdrive/e/latest-data-shadow-copy", and rsync tries to resolve it itself? If you give the target of that link to rsync, does it work?

    – ShadSterling
    Nov 16 '14 at 2:06














6












6








6








I am trying to configure rsnapshot (which uses rsync) to backup a Windows server but I am having trouble with rsync being unable to follow a symlink on the server to be backed up.



Setup:




  • Windows Server 2008 R2 with Cygwin installed which holds files to be backed up

  • ArchLinux server on the same network which should backup files from the Windows server

  • The Windows server has sshd installed and functioning

  • The Windows server does not have a running rsync daemon (As far as I can tell), but I can use rsync over ssh to connect to the Windows server from the Linux sever and copy files.

  • Because an application keeps some of the files to be backed up constantly open, the Windows server is configured to create Volume Shadow Copies of the drive that contains the data to be backed up


  • I use the following script to create a link to the latest shadow copy volume so that it can be accessed by rsync:



    #!/bin/sh
    # Mount the latest shadow copy for the specified volume

    VOLUME="D:"
    LINK_NAME="E:\latest-data-shadow-copy"


    SHADOW_VOLUME=`vssadmin list shadows /for=$VOLUME | grep "Shadow Copy Volume:" | tail -1 | tr -s ' ' | cut -d ' ' -f5`
    SHADOW_VOLUME+="\"

    rm $LINK_NAME
    cmd.exe /c mklink /d "$LINK_NAME" "$SHADOW_VOLUME"



The Problem



When I try to run rsnapshot to backup the data on the symlinked shadow copy volume, it returns the following error:



    symlink has no referent: "/cygdrive/e/latest-data-shadow-copy"


This is the rsync command that rsnapshot calls:



    /usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r --rsh=/usr/bin/ssh 'user@windowsip:/cygdrive/e/latest-data-shadow-copy/data-folder/' /media/backup-drive-1/.sync/


However if I try to use scp to copy files from the symlinked shadow copy volume it works fine:



    scp user@windowsip:/cygdrive/e/latest-data-shadow-copy/data-folder/test-file.txt test-file.txt


As far as I can figure out, this seems to suggest that the cause of the rsync error is that it is being run in chroot on the Windows server preventing it from accessing the symlinked shadow copy volume.



I tried creating a /etc/rsync.conf and adding the following:



    use chroot = no


but it has no effect on the error. I assume this is because this is a config file for the rsync daemon which I am not running.



Questions




  • What is preventing rsync from accessing the symlinked shadow copy while scp can access the files without issue?

  • If the issue is the use chroot rsync setting, how do I change it if I am not running an rsync daemon?


Thank you for your responses in advance!










share|improve this question
















I am trying to configure rsnapshot (which uses rsync) to backup a Windows server but I am having trouble with rsync being unable to follow a symlink on the server to be backed up.



Setup:




  • Windows Server 2008 R2 with Cygwin installed which holds files to be backed up

  • ArchLinux server on the same network which should backup files from the Windows server

  • The Windows server has sshd installed and functioning

  • The Windows server does not have a running rsync daemon (As far as I can tell), but I can use rsync over ssh to connect to the Windows server from the Linux sever and copy files.

  • Because an application keeps some of the files to be backed up constantly open, the Windows server is configured to create Volume Shadow Copies of the drive that contains the data to be backed up


  • I use the following script to create a link to the latest shadow copy volume so that it can be accessed by rsync:



    #!/bin/sh
    # Mount the latest shadow copy for the specified volume

    VOLUME="D:"
    LINK_NAME="E:\latest-data-shadow-copy"


    SHADOW_VOLUME=`vssadmin list shadows /for=$VOLUME | grep "Shadow Copy Volume:" | tail -1 | tr -s ' ' | cut -d ' ' -f5`
    SHADOW_VOLUME+="\"

    rm $LINK_NAME
    cmd.exe /c mklink /d "$LINK_NAME" "$SHADOW_VOLUME"



The Problem



When I try to run rsnapshot to backup the data on the symlinked shadow copy volume, it returns the following error:



    symlink has no referent: "/cygdrive/e/latest-data-shadow-copy"


This is the rsync command that rsnapshot calls:



    /usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r --rsh=/usr/bin/ssh 'user@windowsip:/cygdrive/e/latest-data-shadow-copy/data-folder/' /media/backup-drive-1/.sync/


However if I try to use scp to copy files from the symlinked shadow copy volume it works fine:



    scp user@windowsip:/cygdrive/e/latest-data-shadow-copy/data-folder/test-file.txt test-file.txt


As far as I can figure out, this seems to suggest that the cause of the rsync error is that it is being run in chroot on the Windows server preventing it from accessing the symlinked shadow copy volume.



I tried creating a /etc/rsync.conf and adding the following:



    use chroot = no


but it has no effect on the error. I assume this is because this is a config file for the rsync daemon which I am not running.



Questions




  • What is preventing rsync from accessing the symlinked shadow copy while scp can access the files without issue?

  • If the issue is the use chroot rsync setting, how do I change it if I am not running an rsync daemon?


Thank you for your responses in advance!







backup cygwin rsync chroot rsnapshot






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 5 '14 at 22:57







Marek

















asked Feb 4 '14 at 22:01









MarekMarek

3112




3112













  • Is it that scp trusts the system calls to resolve "/cygdrive/e/latest-data-shadow-copy", and rsync tries to resolve it itself? If you give the target of that link to rsync, does it work?

    – ShadSterling
    Nov 16 '14 at 2:06



















  • Is it that scp trusts the system calls to resolve "/cygdrive/e/latest-data-shadow-copy", and rsync tries to resolve it itself? If you give the target of that link to rsync, does it work?

    – ShadSterling
    Nov 16 '14 at 2:06

















Is it that scp trusts the system calls to resolve "/cygdrive/e/latest-data-shadow-copy", and rsync tries to resolve it itself? If you give the target of that link to rsync, does it work?

– ShadSterling
Nov 16 '14 at 2:06





Is it that scp trusts the system calls to resolve "/cygdrive/e/latest-data-shadow-copy", and rsync tries to resolve it itself? If you give the target of that link to rsync, does it work?

– ShadSterling
Nov 16 '14 at 2:06










1 Answer
1






active

oldest

votes


















0














I had similar problem with symlink has no referent:



The root cause was: the link was pointing to non-existent place. Just someone in organisation changed file system structure after links were created and not updated the links.



Solution was one of following:




  1. Fix the links pointing into existing location.

  2. Remove links as not necessary (is no one but rsync use them).

  3. Exclude attempt of rsync to access your link with option --exclude '/cygdrive/e/latest-data-shadow-copy'. This is asked "prevention" method, however, maybe not the best one, so last option proposed.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f712471%2frsync-error-symlink-has-no-referent%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I had similar problem with symlink has no referent:



    The root cause was: the link was pointing to non-existent place. Just someone in organisation changed file system structure after links were created and not updated the links.



    Solution was one of following:




    1. Fix the links pointing into existing location.

    2. Remove links as not necessary (is no one but rsync use them).

    3. Exclude attempt of rsync to access your link with option --exclude '/cygdrive/e/latest-data-shadow-copy'. This is asked "prevention" method, however, maybe not the best one, so last option proposed.






    share|improve this answer




























      0














      I had similar problem with symlink has no referent:



      The root cause was: the link was pointing to non-existent place. Just someone in organisation changed file system structure after links were created and not updated the links.



      Solution was one of following:




      1. Fix the links pointing into existing location.

      2. Remove links as not necessary (is no one but rsync use them).

      3. Exclude attempt of rsync to access your link with option --exclude '/cygdrive/e/latest-data-shadow-copy'. This is asked "prevention" method, however, maybe not the best one, so last option proposed.






      share|improve this answer


























        0












        0








        0







        I had similar problem with symlink has no referent:



        The root cause was: the link was pointing to non-existent place. Just someone in organisation changed file system structure after links were created and not updated the links.



        Solution was one of following:




        1. Fix the links pointing into existing location.

        2. Remove links as not necessary (is no one but rsync use them).

        3. Exclude attempt of rsync to access your link with option --exclude '/cygdrive/e/latest-data-shadow-copy'. This is asked "prevention" method, however, maybe not the best one, so last option proposed.






        share|improve this answer













        I had similar problem with symlink has no referent:



        The root cause was: the link was pointing to non-existent place. Just someone in organisation changed file system structure after links were created and not updated the links.



        Solution was one of following:




        1. Fix the links pointing into existing location.

        2. Remove links as not necessary (is no one but rsync use them).

        3. Exclude attempt of rsync to access your link with option --exclude '/cygdrive/e/latest-data-shadow-copy'. This is asked "prevention" method, however, maybe not the best one, so last option proposed.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jun 20 '18 at 10:55









        Ivy GrowingIvy Growing

        1011




        1011






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f712471%2frsync-error-symlink-has-no-referent%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Plaza Victoria

            Puebla de Zaragoza

            Musa