Server Backup Management Script

Running the infrastructure for your home, small business or company can be fun but you also take the risks on yourself.  Data loss being the biggest point of failure.  Nothing short of a steady daily incremental backup and monthly full backup.  These backups should be stored offsite.  All important storage drives should be raided with redundancy.  The server(s) needs to be on a UPS (and test the UPS).  Frankly the majority of this is common knowledge.  The big pain comes in actually setting the backup system up.  Reinventing the wheel is always a bad idea so instead of coming up with your own set of backup scripts the first step should be to see what existing software or solution are out there.

This applies only to Linux.  I tested many pieces of software and found most of them clunky at best.  Without naming names I’ll just say every piece of software I tried was lacking when compared to a scripted setup.

Searching the internet I came across this perfect script for which I take no credit for but I want to share.  Backup-Script (mirror: Backup-Script)

All instructions to run the script are contained within the file description.  It is very simple to setup, the instructions even include a good common cron tab line.

I customized the script a bit to suit my needs a bit better.  It is ready to go for a vanilla ispconfig or plesk setup.  It manages both the backup but also the restore.  It does a full backup and then incremental backups.  Restoration is easy, the same script can be used.  All the instructions are in the script header.

So I ran a full backup onto a local hard drive.  Then moved that hard drive to an offsite storage location.  The incremental backups are fairly small in comparison so those auto transfer via rsync upon completion.