Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How does rsync differ with scp in terms of transfer speed, maximum transfer size etc ? Or they very similar ? And in what type of scenarios do we need to use these commands ?

share|improve this question

1 Answer 1

There are two main differences (that I can think of) between rsync and scp.

Before a file is transferred rsync takes the checksums of the file (MD5 and adler-32 I believe) and sends them to the receiver. After a file is transferred the receiver verifies the data integrity using those checksums. scp does not have such mechanism. scp uses ssh to transfer the data and although ssh uses checksums on the packet level that's a different story (I believe the default rsync behaviour is also to use ssh for transfers).

Another difference is what happens during a transfer retry. While scp will ignore any partially transferred set of files and overwrite them on the receiving end, rsync is more clever than that. Rsync will check the destination for any files present and if their signature matches that of the files on the sender side it will not retransmit these files. It might be possible to overwrite this behaviour but I am not entirely sure.

cheers, n

share|improve this answer
    
I think Rsync sometimes tries to be smarter than it should; if you have a large file...a 200 meg video, for example...and you edit maybe 5 meg of it, rsync will (in a network copy) compare and transfer just that altered 5 meg. BUT if I did it with a mounted share, as in mounting a windows share and doing an rsync from directory A to directory B, rsync will copy the entire 200 meg. I was later told that only if it is transferring over the network will it do the differential copy, which speeds up the transfer job. –  Bart Silverstrim Oct 25 '10 at 14:33
    
(in other words because I mounted the share in the filesystem, it treats it like a local drive-to-drive or volume-to-volume sync rather than machine-to-networked-machine sync) –  Bart Silverstrim Oct 25 '10 at 14:34
3  
@Bart: You can use the --no-whole-file option to force rsync to use the delta-transfer algorithm on local-to-local copies. –  Steven Monday Oct 25 '10 at 14:56
1  
@Steven-Thanks for that switch info. It's still something to keep in mind when assuming default behavior, though. That was the part that catches me off guard at times! –  Bart Silverstrim Oct 25 '10 at 14:58
1  
Another difference depends on how you use rsync. If you use rsync to communicate with a system running an rsync daemon there is no overhead for encryption. Everything will be sent in the clear. –  Zoredache Oct 25 '10 at 16:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.