News for hackers. Stuff that matters.
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).