On 24 February 2013 18:21, Chris Walker cdw_alug@the-walker-household.co.uk wrote:
In the past I would simply have cp'd everything off but having watched the recent discussions on rsync, it has prompted me to ask this question here.
If what you're looking for is a simple (accurate) copy of source to destination then absolutely rsync is the way to go. Unlike cp, you can re-run it to pick up changes that happened after your last run. That said, for the initial copy there's no real difference between cp and rsync (different methods but same result). Using whichever gives you the most confidence is what matters to some extent - after all, an exact copy is an exact copy! If you have plenty of time, then you can use tools like md5sum to confirm that both drives have the exact same data (although for something like this I would "trust" rsync and not worry about a subsequent checksum).
Bottom line: cp and rsync will reliably copy from A to B, with permissions and other attributes intact (with the right commandline options of-course). rsync will compare A and B and only copy changes, making the process vastly faster on subsequent runs; rsync can also handle A or B being remote (ie over a network), and will compress the traffic between A&B if required to reduce bandwidth (again with the right options set). Furthermore (with the right options set), rsync can also delete files from B that have been deleted from A to ensure A & B completely match (cp will only add/replace but not remove files). All of this means that for any bulk copy operations, rsync is way more flexible than cp, but because of this it can be harder to use (although in simple cases the two are pretty similar: compare "cp -a ~/A ~/B" vs "rsync -a ~/A ~/B" as two ways to copy A to B). The key is to get the options right in both cases, and because cp can do less there are fewer options to have to worry about!