Check md5sum of remote file
If you've ever found yourself in need of double checking whether files are identical across hosts, this one's for you:
(cd ${local_path_to_file} && md5sum ${file} ) | ssh ${username}@${host} "(cd ${remote_path_to_file} && md5sum -c - )"
Replace the variable placeholders to adapt to your files, host & paths you need. The last '-' is important!
It also works in the other direction, just make sure the md5sum -c -
is what you're piping to.
ssh ${username}@${host} "(cd ${remote_path_to_file} && md5sum ${file} )" | (cd ${local_path_to_file} && md5sum -c - )
Written by James Cuzella
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Checksum
Authors
tomgco
10.24K
trinitronx
4.26K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#