sha1dir
sha1dir copied to clipboard
Optionally write individual checksums
In a large directory tree which fails its checksum, it can be onerous to work out why that is.
In my usage, I have large directory trees where a user may have set bad permissions (user missing x
on a directory, for instance). When such is transferred, rsync
helpfully fixes the bad permission (so that the children may be copied). But the checksum comparison then fails, and it is not straightforward to determine why that is.
This change introduces a --write-checksums
option, which may be used to dump individual checksums to a file (in undefined order). Once sorted, diff
is useful on such a file.
Example usage:
$ find junk | sort
junk
junk/a
junk/b
junk/c
junk/c/d
$ sha1dir --write-checksums ~/junk.checksums junk
8699a7c49c0a785b039df6a1a9a0c255979f1262 junk
$ cat ~/junk.checksums
a 3c6f8cbff8aae7eb2130d9f9caf8b96984180004
c 2f1837838211cce2c9b29031688ece53ebb8abf8
b 66d0ab2e00ae6742900f2b80f9c59b2829e1d3c2
c/d f33eb7d6e61f34107b1094e9f2132e47d1de6a5c