Is there ever a reason to use scp instead of rsync?

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











up vote
52
down vote

favorite
9












Is there a reason to use scp instead of rsync? I can see no reason for using scp ever again, rsync does everything that scp does, with more safety (can preserve symlinks etc).










share|improve this question



















  • 6




    Short answer: No. scp is never harmful.
    – Shadur
    May 31 '12 at 9:01






  • 1




    @Shadur scp is harmful in that it overwrites existing target files by default. So's rsync, but it at least allows limiting the possible damage with -u.
    – Gilles
    May 31 '12 at 22:46







  • 3




    @Gilles As with any tool, you must understand what it does and how it does it to use it safely.
    – Alex Chamberlain
    Jun 1 '12 at 7:24






  • 6




    In that context, regular cp and rm would be considered "harmful" -- and if you define "harmful" as "can screw me over if I do something stupid", rsync isn't any less harmful.
    – Shadur
    Jun 1 '12 at 9:31






  • 1




    On systems without rsync installed, using rsync is (obviously) not even possible.
    – Kusalananda
    Feb 21 at 10:23














up vote
52
down vote

favorite
9












Is there a reason to use scp instead of rsync? I can see no reason for using scp ever again, rsync does everything that scp does, with more safety (can preserve symlinks etc).










share|improve this question



















  • 6




    Short answer: No. scp is never harmful.
    – Shadur
    May 31 '12 at 9:01






  • 1




    @Shadur scp is harmful in that it overwrites existing target files by default. So's rsync, but it at least allows limiting the possible damage with -u.
    – Gilles
    May 31 '12 at 22:46







  • 3




    @Gilles As with any tool, you must understand what it does and how it does it to use it safely.
    – Alex Chamberlain
    Jun 1 '12 at 7:24






  • 6




    In that context, regular cp and rm would be considered "harmful" -- and if you define "harmful" as "can screw me over if I do something stupid", rsync isn't any less harmful.
    – Shadur
    Jun 1 '12 at 9:31






  • 1




    On systems without rsync installed, using rsync is (obviously) not even possible.
    – Kusalananda
    Feb 21 at 10:23












up vote
52
down vote

favorite
9









up vote
52
down vote

favorite
9






9





Is there a reason to use scp instead of rsync? I can see no reason for using scp ever again, rsync does everything that scp does, with more safety (can preserve symlinks etc).










share|improve this question















Is there a reason to use scp instead of rsync? I can see no reason for using scp ever again, rsync does everything that scp does, with more safety (can preserve symlinks etc).







ssh rsync scp






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 10 '12 at 22:00









Mikel

38.4k997125




38.4k997125










asked May 31 '12 at 7:02









mikebloch

369135




369135







  • 6




    Short answer: No. scp is never harmful.
    – Shadur
    May 31 '12 at 9:01






  • 1




    @Shadur scp is harmful in that it overwrites existing target files by default. So's rsync, but it at least allows limiting the possible damage with -u.
    – Gilles
    May 31 '12 at 22:46







  • 3




    @Gilles As with any tool, you must understand what it does and how it does it to use it safely.
    – Alex Chamberlain
    Jun 1 '12 at 7:24






  • 6




    In that context, regular cp and rm would be considered "harmful" -- and if you define "harmful" as "can screw me over if I do something stupid", rsync isn't any less harmful.
    – Shadur
    Jun 1 '12 at 9:31






  • 1




    On systems without rsync installed, using rsync is (obviously) not even possible.
    – Kusalananda
    Feb 21 at 10:23












  • 6




    Short answer: No. scp is never harmful.
    – Shadur
    May 31 '12 at 9:01






  • 1




    @Shadur scp is harmful in that it overwrites existing target files by default. So's rsync, but it at least allows limiting the possible damage with -u.
    – Gilles
    May 31 '12 at 22:46







  • 3




    @Gilles As with any tool, you must understand what it does and how it does it to use it safely.
    – Alex Chamberlain
    Jun 1 '12 at 7:24






  • 6




    In that context, regular cp and rm would be considered "harmful" -- and if you define "harmful" as "can screw me over if I do something stupid", rsync isn't any less harmful.
    – Shadur
    Jun 1 '12 at 9:31






  • 1




    On systems without rsync installed, using rsync is (obviously) not even possible.
    – Kusalananda
    Feb 21 at 10:23







6




6




Short answer: No. scp is never harmful.
– Shadur
May 31 '12 at 9:01




Short answer: No. scp is never harmful.
– Shadur
May 31 '12 at 9:01




1




1




@Shadur scp is harmful in that it overwrites existing target files by default. So's rsync, but it at least allows limiting the possible damage with -u.
– Gilles
May 31 '12 at 22:46





@Shadur scp is harmful in that it overwrites existing target files by default. So's rsync, but it at least allows limiting the possible damage with -u.
– Gilles
May 31 '12 at 22:46





3




3




