May I ask why your computer is crashing so often in the first place? Do you live in a zone with an unstable power supply?
If it was that easy I'd have fixed it (Several UPSes on hand).
It turns out the Intel Desktop Motherboard model D865GLC(*) has hardware issues with RAM addressing. It's 100% reproduceable across the 20+ systems I've tested. (Anyone with one of these boards can trigger the fault by using memtest86+ and getting it to probe memory. The system will lockup halfway through the first test pass. It manifests in Linux as a system lockup during heavy I/O activity and I've been unable to trigger it at all in windowsXP)
Anyway, we make backups of other important files, so why not backup the configuration file, too? I have to go now, but I'll implement it later. (Unless I forget to...)
Thanks. I see you've implemented this, but it's not quite enough to solve the problem:
(I've had another couple of truncation incidents recently and noticed the bak file was anything up to 14 days old.)
There's no point in only making a backup at exit, because if there's a crash it will l never be written.
There should be a backup made each time a new config file is written, or at the very least each time anything other than a statistics change occurs.
Statistics in config files:
I'll second the comment made in another thread that writing out statistics into the config file is a Really Bad Idea.
This whole thread would have been a non-issue if it wasn't for that being done. Config files should be as static as possible.
(*) It's suprising that Intel can produce unstable motherboards! We ended up replacing 22 desktop machines 2 years ahead of schedule at $orkplace as a result of finding this problem as it explained why some researchers were getting random lockups. I don't have the budget to change the home box out just yet.