Well, my rpi isn’t backed up. The data that’s on it is all on github so all I would have to do is restore the OS. I have yet to compile anything from scratch as I use pre-compiled packages and install via 'apt-get'
. However, for other, more dedicated servers that I run, I do back them up every single day, however again, I don’t bother with the OS. What I do backup (list based on a CentOS machine):
/home - where everyone's user accounts reside
/etc - because it contains a myriad of config files for the whole system
/var/lib/mysql - all the MySQL databases live there
/var/spool/cron - because I really don't remember all the various custom service tasks that are running
/root - because I tend to keep some important, system wide stuff there
/var/mail - users tend to lose their heads if suddenly their entire INBOX goes missing
Everything is done using 'rsync'
in incremental hard-links mode. This way I can keep (on average) 2 weeks worth of data without it also taking up 14x the amount of physical storage; it only copies a file if it has changed. I have a single terabyte drive that has been the backup drive for 15 different servers, storing anywhere between 2 to 4 weeks worth of data (and it’s also backed up to a secondary machine). One of the servers takes up 175GB all on itself. If I didn’t do incremental hard-links, I’d be needing a larger backup drive just for that one machine.
Should the main hard drive in any of the servers die, all I have to do is swap it out for a new one and push the power button. PXE (pixie) takes over, sees that there’s no OS on the drive, and automatically re-installs everything for me from the source OS server on the network. 10 minutes later the server is up and running, fully configured, with a restore rsync running. That’s faster than many will take to finish a hot cup of coffee in the morning.
I realize this is a more advanced setup that will not apply to 95% of you here. But then, you did ask how we backup. :)
If I were to backup my rpi, that’s the same process I would take, with the exception that rpi does not support PXE, so I will still have to manually re-image the SD card and go through the setup process to get it back up and running, prior to doing any kind of restore operation on it. And since I use my rpi only for MM, there isn’t a whole lot in terms of what needs to be redone on it, other than a few git clone commands and restoring my config file. But since I run an identical setup at my office but on a regular unix server (for when I’m bored and want to do dev work), I just copy that file over and done.
One of these days I’ll map out how my internal network runs and “maintains” itself.