Skip to content
accelerando

Recursively md5sum all files in a directory tree

After a server crash a wanted to compare all actual files with the backuped data. An easy way is to compare the md5 hashes like that:

First create recursively md5 hashes from all files in that directory:

find ./backup -type f -print0 | xargs -0 md5sum > /checksums_backup.md5

Then check the actual data:

md5sum -c checksums_backup.md5

I was lucky, no files where damaged.

2 Comments

  1. tante wrote:

    find ./backup -type f -exec md5sum {} \;>> /checksums_backup.md5

    Läuft meiner Erfahrung nach oft schneller als xargs. Vielleicht in diesem Falle nicht ganz so relevant, aber für andere Fälle ;)

    Posted on 25-Oct-08 at 2:31 pm | Permalink
  2. Michael wrote:

    Danke :)
    Ich hoffe, ich brauch’s nicht so schnell wieder.

    Posted on 25-Oct-08 at 5:13 pm | Permalink

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*

*
Close
E-mail It