Re:Deprecating scp
by pengaru on Friday November 06, 2020 @04:06AM
(#25006196)
I've been living with this for nearly a year now:
Since my decades-old scp habit isn't changing anytime soon, and it hasn't shown to be a problem yet - with the added bonus of resuming partial copies.
[ Parent
| on HN ]
Interesting, is there any catch in doing that or does it work in most use cases?
very different behavior when it comes to interpreting trailing slashes in directory names.
rsync-pro-tip: use a trailing slash on both the source/ and the target/ and you'll never go wrong
What goes wrong if I don't do that?
I believe if you don't use a slash at the end of the source directory, it will copy the _directory_, not just its contents.
rsync code remote:/
I believe that results in remote:/code/app.js rsync code/ remote:/
I believe that results in remote:/app.jsGood explanation -- at the risk of mindlessly repeating you, my reason for the "always use trailing/ slashes/" suggestion is that the behaviour in that case has (for me at least) always been the scenario desired most often:
rsync /some/where/local/ host:/another/place/remote/
The contents of local/ go into remote/The trailing slash on the source expresses that you want to copy the contents of the source in the dest, otherwise you’ll copy the source itself (creating a subdirectory).
The other side must have rsync installed as well (?)
Re:Deprecating scp
by stilisstuk on Friday November 06, 2020 @05:04AM
(#25006485)
Correct
rsync used to be quite a bit slower at some point. rsync optimizes for network traffic and quite often network capacity is abundant. not sure how much of an issue this is with today's solid state drives and fast CPUs.
OTOH there where issues with scp having a fixed tcp window size of 4k (not sure if this is still the case) which would slow down copies on networks with some latency.
sftp have none of these issues. i prefer sftp for most tasks.
I can't speak for twenty years ago, but rsync always gives me line speed for server-to-server copies in my workshop.
The CPU use might be slightly higher. I don't think it's a problem anymore.
It can be slow if you're transferring a large number of files since it does an index before it starts.
Since it's release in the year 2008, rsync 3.0.0, the recursive algorithm used is now an incremental scan that uses much less memory than before and begins the transfer after the scanning of the first few directories have been completed.
same question from me. Since, it's hard to part with scp command