Mirror Checking using a “live” md5sum

If you’ve “mirrored” some files and want to do an md5sum check recursively without an intermediate file (md5sum > file; md5sum -c file) you can do it in one easy step using this from the relative path where you are mirroring:


ssh ${HOST} find ${DIR} -type f -exec md5sum {} \\\; | sed sF${DIR}FF | md5sum -c -

This will ssh to the machine, run the md5sum, pipe it to sed to remove the absolute path prefix to make the md5sum ‘file’ (stdin to the final md5sum) use relative paths.

Bookmark and Share