Martin @ Blog

software development and life.

Flower

Database backup

Because I already lost one time my complete weblog and some other databases, and very recently almost destroyed another database which was hosted on my server and required for the unversity project of my girlfriend, I’ve decided to implement a decend backup strategy. Because I have no tapestreamer or something similar in my server, I am restricted to ‘online’ backups.
Last few days I wrote a bash shell script which makes a backup of the production databases which are on my server and copy this tar.bz2-file with the SQL-dumps to a computer in Zeeland (geographically about 150 km away from here), my Mac Mini (which is also almost always on, but is in the same room as the server) and e-mails the tar.bz2-file to a Gmail-account which I have created for this purpose.
I think it will be pretty hard now to lose all date. There is 24 hours between the backups, so in a worst-case scenario I lose at most 24 hours of data, which is not a very big problem I think. Every backup is currently about 400KB (compressed, almost 2MB uncompressed), which means that on the Gmail account can at least about 5000 backups, which means that I’m settled for about 14 years :).

Now, I only have to fix some kind of backup system for my data. But that is less urgent, because all data on my server is stored on a RAID-1 mirror, so if one disc crashes, I will not loose everything.

Comments are closed.