@Gilles As with any tool, you must understand what it does and how it does it to use it safely.
– Alex Chamberlain
Jun 1 '12 at 7:24




@Gilles As with any tool, you must understand what it does and how it does it to use it safely.
– Alex Chamberlain
Jun 1 '12 at 7:24




6




6




In that context, regular cp and rm would be considered "harmful" -- and if you define "harmful" as "can screw me over if I do something stupid", rsync isn't any less harmful.
– Shadur
Jun 1 '12 at 9:31




In that context, regular cp and rm would be considered "harmful" -- and if you define "harmful" as "can screw me over if I do something stupid", rsync isn't any less harmful.
– Shadur
Jun 1 '12 at 9:31




1




1




On systems without rsync installed, using rsync is (obviously) not even possible.
– Kusalananda
Feb 21 at 10:23




On systems without rsync installed, using rsync is (obviously) not even possible.
– Kusalananda
Feb 21 at 10:23










7 Answers
7






active

oldest

votes

















up vote
24
down vote



accepted










If you have to copy a large number of files, or have large files, rsync over ssh will be much faster than scp.






share|improve this answer
















  • 21




    rsync speeds up copies when the destination already has an older copy of the file(s) by sending only the changed parts, otherwise it is not faster than scp.
    – psusi
    May 31 '12 at 22:19






  • 5




    You can try it out yourself, or take someone elses word for it: digitalsanctuary.com/tech-blog/debian/… . Try scp vs rsync of your /usr/bin/ dir for example.
    – Not Now
    May 31 '12 at 22:43






  • 1




    It looks like scp does have a problem with large numbers of small files. With a single large file though, both can easily saturate a 100 mbps lan.
    – psusi
    Jun 1 '12 at 14:32






  • 1




    Interesting. rsync should have more overhead, since it needs to check in advance if the target(s) exists.
    – Nils
    Jun 10 '12 at 20:56






  • 26




    I don't see how this answers the question
    – ericn
    May 15 '15 at 2:11

















up vote
40
down vote













scp provides a cp like method to copy files from one machine to a remote machine over a secure SSH connection.



rsync allows you to syncronise remote folders.



They are different programs and both have their uses. scp is always secure, whereas rsync must travel over SSH to be secure.






share|improve this answer
















  • 6




    Also, pretty sure rsync has to be installed on the other end.
    – ckhan
    May 31 '12 at 7:59






  • 3




    @ckhan, no it can copy without having anything installed in the other side, it'll just be less efficient.
    – mikebloch
    May 31 '12 at 8:40






  • 2




    I like scp's simplicity.
    – Alex Chamberlain
    May 31 '12 at 9:29






  • 2




    @mikebloch How do you do that? Is it a new feature? Just tried this using version 3.0.9. and it complained it couldn't find rsync on the remote.
    – Alexios
    May 31 '12 at 10:00






  • 1




    @mikebloch, it has to be installed on the server to do the checksum computations, which can add a lot of cpu load to the server. This is why most large sites don't support it, and why zsync was created as an alternative.
    – psusi
    May 31 '12 at 22:17


















up vote
15
down vote













One of the main things (which I think no one mentioned) is that if you are transferring large amounts of data or files, and if the transfer is disconnected before completion for any reason, rsync will pick it up where it left off. Whereas scp doesn't.



I use scp if I want to transfer one or couple of files or directories. I go to rsync for multi GB size data.






share|improve this answer
















  • 2




    Might be worth adding that the --partial flag is useful when transferring large files. rsync will pick up where it left off within the file rather than starting that file again.
    – Flup
    Jul 26 '13 at 15:28










  • As @Flup mentioned rsync won't leave anyt file-in-transit around for you to resume unless you use the --partial option. These files are by default hidden in the target directory. You can use --partial-dir to put all of these files in a single directory.
    – Lester Cheung
    Mar 1 '16 at 10:56










  • Well, rsync -vP username@host:/path/to/file . will do this too. See this answer on Stackoverflow
    – Devesh Saini
    Aug 12 '16 at 18:20


















up vote
5
down vote













rsync: Transfers deltas(using its Delta Transfer Algorithm) between:




  1. local and remote hosts

scp: Transfers whole files between:




  1. local and remote hosts


  2. remote and remote hosts

Summary: scp can transfer files between two remote hosts while rsync doesn't support it.






share|improve this answer






















  • rsync can transfer files between two remote hosts. In fact, rsync a host:b is equivalent to scp a host:b.
    – brandizzi
    Feb 19 '17 at 13:34











  • That's what I wrote, rsync can transfer deltas between local and remote hosts but scp is not limited to just that, it can transfer deltas between two remote hosts. @brandizzi
    – Devesh Saini
    Feb 19 '17 at 14:08

















up vote
2
down vote













User Chris at Webhosting Talk writes:




rsync compares the files at each end and transfers only the changed
parts of changed files. When you transfer files the first timeo it
behaves pretty much like scp, but for a second transfer, where most
files are unchanged, it will push a lot less data than scp. It's also
a convenient way to restart failed transfers - you just reissue the
same command and it will pick up where it left off the time before,
whereas scp will start again from scratch.







