cp or rsync, is cp really worth it?

cp is a part of coreutils, therefore it is present everywhere. Furthermore, it primarily was designed to copy files inside one computer.

rsync isn't a part of coreutils, it isn't present even on the default environment. Moreover it was primarily designed to transfer files over network. Also rsync has more dependencies comparing to coreutils, however this difference doesn't make a big sense.

PS: By the way, the CPU usage is still matters on the embedded systems.


The main reason you don't want to use rsync for every copy operation, is becasue rsync has calulating overhead. Before data transfer actually starts, rsync scans all the files. Then before each file, a comparison is made. This overhead is not insignificant, even with the fast CPU's available in 2012. I do these type of transfers all the time, and on pretty decent sized servers, once you start dealing with gigs of data the overhead can be time consuming.

I'm not saying don't use rsync, not at all, use rsync anytime you can save some transfer time. Just don't use rsync when cp could accomplish the same thing.

What I usually do, first bring over the data using regular copy methods. Then rsync for subsequent changes, which is when those diffs can be leveraged.


I would expect cp to use less CPU when copying locally because it doesn't use diffs whereas rsync can reduce writes when using diffs. Compression should be avoided locally because you have to read and write the whole file/diff anyway and it requires additional computations.