Hacker News new | ask | show | jobs
by thewickedaxe 889 days ago
Rsync's name might be a little misleading. It doesn't attempt to sync the directories unless you ask it to, aka just copy. However I remember studies from a while ago showing that rsync actually performs worse than cp/scp under certain circumstances. May that's something you can try to address
1 comments

> Rsync's name might be a little misleading. It doesn't attempt to sync the directories unless you ask it to, aka just copy.

rsync will "just copy" if you point it at an empty destination. Otherwise it will try to sync.

  rsync source/ dest/
rsync has options to preserve ownership, modification date/time, etc. similar to cp's -a (archive) mode. Most important to me and I think a lot of rsync users: it can restart failed transfers. That's more important when transferring over a network but it works on local copies too.

> However I remember studies from a while ago showing that rsync actually performs worse than cp/scp under certain circumstances.

Maybe you're thinking of these threads:

https://serverfault.com/questions/43014/copying-a-large-dire...

https://stackoverflow.com/questions/6339287/copy-or-rsync-co...

Not really seeeing significant performance difference but maybe you can find data. In the case of maintaining a copy of a directory of files that gets added to and changed that's an exact description of what rsync does, and it has years of optimizations for exactly that.

scp, on the other hand, is both slower than rsync for non-trivial cases (more than a few files), and less secure. "The scp protocol is outdated, inflexible and not readily fixed. We recommend the use of more modern protocols like sftp and rsync for file transfer instead." (from OpenSSH 8.0 release notes, 2019-04-17). scp was informally deprecated in favor of rsync a long time ago.

For what it's worth, as of OpenSSH 9.0 the scp command actually just became a client for sftp commands: https://www.openssh.com/txt/release-9.0