4 ms·
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 soo
by pengaru 6y ago
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.
- ekianjo 6y agoInteresting, is there any catch in doing that or does it work in most use cases?
- ur-whale 6y agovery different behavior when it comes to interpreting trailing slashes in directory names.
- gjvc 6y agorsync-pro-tip: use a trailing slash on both the source/ and the target/ and you'll never go wrong
- kzrdude 6y agoWhat goes wrong if I don't do that?
- masklinn 6y agoThe 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).
- jjice 6y agoI 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
- gjvc 6y agoGood 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/
- perbu 6y agorsync 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.
- Filligree 6y agoI 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.
- pnutjam 6y agoIt can be slow if you're transferring a large number of files since it does an index before it starts.
- hated 6y agoSince 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.
- gizzlon 6y agoThe other side must have rsync installed as well (?)
- stilisstuk 6y agoCorrect
- kevinhq 6y agosame question from me. Since, it's hard to part with scp command
- teknopaul 6y agoIt works if rsync is installed. scp is more common.