On Friday 6 September 2024 22:41:33 BST Frank Steinmetzger wrote:
> Am Fri, Sep 06, 2024 at 01:21:20PM +0100 schrieb Michael:
> > > > find path-to-directory/ -type f | xargs md5sum > digest.log
> > > > 
> > > > then to compare with a backup of the same directory you could run:
> > > > 
> > > > md5sum -c digest.log | grep FAILED
> 
> I had a quick look at the manpage: with md5sum --quiet you can omit the grep
> part.

Good catch.  You can tell I didn't spend much effort to come up with this. ;-)


> > > > Someone more knowledgeable should be able to knock out some clever
> > > > python
> > > > script to do the same at speed.
> 
> And that is exactly what I have written for myself over the last 11 years. I
> call it dh (short for dirhash). As I described in the previous mail, I use
> it to create one hash files per directory. But it also supports one hash
> file per data file and – a rather new feature – one hash file at the root
> of a tree. Have a look here: https://github.com/felf/dh
> Clone the repo or simply download the one file and put it into your path.

Nice!  I've tested it briefly here.  You've put quite some effort into this.  
Thank you Frank!

Probably not your use case, but I wonder how it can be used to compare SOURCE 
to DESTINATION where SOURCE is the original fs and DESTINATION is some backup, 
without having to copy over manually all different directory/subdirectory 
Checksums.md5 files.

I suppose rsync can be used for the comparison to a backup fs anyway, your 
script would be duplicating a function unnecessarily.

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to