How to verify transmitted data
I have already passed some data from server A to server B through the rsync command. Do I have any commands to verify the data from both servers and determine if they are correct?
To check if the transmition is correct.
- Use tools such as md5sum or sha256sum) compare the checksums of source and destination directory
- find /path/to/source -type f -exec md5sum {} + > source_checksums.md5
- find /path/to/destination -type f -exec md5sum {} + > destination_checksums.md5
- diff source_checksums.md5 destination_checksums.md5
- It should be correct if there is no output.
Or compare the directories' structure by diff -rq source/ destination/.
thanks
Also you could just re-run your rsync command (with -c switch if you want total verification).
Of course if anything is transferred on the 2nd run, you need to do a 3rd, ... n-th run until there is nothing transferred :P
It would actually be good though if rsync added a switch allowing to re-use the checksums it sends for verifying transfers, to also verify the files written.