Skip to main content
2 of 5
added 4 characters in body
terdon
  • 252.3k
  • 69
  • 480
  • 718

Continue a directory tree checksum from a given file

I have:

  • A checksum.txt file which contains many lines of checksums of single files from a mountpoint in a huge directory, which mounted and then it disconnected, thereby not finishing the checksum.txt (partial checksums)
  • localchecksums.txt full checksum list, containing thousands of lines of SHA256 checksums with filenames etc.

I would like to:

  • Compare the remote mount checksums and local ones with sha256sum -c checksum.txt localchecksum.txt or similar, but:
  1. I don't want to go through gigabytes of data again to get the remaining hashes
  2. I don't want to restart the whole process from the start for checksum.txt

I generated the list by using find to recursively to find single files and exec sha256sum on them.

It is possible to somehow get the remaining hashes by somehow comparing the two files or somehow continue checking the checksums by reading the checksum.txt file and only calculating checksums for not yet checked files. The problem with the first approach is that the order is different in the files. The second approach sounds good but I don't have any idea how to start with that.

Sir Muffington
  • 1.3k
  • 3
  • 11
  • 24