Off-site Backup Scripts

Drupal provides the Backup and Migrate module, which does a nice job of making backups of your site database to any schedule you set, and rotating those backups so that you maintain some depth. But its important to remember that the site database is not all that it takes to rebuild your website, should it disappear one day.

There is an additional module that will backup your site files directory as well, but that still doesn't capture the Drupal core files or all of the modules, theming and library files that you have downloaded and configured. Most of that can be downloaded again, but after a server crash are you going to remember them all?

In addition, the Backup and Migrate module leaves your backups on the server, where they are still vulnerable to being lost. (UPDATE: off-site features have been added to BAM!) To be reasonably safe from most catastrophic data loss, we need to keep multiple, redundant complete backups in multiple locations - and those locations should be geographically separated as well.

To acheive off-site backup for the web server that we had built, I wrote a script in Linux BASH that makes an archive of the full Drupal site, rotates the files and then syncs the archive files with a remote server in a data center far away.

Add new comment