What happens with simultaneous scp and mv?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite
1












What happens when I scp large file from computer A to computer B, then move mv that file to a different location on the same partition of computer B before the scp is complete?



I assume just the location is updated in the directory entry? So my file will not be corrupted in any way by doing so?










share|improve this question



























    up vote
    1
    down vote

    favorite
    1












    What happens when I scp large file from computer A to computer B, then move mv that file to a different location on the same partition of computer B before the scp is complete?



    I assume just the location is updated in the directory entry? So my file will not be corrupted in any way by doing so?










    share|improve this question

























      up vote
      1
      down vote

      favorite
      1









      up vote
      1
      down vote

      favorite
      1






      1





      What happens when I scp large file from computer A to computer B, then move mv that file to a different location on the same partition of computer B before the scp is complete?



      I assume just the location is updated in the directory entry? So my file will not be corrupted in any way by doing so?










      share|improve this question















      What happens when I scp large file from computer A to computer B, then move mv that file to a different location on the same partition of computer B before the scp is complete?



      I assume just the location is updated in the directory entry? So my file will not be corrupted in any way by doing so?







      filesystems scp mv






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 3 hours ago

























      asked 4 hours ago









      Morgoth

      1067




      1067




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          5
          down vote













          Yes, assuming the target where the file is moved to is on same file system moving the file will only update directory entries. Moving a file won't alter the file descriptor which scp uses to access the file on B [note].



          On different filesystems mv has to copy the file first, and then unlink the file at old location. The only situation you could see corruption is if you move to different filesystem before transfer is complete (scp has not received everything/flushed write buffers before mv). Then it is possible mv might copy the file only partially.



          [note]: if scp tranfer was interrupted, obviously it could not be resumed using the original path if the file was moved.






          share|improve this answer






















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            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',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f470276%2fwhat-happens-with-simultaneous-scp-and-mv%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            5
            down vote













            Yes, assuming the target where the file is moved to is on same file system moving the file will only update directory entries. Moving a file won't alter the file descriptor which scp uses to access the file on B [note].



            On different filesystems mv has to copy the file first, and then unlink the file at old location. The only situation you could see corruption is if you move to different filesystem before transfer is complete (scp has not received everything/flushed write buffers before mv). Then it is possible mv might copy the file only partially.



            [note]: if scp tranfer was interrupted, obviously it could not be resumed using the original path if the file was moved.






            share|improve this answer


























              up vote
              5
              down vote













              Yes, assuming the target where the file is moved to is on same file system moving the file will only update directory entries. Moving a file won't alter the file descriptor which scp uses to access the file on B [note].



              On different filesystems mv has to copy the file first, and then unlink the file at old location. The only situation you could see corruption is if you move to different filesystem before transfer is complete (scp has not received everything/flushed write buffers before mv). Then it is possible mv might copy the file only partially.



              [note]: if scp tranfer was interrupted, obviously it could not be resumed using the original path if the file was moved.






              share|improve this answer
























                up vote
                5
                down vote










                up vote
                5
                down vote









                Yes, assuming the target where the file is moved to is on same file system moving the file will only update directory entries. Moving a file won't alter the file descriptor which scp uses to access the file on B [note].



                On different filesystems mv has to copy the file first, and then unlink the file at old location. The only situation you could see corruption is if you move to different filesystem before transfer is complete (scp has not received everything/flushed write buffers before mv). Then it is possible mv might copy the file only partially.



                [note]: if scp tranfer was interrupted, obviously it could not be resumed using the original path if the file was moved.






                share|improve this answer














                Yes, assuming the target where the file is moved to is on same file system moving the file will only update directory entries. Moving a file won't alter the file descriptor which scp uses to access the file on B [note].



                On different filesystems mv has to copy the file first, and then unlink the file at old location. The only situation you could see corruption is if you move to different filesystem before transfer is complete (scp has not received everything/flushed write buffers before mv). Then it is possible mv might copy the file only partially.



                [note]: if scp tranfer was interrupted, obviously it could not be resumed using the original path if the file was moved.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 4 hours ago

























                answered 4 hours ago









                sebasth

                6,28821643




                6,28821643



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f470276%2fwhat-happens-with-simultaneous-scp-and-mv%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    Long meetings (6-7 hours a day): Being “babysat” by supervisor

                    What does second last employer means? [closed]

                    One-line joke