share|improve this answer





























    up vote
    0
    down vote













    scp is simpler to use as it takes less arguments. I catch myselv using scp instead of rsync if I only transfer a single file. Propably I am just to lazy to define an alias to rsync... ;-)






    share|improve this answer
















    • 1




      Hmmm, why is it so? rsync a host:b is equivalent to scp a host:b, same number of arguments.
      – mikebloch
      Apr 9 '13 at 5:40






    • 1




      @mikebloch Two letters more to type... ;-) In the past I had to supply "-e ssh -a" to get the proper result. Now that "-e ssh" is default this might be a different game.
      – Nils
      Apr 9 '13 at 14:44

















    up vote
    0
    down vote













    Credits to @tomrunia at https://gist.github.com/KartikTalwar/4393116



    rsync -aHAXxv --numeric-ids --delete --progress 
    -e "ssh -T -c aes128-gcm@openssh.com -o Compression=no -x"
    [source_directory] user@hostname:[target_directory]/


    Pay attention to --delete, don't use it if you want to keep extraneous files in dest dirs






    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: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      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%2funix.stackexchange.com%2fquestions%2f39718%2fis-there-ever-a-reason-to-use-scp-instead-of-rsync%23new-answer', 'question_page');

      );

      Post as a guest






























      7 Answers
      7






      active

      oldest

      votes








      7 Answers
      7






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      24
      down vote



      accepted










      If you have to copy a large number of files, or have large files, rsync over ssh will be much faster than scp.






      share|improve this answer
















      • 21




        rsync speeds up copies when the destination already has an older copy of the file(s) by sending only the changed parts, otherwise it is not faster than scp.
        – psusi
        May 31 '12 at 22:19






      • 5




        You can try it out yourself, or take someone elses word for it: digitalsanctuary.com/tech-blog/debian/… . Try scp vs rsync of your /usr/bin/ dir for example.
        – Not Now
        May 31 '12 at 22:43






      • 1




        It looks like scp does have a problem with large numbers of small files. With a single large file though, both can easily saturate a 100 mbps lan.
        – psusi
        Jun 1 '12 at 14:32






      • 1




        Interesting. rsync should have more overhead, since it needs to check in advance if the target(s) exists.
        – Nils
        Jun 10 '12 at 20:56






      • 26




        I don't see how this answers the question
        – ericn
        May 15 '15 at 2:11














      up vote
      24
      down vote



      accepted










      If you have to copy a large number of files, or have large files, rsync over ssh will be much faster than scp.






      share|improve this answer
















      • 21




        rsync speeds up copies when the destination already has an older copy of the file(s) by sending only the changed parts, otherwise it is not faster than scp.
        – psusi
        May 31 '12 at 22:19






      • 5




        You can try it out yourself, or take someone elses word for it: digitalsanctuary.com/tech-blog/debian/… . Try scp vs rsync of your /usr/bin/ dir for example.
        – Not Now
        May 31 '12 at 22:43






      • 1




        It looks like scp does have a problem with large numbers of small files. With a single large file though, both can easily saturate a 100 mbps lan.
        – psusi
        Jun 1 '12 at 14:32






      • 1




        Interesting. rsync should have more overhead, since it needs to check in advance if the target(s) exists.
        – Nils
        Jun 10 '12 at 20:56






      • 26




        I don't see how this answers the question
        – ericn
        May 15 '15 at 2:11












      up vote
      24
      down vote



      accepted







      up vote
      24
      down vote



      accepted






      If you have to copy a large number of files, or have large files, rsync over ssh will be much faster than scp.






      share|improve this answer












      If you have to copy a large number of files, or have large files, rsync over ssh will be much faster than scp.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered May 31 '12 at 22:05









      Not Now

      1,84911216




      1,84911216







      • 21




        rsync speeds up copies when the destination already has an older copy of the file(s) by sending only the changed parts, otherwise it is not faster than scp.
        – psusi
        May 31 '12 at 22:19






      • 5




        You can try it out yourself, or take someone elses word for it: digitalsanctuary.com/tech-blog/debian/… . Try scp vs rsync of your /usr/bin/ dir for example.
        – Not Now
        May 31 '12 at 22:43






      • 1




        It looks like scp does have a problem with large numbers of small files. With a single large file though, both can easily saturate a 100 mbps lan.
        – psusi
        Jun 1 '12 at 14:32






      • 1




        Interesting. rsync should have more overhead, since it needs to check in advance if the target(s) exists.
        – Nils
        Jun 10 '12 at 20:56






      • 26




        I don't see how this answers the question
        – ericn
        May 15 '15 at 2:11












      • 21




        rsync speeds up copies when the destination already has an older copy of the file(s) by sending only the changed parts, otherwise it is not faster than scp.
        – psusi
        May 31 '12 at 22:19






      • 5




        You can try it out yourself, or take someone elses word for it: digitalsanctuary.com/tech-blog/debian/… . Try scp vs rsync of your /usr/bin/ dir for example.
        – Not Now
        May 31 '12 at 22:43






      • 1




        It looks like scp does have a problem with large numbers of small files. With a single large file though, both can easily saturate a 100 mbps lan.
        – psusi
        Jun 1 '12 at 14:32






      • 1




        Interesting. rsync should have more overhead, since it needs to check in advance if the target(s) exists.
        – Nils
        Jun 10 '12 at 20:56






      • 26




        I don't see how this answers the question
        – ericn
        May 15 '15 at 2:11







      21




      21




      rsync speeds up copies when the destination already has an older copy of the file(s) by sending only the changed parts, otherwise it is not faster than scp.
      – psusi
      May 31 '12 at 22:19




      rsync speeds up copies when the destination already has an older copy of the file(s) by sending only the changed parts, otherwise it is not faster than scp.
      – psusi
      May 31 '12 at 22:19




      5




      5




      You can try it out yourself, or take someone elses word for it: digitalsanctuary.com/tech-blog/debian/… . Try scp vs rsync of your /usr/bin/ dir for example.
      – Not Now
      May 31 '12 at 22:43




      You can try it out yourself, or take someone elses word for it: digitalsanctuary.com/tech-blog/debian/… . Try scp vs rsync of your /usr/bin/ dir for example.
      – Not Now
      May 31 '12 at 22:43




      1




      1




      It looks like scp does have a problem with large numbers of small files. With a single large file though, both can easily saturate a 100 mbps lan.
      – psusi
      Jun 1 '12 at 14:32




      It looks like scp does have a problem with large numbers of small files. With a single large file though, both can easily saturate a 100 mbps lan.
      – psusi
      Jun 1 '12 at 14:32




      1




      1




      Interesting. rsync should have more overhead, since it needs to check in advance if the target(s) exists.
      – Nils
      Jun 10 '12 at 20:56




      Interesting. rsync should have more overhead, since it needs to check in advance if the target(s) exists.
      – Nils
      Jun 10 '12 at 20:56




      26




      26




      I don't see how this answers the question
      – ericn
      May 15 '15 at 2:11




      I don't see how this answers the question
      – ericn
      May 15 '15 at 2:11












      up vote
      40
      down vote













      scp provides a cp like method to copy files from one machine to a remote machine over a secure SSH connection.



      rsync allows you to syncronise remote folders.



      They are different programs and both have their uses. scp is always secure, whereas rsync must travel over SSH to be secure.






      share|improve this answer
















      • 6




        Also, pretty sure rsync has to be installed on the other end.
        – ckhan
        May 31 '12 at 7:59






      • 3




        @ckhan, no it can copy without having anything installed in the other side, it'll just be less efficient.
        – mikebloch
        May 31 '12 at 8:40






      • 2




        I like scp's simplicity.
        – Alex Chamberlain
        May 31 '12 at 9:29






      • 2




        @mikebloch How do you do that? Is it a new feature? Just tried this using version 3.0.9. and it complained it couldn't find rsync on the remote.
        – Alexios
        May 31 '12 at 10:00






      • 1




        @mikebloch, it has to be installed on the server to do the checksum computations, which can add a lot of cpu load to the server. This is why most large sites don't support it, and why zsync was created as an alternative.
        – psusi
        May 31 '12 at 22:17















      up vote
      40
      down vote













      scp provides a cp like method to copy files from one machine to a remote machine over a secure SSH connection.



      rsync allows you to syncronise remote folders.



      They are different programs and both have their uses. scp is always secure, whereas rsync must travel over SSH to be secure.






      share|improve this answer
















      • 6




        Also, pretty sure rsync has to be installed on the other end.
        – ckhan
        May 31 '12 at 7:59






      • 3




        @ckhan, no it can copy without having anything installed in the other side, it'll just be less efficient.
        – mikebloch
        May 31 '12 at 8:40






      • 2




        I like scp's simplicity.
        – Alex Chamberlain
        May 31 '12 at 9:29






      • 2




        @mikebloch How do you do that? Is it a new feature? Just tried this using version 3.0.9. and it complained it couldn't find rsync on the remote.
        – Alexios
        May 31 '12 at 10:00






      • 1




        @mikebloch, it has to be installed on the server to do the checksum computations, which can add a lot of cpu load to the server. This is why most large sites don't support it, and why zsync was created as an alternative.
        – psusi
        May 31 '12 at 22:17













      up vote
      40
      down vote










      up vote
      40
      down vote









      scp provides a cp like method to copy files from one machine to a remote machine over a secure SSH connection.



      rsync allows you to syncronise remote folders.



      They are different programs and both have their uses. scp is always secure, whereas rsync must travel over SSH to be secure.






      share|improve this answer












      scp provides a cp like method to copy files from one machine to a remote machine over a secure SSH connection.



      rsync allows you to syncronise remote folders.



      They are different programs and both have their uses. scp is always secure, whereas rsync must travel over SSH to be secure.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered May 31 '12 at 7:25









      Alex Chamberlain

      1,40221323




      1,40221323







      • 6




        Also, pretty sure rsync has to be installed on the other end.
        – ckhan
        May 31 '12 at 7:59






      • 3




        @ckhan, no it can copy without having anything installed in the other side, it'll just be less efficient.
        – mikebloch
        May 31 '12 at 8:40






      • 2




        I like scp's simplicity.
        – Alex Chamberlain
        May 31 '12 at 9:29






      • 2




        @mikebloch How do you do that? Is it a new feature? Just tried this using version 3.0.9. and it complained it couldn't find rsync on the remote.
        – Alexios
        May 31 '12 at 10:00






      • 1




        @mikebloch, it has to be installed on the server to do the checksum computations, which can add a lot of cpu load to the server. This is why most large sites don't support it, and why zsync was created as an alternative.
        – psusi
        May 31 '12 at 22:17













      • 6




        Also, pretty sure rsync has to be installed on the other end.
        – ckhan
        May 31 '12 at 7:59






      • 3




        @ckhan, no it can copy without having anything installed in the other side, it'll just be less efficient.
        – mikebloch
        May 31 '12 at 8:40






      • 2




        I like scp's simplicity.
        – Alex Chamberlain
        May 31 '12 at 9:29






      • 2




        @mikebloch How do you do that? Is it a new feature? Just tried this using version 3.0.9. and it complained it couldn't find rsync on the remote.
        – Alexios
        May 31 '12 at 10:00






      • 1




        @mikebloch, it has to be installed on the server to do the checksum computations, which can add a lot of cpu load to the server. This is why most large sites don't support it, and why zsync was created as an alternative.
        – psusi
        May 31 '12 at 22:17








      6




      6




      Also, pretty sure rsync has to be installed on the other end.
      – ckhan
      May 31 '12 at 7:59




      Also, pretty sure rsync has to be installed on the other end.
      – ckhan
      May 31 '12 at 7:59




      3




      3




      @ckhan, no it can copy without having anything installed in the other side, it'll just be less efficient.
      – mikebloch
      May 31 '12 at 8:40




      @ckhan, no it can copy without having anything installed in the other side, it'll just be less efficient.
      – mikebloch
      May 31 '12 at 8:40




      2




      2




      I like scp's simplicity.
      – Alex Chamberlain
      May 31 '12 at 9:29




      I like scp's simplicity.
      – Alex Chamberlain
      May 31 '12 at 9:29




      2




      2




      @mikebloch How do you do that? Is it a new feature? Just tried this using version 3.0.9. and it complained it couldn't find rsync on the remote.
      – Alexios
      May 31 '12 at 10:00




      @mikebloch How do you do that? Is it a new feature? Just tried this using version 3.0.9. and it complained it couldn't find rsync on the remote.
      – Alexios
      May 31 '12 at 10:00




      1




      1




      @mikebloch, it has to be installed on the server to do the checksum computations, which can add a lot of cpu load to the server. This is why most large sites don't support it, and why zsync was created as an alternative.
      – psusi
      May 31 '12 at 22:17





      @mikebloch, it has to be installed on the server to do the checksum computations, which can add a lot of cpu load to the server. This is why most large sites don't support it, and why zsync was created as an alternative.
      – psusi
      May 31 '12 at 22:17











      up vote
      15
      down vote













      One of the main things (which I think no one mentioned) is that if you are transferring large amounts of data or files, and if the transfer is disconnected before completion for any reason, rsync will pick it up where it left off. Whereas scp doesn't.



      I use scp if I want to transfer one or couple of files or directories. I go to rsync for multi GB size data.






      share|improve this answer
















      • 2




        Might be worth adding that the --partial flag is useful when transferring large files. rsync will pick up where it left off within the file rather than starting that file again.
        – Flup
        Jul 26 '13 at 15:28










      • As @Flup mentioned rsync won't leave anyt file-in-transit around for you to resume unless you use the --partial option. These files are by default hidden in the target directory. You can use --partial-dir to put all of these files in a single directory.
        – Lester Cheung
        Mar 1 '16 at 10:56










      • Well, rsync -vP username@host:/path/to/file . will do this too. See this answer on Stackoverflow
        – Devesh Saini
        Aug 12 '16 at 18:20















      up vote
      15
      down vote













      One of the main things (which I think no one mentioned) is that if you are transferring large amounts of data or files, and if the transfer is disconnected before completion for any reason, rsync will pick it up where it left off. Whereas scp doesn't.



      I use scp if I want to transfer one or couple of files or directories. I go to rsync for multi GB size data.






      share|improve this answer
















      • 2




        Might be worth adding that the --partial flag is useful when transferring large files. rsync will pick up where it left off within the file rather than starting that file again.
        – Flup
        Jul 26 '13 at 15:28










      • As @Flup mentioned rsync won't leave anyt file-in-transit around for you to resume unless you use the --partial option. These files are by default hidden in the target directory. You can use --partial-dir to put all of these files in a single directory.
        – Lester Cheung
        Mar 1 '16 at 10:56










      • Well, rsync -vP username@host:/path/to/file . will do this too. See this answer on Stackoverflow
        – Devesh Saini
        Aug 12 '16 at 18:20













      up vote
      15
      down vote










      up vote
      15
      down vote









      One of the main things (which I think no one mentioned) is that if you are transferring large amounts of data or files, and if the transfer is disconnected before completion for any reason, rsync will pick it up where it left off. Whereas scp doesn't.



      I use scp if I want to transfer one or couple of files or directories. I go to rsync for multi GB size data.






      share|improve this answer












      One of the main things (which I think no one mentioned) is that if you are transferring large amounts of data or files, and if the transfer is disconnected before completion for any reason, rsync will pick it up where it left off. Whereas scp doesn't.



      I use scp if I want to transfer one or couple of files or directories. I go to rsync for multi GB size data.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Jul 26 '13 at 14:49









      ravi

      15112




      15112







      • 2




        Might be worth adding that the --partial flag is useful when transferring large files. rsync will pick up where it left off within the file rather than starting that file again.
        – Flup
        Jul 26 '13 at 15:28










      • As @Flup mentioned rsync won't leave anyt file-in-transit around for you to resume unless you use the --partial option. These files are by default hidden in the target directory. You can use --partial-dir to put all of these files in a single directory.
        – Lester Cheung
        Mar 1 '16 at 10:56










      • Well, rsync -vP username@host:/path/to/file . will do this too. See this answer on Stackoverflow
        – Devesh Saini
        Aug 12 '16 at 18:20













      • 2




        Might be worth adding that the --partial flag is useful when transferring large files. rsync will pick up where it left off within the file rather than starting that file again.
        – Flup
        Jul 26 '13 at 15:28










      • As @Flup mentioned rsync won't leave anyt file-in-transit around for you to resume unless you use the --partial option. These files are by default hidden in the target directory. You can use --partial-dir to put all of these files in a single directory.
        – Lester Cheung
        Mar 1 '16 at 10:56










      • Well, rsync -vP username@host:/path/to/file . will do this too. See this answer on Stackoverflow
        – Devesh Saini
        Aug 12 '16 at 18:20








      2




      2




      Might be worth adding that the --partial flag is useful when transferring large files. rsync will pick up where it left off within the file rather than starting that file again.
      – Flup
      Jul 26 '13 at 15:28




      Might be worth adding that the --partial flag is useful when transferring large files. rsync will pick up where it left off within the file rather than starting that file again.
      – Flup
      Jul 26 '13 at 15:28












      As @Flup mentioned rsync won't leave anyt file-in-transit around for you to resume unless you use the --partial option. These files are by default hidden in the target directory. You can use --partial-dir to put all of these files in a single directory.
      – Lester Cheung
      Mar 1 '16 at 10:56




      As @Flup mentioned rsync won't leave anyt file-in-transit around for you to resume unless you use the --partial option. These files are by default hidden in the target directory. You can use --partial-dir to put all of these files in a single directory.
      – Lester Cheung
      Mar 1 '16 at 10:56












      Well, rsync -vP username@host:/path/to/file . will do this too. See this answer on Stackoverflow
      – Devesh Saini
      Aug 12 '16 at 18:20





      Well, rsync -vP username@host:/path/to/file . will do this too. See this answer on Stackoverflow
      – Devesh Saini
      Aug 12 '16 at 18:20











      up vote
      5
      down vote













      rsync: Transfers deltas(using its Delta Transfer Algorithm) between:




      1. local and remote hosts

      scp: Transfers whole files between:




      1. local and remote hosts


      2. remote and remote hosts

      Summary: scp can transfer files between two remote hosts while rsync doesn't support it.






      share|improve this answer






















      • rsync can transfer files between two remote hosts. In fact, rsync a host:b is equivalent to scp a host:b.
        – brandizzi
        Feb 19 '17 at 13:34











      • That's what I wrote, rsync can transfer deltas between local and remote hosts but scp is not limited to just that, it can transfer deltas between two remote hosts. @brandizzi
        – Devesh Saini
        Feb 19 '17 at 14:08














      up vote
      5
      down vote













      rsync: Transfers deltas(using its Delta Transfer Algorithm) between:




      1. local and remote hosts

      scp: Transfers whole files between:




      1. local and remote hosts


      2. remote and remote hosts

      Summary: scp can transfer files between two remote hosts while rsync doesn't support it.






      share|improve this answer






















      • rsync can transfer files between two remote hosts. In fact, rsync a host:b is equivalent to scp a host:b.
        – brandizzi
        Feb 19 '17 at 13:34











      • That's what I wrote, rsync can transfer deltas between local and remote hosts but scp is not limited to just that, it can transfer deltas between two remote hosts. @brandizzi
        – Devesh Saini
        Feb 19 '17 at 14:08












      up vote
      5
      down vote










      up vote
      5
      down vote









      rsync: Transfers deltas(using its Delta Transfer Algorithm) between:




      1. local and remote hosts

      scp: Transfers whole files between:




      1. local and remote hosts


      2. remote and remote hosts

      Summary: scp can transfer files between two remote hosts while rsync doesn't support it.






      share|improve this answer














      rsync: Transfers deltas(using its Delta Transfer Algorithm) between:




      1. local and remote hosts

      scp: Transfers whole files between:




      1. local and remote hosts


      2. remote and remote hosts

      Summary: scp can transfer files between two remote hosts while rsync doesn't support it.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Aug 13 '16 at 14:03

























      answered Aug 12 '16 at 18:39









      Devesh Saini

      15913




      15913











      • rsync can transfer files between two remote hosts. In fact, rsync a host:b is equivalent to scp a host:b.
        – brandizzi
        Feb 19 '17 at 13:34











      • That's what I wrote, rsync can transfer deltas between local and remote hosts but scp is not limited to just that, it can transfer deltas between two remote hosts. @brandizzi
        – Devesh Saini
        Feb 19 '17 at 14:08
















      • rsync can transfer files between two remote hosts. In fact, rsync a host:b is equivalent to scp a host:b.
        – brandizzi
        Feb 19 '17 at 13:34











      • That's what I wrote, rsync can transfer deltas between local and remote hosts but scp is not limited to just that, it can transfer deltas between two remote hosts. @brandizzi
        – Devesh Saini
        Feb 19 '17 at 14:08















      rsync can transfer files between two remote hosts. In fact, rsync a host:b is equivalent to scp a host:b.
      – brandizzi
      Feb 19 '17 at 13:34





      rsync can transfer files between two remote hosts. In fact, rsync a host:b is equivalent to scp a host:b.
      – brandizzi
      Feb 19 '17 at 13:34













      That's what I wrote, rsync can transfer deltas between local and remote hosts but scp is not limited to just that, it can transfer deltas between two remote hosts. @brandizzi
      – Devesh Saini
      Feb 19 '17 at 14:08




      That's what I wrote, rsync can transfer deltas between local and remote hosts but scp is not limited to just that, it can transfer deltas between two remote hosts. @brandizzi
      – Devesh Saini
      Feb 19 '17 at 14:08










      up vote
      2
      down vote













      User Chris at Webhosting Talk writes:




      rsync compares the files at each end and transfers only the changed
      parts of changed files. When you transfer files the first timeo it
      behaves pretty much like scp, but for a second transfer, where most
      files are unchanged, it will push a lot less data than scp. It's also
      a convenient way to restart failed transfers - you just reissue the
      same command and it will pick up where it left off the time before,
      whereas scp will start again from scratch.







      share|improve this answer


























        up vote
        2
        down vote













        User Chris at Webhosting Talk writes:




        rsync compares the files at each end and transfers only the changed
        parts of changed files. When you transfer files the first timeo it
        behaves pretty much like scp, but for a second transfer, where most
        files are unchanged, it will push a lot less data than scp. It's also
        a convenient way to restart failed transfers - you just reissue the
        same command and it will pick up where it left off the time before,
        whereas scp will start again from scratch.







        share|improve this answer
























          up vote
          2
          down vote










          up vote
          2
          down vote









          User Chris at Webhosting Talk writes:




          rsync compares the files at each end and transfers only the changed
          parts of changed files. When you transfer files the first timeo it
          behaves pretty much like scp, but for a second transfer, where most
          files are unchanged, it will push a lot less data than scp. It's also
          a convenient way to restart failed transfers - you just reissue the
          same command and it will pick up where it left off the time before,
          whereas scp will start again from scratch.







          share|improve this answer














          User Chris at Webhosting Talk writes:




          rsync compares the files at each end and transfers only the changed
          parts of changed files. When you transfer files the first timeo it
          behaves pretty much like scp, but for a second transfer, where most
          files are unchanged, it will push a lot less data than scp. It's also
          a convenient way to restart failed transfers - you just reissue the
          same command and it will pick up where it left off the time before,
          whereas scp will start again from scratch.








          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jul 5 '16 at 10:18









          Toby Speight

          5,19311031




          5,19311031










          answered Jul 5 '16 at 9:50









          nkint

          21019




          21019




















              up vote
              0
              down vote













              scp is simpler to use as it takes less arguments. I catch myselv using scp instead of rsync if I only transfer a single file. Propably I am just to lazy to define an alias to rsync... ;-)






              share|improve this answer
















              • 1




                Hmmm, why is it so? rsync a host:b is equivalent to scp a host:b, same number of arguments.
                – mikebloch
                Apr 9 '13 at 5:40






              • 1




                @mikebloch Two letters more to type... ;-) In the past I had to supply "-e ssh -a" to get the proper result. Now that "-e ssh" is default this might be a different game.
                – Nils
                Apr 9 '13 at 14:44














              up vote
              0
              down vote













              scp is simpler to use as it takes less arguments. I catch myselv using scp instead of rsync if I only transfer a single file. Propably I am just to lazy to define an alias to rsync... ;-)






              share|improve this answer
















              • 1




                Hmmm, why is it so? rsync a host:b is equivalent to scp a host:b, same number of arguments.
                – mikebloch
                Apr 9 '13 at 5:40






              • 1




                @mikebloch Two letters more to type... ;-) In the past I had to supply "-e ssh -a" to get the proper result. Now that "-e ssh" is default this might be a different game.
                – Nils
                Apr 9 '13 at 14:44












              up vote
              0
              down vote










              up vote
              0
              down vote









              scp is simpler to use as it takes less arguments. I catch myselv using scp instead of rsync if I only transfer a single file. Propably I am just to lazy to define an alias to rsync... ;-)






              share|improve this answer












              scp is simpler to use as it takes less arguments. I catch myselv using scp instead of rsync if I only transfer a single file. Propably I am just to lazy to define an alias to rsync... ;-)







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Jun 10 '12 at 21:02









              Nils

              12.3k63669




              12.3k63669







              • 1




                Hmmm, why is it so? rsync a host:b is equivalent to scp a host:b, same number of arguments.
                – mikebloch
                Apr 9 '13 at 5:40






              • 1




                @mikebloch Two letters more to type... ;-) In the past I had to supply "-e ssh -a" to get the proper result. Now that "-e ssh" is default this might be a different game.
                – Nils
                Apr 9 '13 at 14:44












              • 1




                Hmmm, why is it so? rsync a host:b is equivalent to scp a host:b, same number of arguments.
                – mikebloch
                Apr 9 '13 at 5:40






              • 1




                @mikebloch Two letters more to type... ;-) In the past I had to supply "-e ssh -a" to get the proper result. Now that "-e ssh" is default this might be a different game.
                – Nils
                Apr 9 '13 at 14:44







              1




              1




              Hmmm, why is it so? rsync a host:b is equivalent to scp a host:b, same number of arguments.
              – mikebloch
              Apr 9 '13 at 5:40




              Hmmm, why is it so? rsync a host:b is equivalent to scp a host:b, same number of arguments.
              – mikebloch
              Apr 9 '13 at 5:40




              1




              1




              @mikebloch Two letters more to type... ;-) In the past I had to supply "-e ssh -a" to get the proper result. Now that "-e ssh" is default this might be a different game.
              – Nils
              Apr 9 '13 at 14:44




              @mikebloch Two letters more to type... ;-) In the past I had to supply "-e ssh -a" to get the proper result. Now that "-e ssh" is default this might be a different game.
              – Nils
              Apr 9 '13 at 14:44










              up vote
              0
              down vote













              Credits to @tomrunia at https://gist.github.com/KartikTalwar/4393116



              rsync -aHAXxv --numeric-ids --delete --progress 
              -e "ssh -T -c aes128-gcm@openssh.com -o Compression=no -x"
              [source_directory] user@hostname:[target_directory]/


              Pay attention to --delete, don't use it if you want to keep extraneous files in dest dirs






              share|improve this answer


























                up vote
                0
                down vote













                Credits to @tomrunia at https://gist.github.com/KartikTalwar/4393116



                rsync -aHAXxv --numeric-ids --delete --progress 
                -e "ssh -T -c aes128-gcm@openssh.com -o Compression=no -x"
                [source_directory] user@hostname:[target_directory]/


                Pay attention to --delete, don't use it if you want to keep extraneous files in dest dirs






                share|improve this answer
























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  Credits to @tomrunia at https://gist.github.com/KartikTalwar/4393116



                  rsync -aHAXxv --numeric-ids --delete --progress 
                  -e "ssh -T -c aes128-gcm@openssh.com -o Compression=no -x"
                  [source_directory] user@hostname:[target_directory]/


                  Pay attention to --delete, don't use it if you want to keep extraneous files in dest dirs






                  share|improve this answer














                  Credits to @tomrunia at https://gist.github.com/KartikTalwar/4393116



                  rsync -aHAXxv --numeric-ids --delete --progress 
                  -e "ssh -T -c aes128-gcm@openssh.com -o Compression=no -x"
                  [source_directory] user@hostname:[target_directory]/


                  Pay attention to --delete, don't use it if you want to keep extraneous files in dest dirs







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 12 mins ago









                  Community♦

                  1




                  1










                  answered Feb 21 at 9:35









                  Jorj

                  1011




                  1011



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f39718%2fis-there-ever-a-reason-to-use-scp-instead-of-rsync%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Popular posts from this blog

                      How to check contact read email or not when send email to Individual?

                      Bahrain

                      Postfix configuration issue with fips on centos 7; mailgun relay