Sometimes, you'll hear the phrase "backup strategy", referring to how you (or an organization) performs computer backups. How well do backups protect you against situations like
- Hard drive failure? You still have your files (up to the most recent backup)
- Accidental file deletion? You can recover the last backed-up version of the file.
- The sprinkler system going off, and soaking your computer? It depends. If your perform backups to a spare hard drive in your computer, then you're probably out of luck. If you perform backups to an external drive, and the external drive also got soaked, then you may be out of luck. If your backups are off-site, you're probably okay.
- Suppose you mirror your computers hard drives -- what does (and doesn't) this protect you against? If one drive fails, you can rebuild a mirror; mirroring is protection against hardware failure. Mirroring offers no protection against accidental deletion.
Suppose you are taking regular backups. There are still things that can go wrong:
- Your backups might not include the files you expected them to include.
- Your backups might not be readable.
Moral of the story: it's a good idea to test the integrity of your backups every once in a while.
Suppose someone gets hold of one of your backups, and puts it on bittorrent. What then? This is a very good argument for encrypting backups, particularly off-site backups.
Suppose you're diligently backing up your files to a cloud service, you're encrypting your backups, and you're doing periodic tests of backup integrity. What happens when your backup provider goes belly up, and sells your assets during liquidation? Depends on what's in the service provider's EULA. Sigh ...
There are two broad categories of backups:
- Full backups. You back up all of your files, regardless of whether they've changed. Advantage: it's a very nice, neat, snapshot of your stuff. Disadvantage: full backups can be time-consuming (depending on the amount of data you have).
- Incremental backups. You backup files that have changed since the previous backup. Some software is smart enough to isolate only the sections where a file has changed. Advantage: incremental backups take up less space, and take less time to do.
The two approaches are often mixed. For example, you might do incremental backups each night, full backups 1x/month, and store a copy of the full backup off-site.
Normally, I'd start with the simplest solution first, identify shortcomings with the simple solution, and then move on to better solutions. This time, I'd like to start with a piece of backup software that's pretty good, and work backwards to simpler approaches (for illustration).
Duplicity is pretty nice, and it has several of the features mentioned earlier:
- Supports full and incremental backups
- Supports different `backends'. You can backup to an external disk, dropbox, S3, ftp, webdav, or an ssh account on a remote server.
- Supports encryption (via GnuPG)
Exercise: try to backup your Desktop folder to /tmp/backups. (Note: you'd never want to put real backups in /tmp/ -- by definition, /tmp is for temporary files. But for our first test, /tmp will do just fine).