Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have uploaded an ISO file to my server via rsync. How can I verify it is correct (Not corrupted or something). This is just in case rsync had an problem.

share|improve this question
    
Luis - do a man rsync and search for "checksum"... if i've interpreted that correctly, rsync automatically does a checksum for files sent... –  fossfreedom Dec 24 '11 at 20:52
    
@fossfreedom - Yes it does but just to double check. Actually it is one of the main reasons I use rsync but you know... just in case all hell break loose and I see a pig or two flying then I want a double check. –  Luis Alvarado Dec 24 '11 at 21:15
add comment

1 Answer 1

up vote 2 down vote accepted

One way to do this would be to use md5sum to compute a message digest before sending the file, then do it again on the receiving end, and make sure the hashes match.

$ md5sum foo.bar.iso
d41d8cd98f00b204e9800998ecf8427e  foo.bar

Alternately, with an eye towards doing this in a shell script, you could redirect the output of the initial md5sum into a file, send the original file and the file with the message digest to the remote host, and run md5sum on the file with the message digest. You'll often see such files listed on FTP sites along with Linux distribution disk images.

$ md5sum foo.bar.iso > md5sum.txt
$ rsync foo.bar.iso remotehost:/home/user
$ rsync md5sum.txt remotehost:/home/user
$ ssh remotehost 'md5sum -c md5sum.txt'
foo.bar.iso: OK
share|improve this answer
add comment

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.