Tuesday, September 08, 2015

Version Control of Crash Recovery Cruft



I have developed a system whereby I archive the "cruft" created by a crash into a tar file

TAR.archived-framemaker-cruft.tar



so that I can recover autosave files if necessary, but so that they do not clutter my directory.





I just added a quickie to count the number of crashes saved, or at least an approximation thereof.







This is one of those "duh, why didn't I do this years ago" sorts of things.



EVERYTHING needs version control.



Even crash recovery files.



It sure is nice to have multiple versions of the same crash recovery file(name) , rather than having to rename them autosave.1 autosave.2, ...  (Most important thing is to be able to name things. Second most important thing is to not have to name things.)







    CRUFT_FILES= $(FM_CRUFT_FILES) $(PPT_CRUFT_FILES)    FM_CRUFT_FILES= *.auto.fm *.backup.fm *.auto.book *.backup.book *.recover.fm *.recover.book    PPT_CRUFT_FILES= *Autosaved*.pptx    .PHONY: save-cruft    save-cruft: archive-all-autosave-files    .PHONY: archive-all-autosave-files    archive-all-autosave-files:    -echo $(PPT_CRUFT_FILES) | gtar -uf TAR.archived framemaker-cruft.tar    -rm $(PPT_CRUFT_FILES)    -echo $(FM_CRUFT_FILES) | gtar -uf TAR.archived-framemaker-cruft.tar    -rm $(FM_CRUFT_FILES)    make unlock-all-framemaker-files
    .PHONY: ls-cruft    ls-cruft:    ls $(CRUFT_FILES)
    .PHONY: count-crashes    count-crashes:    .PHONY: count-saved-crash-cruft    count-saved-crash-cruft:    gtar tvf TA*tar | perl -p -e 's/^([^ \t]+[ \t]+){3}([^ \t]+ [^ \t]+).*/\2/' | sort -u | tee >(echo "Unique timestamps (crash points in archive):" `gwc --lines`)