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 -aYou'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.gzYou'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.gzVerify checksums:
$ cd /backups
$ rotcheck -c
./backups/baz/bitrot.tar.gz: FAILED
sha512sum: WARNING: 1 of 49231 computed checksums did NOT matchLast edited by jamielinux (2019-01-25 16:03:36)
Offline