Back it up!

Why are people (including myself) so lazy about backing up their data?

Do we assume the “managed” in the $4.95/month managed server takes care of this for us? Do we think the risk of failure is so small that it will only happen to other people? Do we think it will require a large and ongoing effort? Do we just not know where to start?

With the cost of hard disks being so low these days, these seems to be no reason not to have a copy of at least your most important databases and files on a separate disk to ease the pain when that dark day that you will forever call “the hard disk crash of {insert year here}” comes.

A combination of this thought and the inherent laziness that most programmers have prompted me to look into what this actually would entail. I believe that the end result was simplified by the fact that I run mostly Linux, but I’m sure with cygwin or something similar, the same can be pretty much achieved on windows.

The end result is a set of scripts for backing up MySQL and transferring data (both the MySQL backups, and other data such as my websites) to a remote server. If I create a new database that needs to be backed up, I just have to grant access to it for the backup user and restore user and it will automatically be included in the backup routine. If I want to backup a new folder, I need to add it to my backup script and it will be synced according to the next schedule. Alternatively, I could create a symlink for all top level folders needing backup inside a common “backup” folder and only need to backup that folder, but this reduces the flexibility of being able to backup my websites to machine1 and audio (for example) to machine2. Once a month each backup will be restored to a scrap table for verification. Finally, due to the magical default behaviour of cron, anytime an error is encountered, I will be notified via email.

Information including all scripts for the MySQL backup can be found on the wiki: http://wiki.accordingtokris.com/index.php?title=MySQL_Backup

Information including scripts for content backup can also be found on the wiki: http://wiki.accordingtokris.com/index.php?title=System_Rsync_Backup

Enjoy - and no more excuses if when you have a disk failure!

Posted on Monday, July 17th, 2006 at 10:38 pm.
Filed under Administration, Linux.
Subscribe to RSS 2.0.
Leave a comment or trackback.

Leave a Reply