News for hackers. Stuff that matters.
Re:Deprecating scp by pengaru on Friday November 06, 2020 @04:06AM (#25006196)
I've been living with this for nearly a year now:

  alias scp='rsync --verbose --progress --partial'
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.
Re:Deprecating scp by ekianjo on Friday November 06, 2020 @04:13AM (#25006234)
Interesting, is there any catch in doing that or does it work in most use cases?
Re:Deprecating scp by ur-whale on Friday November 06, 2020 @04:29AM (#25006331)
very different behavior when it comes to interpreting trailing slashes in directory names.
Re:Deprecating scp by gjvc on Friday November 06, 2020 @05:10AM (#25006505)
rsync-pro-tip: use a trailing slash on both the source/ and the target/ and you'll never go wrong
Re:Deprecating scp by kzrdude on Friday November 06, 2020 @08:29AM (#25007463)
What goes wrong if I don't do that?
Re:Deprecating scp by jjice on Friday November 06, 2020 @08:59AM (#25007619)
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.js
Re:Deprecating scp by gjvc on Friday November 06, 2020 @10:24AM (#25008221)
Good 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/
Re:Deprecating scp by masklinn on Friday November 06, 2020 @08:56AM (#25007598)
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).
Re:Deprecating scp by gizzlon on Friday November 06, 2020 @04:30AM (#25006337)
The other side must have rsync installed as well (?)
Re:Deprecating scp by stilisstuk on Friday November 06, 2020 @05:04AM (#25006485)
Correct
Re:Deprecating scp by perbu on Friday November 06, 2020 @04:29AM (#25006333)
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.

Re:Deprecating scp by Filligree on Friday November 06, 2020 @05:29AM (#25006587)
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.

Re:Deprecating scp by pnutjam on Friday November 06, 2020 @09:16AM (#25007703)
It can be slow if you're transferring a large number of files since it does an index before it starts.
Re:Deprecating scp by hated on Friday November 06, 2020 @10:17AM (#25008173)
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.
Re:Deprecating scp by kevinhq on Friday November 06, 2020 @04:19AM (#25006263)
same question from me. Since, it's hard to part with scp command
Re:Deprecating scp by teknopaul on Friday November 06, 2020 @01:09PM (#25009725)
It works if rsync is installed. scp is more common.