BackupPC
How to backup your stuff without really crying
Bill Childers
http://wildbill.nulldevice.net/presentations/bkuppreso
Why Backup?
- To protect against data loss
- Hardware failure
- User error
- Software error
- Disaster recovery
- Archival purposes
Conventional Backup Methods
- Tar
- Tar is powerful, but can be arcane to use (old school unix mojo)
- Does not scale very well from an admin perspective
- Backs up everything, every time (not very efficent)
- Does not work well on slow network links
- Rsync
- Rsync is more efficent than tar, thanks to rsync algorithm
- Also does not scale very well from admin perspective
Conventional Backup Methods (Cont.)
- Conventional "Backup" Programs
- Programs like Amanda, Bacula, Netvault, Backup Exec, Netbackup...
- Work well, most of the time
- When they blow up, they blow up spectacularly
- Not very storage efficient, as they backup every (changed) file on every machine
- All backup methods typically require the admin to be the one to restore files to a machine
Enter BackupPC
Why use BackupPC?
A open source set of perl-based programs (free as in beer)
- Provides a web-based interface to manage part of the backup process and all the restoration
- Leverages familiar open source tools (rsync, tar, smb) underneath
- "Single-instance" backup, combined with compression = very efficient use of space
- Uses hard links on the filesystem to point one file to multiple machines
- Can offload all the restoration tasks/issues to the user, not the admin
- Bare metal restoration (x86) is possible using Knoppix as a boot medium
- Will send emails to admins and users detailing backup status (or lack of status)
How to get BackupPC
- Source -- http://backuppc.sourceforge.net
- Debian-based distros -- apt-get install backuppc (read the docs for passwords)
Configuration of BackupPC
- BackupPC assumes you want to backup the entire system
- Default paths to backup and/or exclude specified in systemwide conf file
- You can create a mini-conf file for individual hosts that don't match the overall scheme
- UNIX hosts backup methods:
- tar over ssh
- rsync over ssh (preferred)
- smb
- Windows hosts backup methods:
- smb over admin share (C$)
- rsync over ssh (via cygwin)
Configuration of BackupPC (cont'd)
- /etc/backuppc/config.pl
- $Conf{BackupFilesExclude} = ['/proc', '/sys', '/tmp', '/media', '/Volumes', 'dvdrip'],
- $Conf{XferMethod} = 'rsync';
- $Conf{RsyncArgs} = ... '--checksum-seed=32761',
- Uncomment for HUGE performance increase
- /var/lib/backuppc/hostname/config.pl
- $Conf{RsyncClientPath} = '/opt/csw/bin/rsync';
- $Conf{RsyncShareName} = ['/export/backup', '/space1/bill', '/space2/htdocs'];
Cool features for client machines
- BackupPC server will "ping" its configured clients
- If a client is detected on the network, it will only be backed up during "offhours"
- If a client is NOT detected on the network for a certain period of time, and then is detected, a backup is immediately initiated.
So, what does BackupPC look like?
BackupPC: Host Summary
BackupPC: Restoring a file
BackupPC: Restoring a file (cont'd)
BackupPC: Restoring a file (cont'd)
BackupPC: User's Interface
Knoppix Bare Metal Restore
- Fix disk (if necessary)
- Boot Knoppix
- Create Filesystems (if necessary)
- Mount F/S Read/Write
- Exchange SSH keys from BackupPC to the client
- Restore the entire system from the last backup, but point it to the "mounted" path of the new filesystem
- Use grub-install to repair your bootloader if running linux
- Hack #53 in Knoppix Hacks by Kyle Rankin, available at your local bookstore