View Single Post
Old 10-15-2010, 06:26 PM   #11
BookGnome
Voracious Reader
BookGnome is on a distinguished road
 
BookGnome's Avatar
 
Posts: 4
Karma: 62
Join Date: Sep 2010
Device: Kindle
Smile Using ebook_armor.sh to combat bit-rot

Quote:
Originally Posted by kovidgoyal View Post
As far as combating bitrot is concerned, I don't really see how the hash would help. After all, say calibre tells you that the file has changed (this would only happen if you ask calibre to check, for example during a db integrity check). Then what? The file has already "rotted" not much calibre can do about it. I suppose you could then go into your backups to try to find a pre-rotted version.
I thought about your question, and came up with an answer to the question of "then what?" I put together a shell script that uses a combination of things to track integrity, and also uses par2 to allow for recovery of data when damage is detected.

It turns out that some of the ebook formats (like epub or cbz, for example) give you some opportunities for integrity checking "for free" by providing archive integrity tests for their respective containers, in addition to any external hashing. Ultimately, I think the hash is more useful, but I tend to be a belt-and-suspenders kind of guy.

It's not a Calibre plugin, and the solution is very *nix-ish, but it may give you some ideas of your own for Calibre, if and when you decide to add some hash support. Let me know if you have any questions about the implementation, and I'll do what I can to help.
BookGnome is offline   Reply With Quote