Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • That makes a lot of sense, +1. I take it then that the long pause after reaching 100% is the time it takes to transmit the last data in the buffer? Also, why don't I see this behavior when copying between high-end servers? Commented Nov 15, 2013 at 1:19
  • 1
    @terdon: The behaviour is still there when copying between any two servers, it just might be less noticeable depending on the performance characteristics of the network between them. Commented Nov 15, 2013 at 1:51
  • @GregHewgill: +1, thanks for that explanation. So you mean that when scp is "stuck" at 100% it's because 100% of the data has already been sent to the OS? And then it begs another question: how does scp know that it's not done yet? I mean, if scp believes that 100% of the transfer has left, how comes it knows that the file ain't transfered fully yet? And if scp knows that it's not fully transferred, why can't it display the "correct" percentage !? (as a sidenote in a way it'd be "better" if it showed 99% instead of 100%: it would be a little less confusing) Commented Nov 15, 2013 at 2:48
  • @CedricMartin: scp asks the OS to report back when 100% of the data has been successfully received by the other end. If scp completed earlier, then there could be a transmission problem that wouldn't be detected by scp (because it already finished). scp knows that it's not done yet, but the OS doesn't make the information about how much has been received by the other end available to applications (that is, that information is not part of the socket interface). Commented Nov 15, 2013 at 2:57
  • @GregHewgill ioctl with SIOCOUTQ should get the amount of buffered data. At least according to the docs in tcp(7), haven't actually tried it. But scp can't do that, since ssh is actually handling the socket. Commented Mar 30, 2015 at 14:35