LjunggrenThe Lair

Workshop

Article

BackupPC to the rescue

Failed disks, a hosting company's data corruption, burglaries: every time, a proper backup brought things back. BackupPC is one way to get there.

Originally
2009
Reviewed
2026-11
Revision
3

I’ve been using BackupPC for many, many years, and it’s saved my bacon more than once, whether that meant rescuing a stray document or recovering corrupted configuration files. But BackupPC is just one option. The real lesson is simpler: a proper backup, preferably off site, will save you again and again.

What backups have saved me from

  • Disks failing in my own machines.
  • A hosting company suffering massive data corruption.
  • Burglaries.

Every one of them was restored with minimal data loss, thanks to tools like BackupPC and Syncthing. Not one of those events could have been predicted; none of them was a problem in the end.

The first rescue (2009)

I had BackupPC set up on my main home Linux machine, with backups stored on a separate disk, and the entire BackupPC installation mounted at /BACKUPPC. Everything was running smoothly until one day, disaster struck—a power failure that wreaked havoc on my system. My root partition was severely damaged, with ext3 reporting a 30% shrinkage and an 80% structure loss. In other words, there was no way I was getting that data back with fsck.

Then it hit me—BackupPC was still intact, with a backup just 18 hours old. I quickly booted up Fedora from a USB stick, mounted the BackupPC directory, and initiated a clean and restore cycle with a few simple commands:

mkfs.ext3 /dev/sda2
mount /dev/sda2 /mnt/sda2
(cd /BACKUPPC/sbin; BackupPC_createTar -h machineName | (cd /mnt/sda2; tar xvf -)

After 30-40 minutes, my machine returned to its pristine state as if nothing had happened.

How it runs today

My backup system has evolved through several generations. It began with BackupPC installed alongside the general OS, then moved to virtual machines, then to dedicated hardware, and it now runs on dedicated hardware in a Docker environment. Running BackupPC on an isolated system, separate from general-purpose machines, keeps its attack surface small and gives me a strong line of defence against malware and, more notably, ransomware.

What matters more than the tool

  • More than one copy, in more than one place. A backup in the same room shares the same fire, flood and burglar. Keep at least one copy off site.
  • Separate from what it protects. If the machine being backed up can reach and overwrite its backups, so can ransomware.
  • Automatic. The backup that depends on remembering to run it is the one you won’t have.
  • Sync is not quite backup. Syncthing is excellent for keeping files on several machines and sites, but a deletion or corruption syncs too. Turn on file versioning, or pair it with a real backup.
  • Tested. You only find out whether a backup works when you restore from it. Try that before you need it.

So, if you haven’t set up a backup yet, do it now. BackupPC, Syncthing, or something else entirely: you never know when it will save you.

Connections

  1. InspiredA little better today beats perfect too late

    The 2009 rescue is the clearest example I have: a backup that was far from perfect, and still saved everything.

  2. Same principle asLP250 LCD projector: DIY halogen hack

    Both are cheap, simple fixes that outlived the "proper" solution.