You are not logged in.
Had loads of fun fooling around with this script. Picked POSIX shell for maximum pain, but for some reason I enjoy such challenges
Useful for detecting bit rot and then restoring from somewhere. Hopefully you have backups. And if it's your backups that have bit rotted, hopefully you have multiple backups
There are faster tools available already (usually written in C/C++)... but where's the fun in that! Thought the Arch community might appreciate this. Would be interesting to hear opinions on some of the crazy inside the script
Create first checksum file (located at "./.rotcheck"):
$ cd /backups
$ rotcheck -a
You've added some new files and need to append some checksums:
$ cd /backups
$ rotcheck -av
ADDED: ./backups/foo/one.tar.gz
ADDED: ./backups/foo/two.tar.gz
You've edited some files and need to update the checksums (for files with a modification time newer than the checksum file):
$ cd /backups
$ rotcheck -uv
CHANGED: ./backups/bar/three.tar.gz
Verify checksums:
$ cd /backups
$ rotcheck -c
./backups/baz/bitrot.tar.gz: FAILED
sha512sum: WARNING: 1 of 49231 computed checksums did NOT match
Last edited by jamielinux (2019-01-25 16:03:36)
Offline