One weakness in the RaspberryPi platform is the sdcard storage scheme. It's not what I would consider robust. I had a card totally die last December, and today the sdcard in my "production" system that runs my tap list, ferm fridge, carb fridge and keezer gagged up a bad block that panicked the kernel on reboot. It needed a fresh format and a re-imaging.
As all four of my RPi systems are now sharing a single sdcard image it only takes the time to write a card again, say 15 minutes, plus a few minutes changing the system name and IP address, to get the system back on the air. But what inevitably gets lost is the current
RaspberryPints tap list data, and all of the
BrewPi logs and scripts and my temperature logger data.
Out of all that, the one I actually care about is the tap list data. It's a pita to try to re-create the database state to a "best guess" of what and how much is on tap. So at the least, I need a way to copy the running database to a safe location.
On my RPi systems, MySQL databases are stored in
/var/lib/mysql.
In that folder there is a
raspberrypints folder, which contains all of the forms for the RaspberryPints database.
But the data file is
/var/lib/mysql/ibdata1
And as my experiments have shown, it can be cloned, copied, backed-up, restored...whatever. Having a copy of that data file somewhere handy is A Good Thing, and obviously, the more current the better.
While I could fire up WinSCP and pull a copy to my workstation when I remember to do it, instead I will be getting
grive running, to automate the back-up of my 'Pints data file, temperature logger and BrewPi data...
Cheers!