3 ms·
Basic syntax, "options source destination", is similar enough. scp file.bin server: rsync file.bin server: The obvious difference is that rsync defaults
by xorcist 6y ago
Basic syntax, "options source destination", is similar enough.
scp file.bin server:
rsync file.bin server:
The obvious difference is that rsync defaults to a more unixy no-news-is-good-news output, it will only output errors. To show interactive progress use
rsync -vP file.bin server:
Use "-e" to set ssh options, just like with scp. Use "-r" to transfer whole directories, just like with scp. But you're likely to use "-a" with rsync instead which is recursive preserving all attributes and timestamps.
Another difference is that rsync will resume transfers, which scp can't. It can do sparse transfers reasonably well. It also has more sane security defaults And, as implied by the name, update a remote directory including deletions.
Check out "man rsync" for the full story. It's not long after your shell and editor in daily usefulness.
- stinos 6y agoUse "-e" to set ssh options, just like with scp On my rsync -e sets the executable, and my scp doesn't have -e but -o. Even then it's a bit of a stretch (or I'm missing something); e.g. for the ssh option I use mst of the time, a non-default port: scp -P 4222 is equivalent to scp -o"Port=4222" is equivalent to rsync -e "ssh -p 4222" Again, this is just what I use after having to look it up at one point so I might be missing something, but it's not like the arguments translate one to one?
- xorcist 6y agoGood catch! I was too sure to check. scp doesn't take -e.