Arman's stuff
Guest
Back it up, yo!

(Wed Jun 9 11:28:46 2010)

Whew, that's a relief.

I have (finally) implemented a backup solution; like most of my other solutions, I've chosen a way that is off the beaten path (and off the unbeaten path, too), and thus absolutely no tool out there will work for me. Obviously.

If I was in charge of backups in a large company, where files changed rapidly and users were prone to deleting things they shouldn't, I would back everything up on tape. Every month, I would make a full backup of everything; every Sunday, I would make a backup of everything that happened since that backup; every day left, I would make a backup of what had changed since that Sunday. Thus, monthly I'd have a huge amount of data, weekly I'd have a large amount of data, and daily I'd have a small amount of data. If something failed, I would need (at most) three files to restore from.

Of course, I'm not in charge of a large company. Now, if I were backing up my system (pictures, that sort of thing), it would be different; tape is expensive, CDs and DVDs are cheap. I'd probably dump the whole thing onto a stack of DVDs. Not counting video, I could probably put all my images and documents onto three DVDs. I'd do a full backup every year, and incremental backups every month or so (I'm planning on doing this anyway). That would require nothing but a weekend of sticking DVDs into a drive once a year, and less than an hour a month. No biggie.

Then again, I'm not backing up personal data - that tends not to change much once it's there. Sure, you add pictures and documents, and occasionally modify them, but usually, you drop a picture into a directory and never change it again. Not so with the Blag; I'm always editing it. Plus, when I run the backup, I do a full dump of the database (well, for now; if it gets big, I'll have to change that tune). The resulting backup tarball is too small for a CD (it's about 40 MB right now), and I'm too cheap to buy a tape drive of any size (and tapes these days - whew!). I need a reliable backup solution that will save my file in case I need it, and won't lose it between now and the next full backup. I need a system that can easily and quickly store files around 40 MB, and probably more as time goes on.

And what system does that? Easy! Email! I don't get buy a couple kilobytes of email a month (that I save, anyway), so most of my (currently) 7 GB of storage is just sitting there, empty. After a few manuals and a lot of growling about incompatible formats, I figured out how to send attachments through my gmail account; now only that, but since it sends from my system account, and receives to my main account, I've got it backed up in two places. How cool is that?

So anyway, my program goes through these four easy steps:
1) Backup the database to a file
2) Make a tarball of the directory (full on the 1st, incremental otherwise)
3) Split the tarball into chunks less than 25 MB
4) Email each chunk to my gmail account

Once its done, it cleans up after itself and away it goes; if I ever need to restore anything, I'll just pull that file out of the incremental backup if it exists there or the full backup otherwise. Incremental backups are generally less than a meg (though I'll be watching the size as time goes on). If need be, I can modify the backup routine for more or less. Plus, being that it's gmail, I can 'expire' the emails after a certain amount of time. Or delete them, whichever :-)

I'll probably burn one of these to a CD every year, just in case; like I said, it's not much, but I'd like to refrain from losing it. But I'm ready, now (at least for my webserver) - I'd say do your worst, but I don't mean it. I'd much rather you be nice.

<< In this world you will have troublesVacation Round-Up: River Fest >>

This blag is tagged: Google, Programming, Server, Wobsite, All