Using RCS for Config Files
Using rcs to keep track of changes in configuration files is a great idea... that sometimes helps me to recover from my own stupid mistakes mucho faster. I must admit to my own shame that I managed to kill my employers web site for a day or so - it was noticed today. To my defense I should say that I immediately suspected myself and went on to solve the problem right away. "What have I changed at the config?", I asked myself. And the answer would be "Nothing" - as usual. Which of course is the wrong answer, as bit rot doesn't kill a web server so fast...
Fix one, break another
I remembered I had solved another problem where a regular expression for the "Learning Zope in Greece" blog was slightly wrong. Now in normal circumstances I'd start to dig around that change and try to find what I had trampled on. But I had a quicker way to figure it out, I just looked at my changes with rcsdiff. After a short look I figured out that I had mistakenly erased one line after the fix.
A habit of looking back
It's been many years now that I have started the habit to follow changes to configuration files with rcs. I've heard other people use cvs for that, but with cvs the problem is the creation of the "module" of sources, cvs doesn't really like this stuff to remain in place. There are some workarounds for that, but I never felt confident enough to let them play with all of /etc. On the other hand the ability of keeping all of /etc in one cvs module would be nice, so I could compare all changes in there at once. For now I'm adding files to rcs whenever I change them.
Details of use
With rcs the procedure is simple: Make sure there is a directory called "RCS" in the directory where the config lives. Then (preferably before changing a config file), I check it into the rcs repository with the command ci -l filename, which also "locks" it. rcs needs locking (unlike cvs), which sometimes complicates things. But especially with config files that are always edited by the same user account, it's never a problem, just keep the file always locked. When there are more changes, I can check what I did with rcsdiff filename, then add those changes again with ci -l filename. That's basically all I do to get my safety net. rlog filename gives me a list of changes (with my comments) and rcsdiff -r1.4 -r1.5 filename lets me see the difference between some edits.