Disclaimer

The content of this blog is my personal opinion only. Although I am an employee - currently of Imagination Technologies's MIPS group, in the past of other companies such as Intellectual Ventures, Intel, AMD, Motorola, and Gould - I reveal this only so that the reader may account for any possible bias I may have towards my employer's products. The statements I make here in no way represent my employer's position, nor am I authorized to speak on behalf of my employer. In fact, this posting may not even represent my personal opinion, since occasionally I play devil's advocate.

See http://docs.google.com/View?id=dcxddbtr_23cg5thdfj for photo credits.

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`)











1 comment:

Andy Glew said...

I am "version controlling" this cruft by appending to a tar archive.

This loses much of the benefit of a VCS. But it is simple, and avoids conflicting with whatever VCS, typically a DVCS, I am currently using for the project.

This is another example of how I often end up using multiple VCSes in same directory. E.g. This here. E.g. When I used a local VCS like RCS because access to a centralized VCS is unavailable, network down. E.g. When the central VCS has policies that prevent me using it for all checking: e.g. I like "checkin early and often", yet many open source projects do not want to see every single checkin. E.g. When I want to VC scripts that generate docs, but tech pubs only wants the final scripts. E.g. When I want to VC the rough work leading to a design, but the official folk only want the final design.

Thus is also an example of another reason to want to be able to remove stuff from a version control system. Archived core dumps do not need to be kept forever, just until I am happy that I have recovered everything I need.