How safe is rsync –remove-source-files

rsync

I want to move some files using rsync, but it's vital that the files are intact at the destination before removing the source files. The thing is, I can't find any information telling me how rsync decides that a file has been transferred correctly: I'll need it to be properly checksummed.
Anyone know how rsync does it?

Best Answer

You need to pass the --checksum to ensure files that have the same size & times on source and destination are not skipped. Then, as per Wikipedia:

The recipient splits its copy of the file into fixed-size non-overlapping chunks and computes two checksums for each chunk: the MD4 hash, and a weaker 'rolling checksum'. (Version 30 of the protocol, released with rsync version 3.0.0, now uses MD5 hashes rather than MD4.[14]) It sends these checksums to the sender.