BackupPC (Open Source)

Author
Aron Schatz
Posted
December 19, 2007
Views
63336
BackupPC (Open Source)
While talking about backups is one thing, doing it is another. BackupPC is a program that runs on a server to automatically backup your PCs. It is very useful and once setup, very powerful.

Page 1: Intro, Requirements, Initial Setup

Introduction:

Many articles written on this site and others tell you how important it is to keep information backed up. Right now you are using your computer. Do you feel comfortable if a power surge zaps your hard drive or your hard drive in general decides to die? Even if you answered yes, it is always helpful to inspect a new tool. BackupPC is free and open source. It runs on Linux and there are probably repos to download it for your distribution. Don't let that fool you. BackupPC can save many different workstations including WinXX all the way to anything that runs rsyncd.

What It Is:

BackupPC is a centralized backup solution that can be used and setup on a per client basis. You can have any number of backup clients and the different options can be setup for each individual client. Backups are done intelligently and are stored in pools with or without compression.

What It Is Not:

BackupPC is not polished. That should be known before you jump into configuring it and saying what a horrible tool it is. While the configuration is moderately difficult, the reward more than makes up for it. You will need to do some command line work in a shell. You shouldn't be worried about that since this article will also serve as a guide on how to setup BackupPC for your environment.

BackupPC is not an archival solution. You will need to use a separate program to store on external media. BackupPC does come with a built-in way of handling this task, though.

Gathering Requirements:

The first step you need to do before installing BackupPC is to write down what you think you'll need and what you want to backup. You can't expect to backup 400GB of files onto a 250GB drive. Remember that you should at least have enough backup space for all your clients full backups + 10% for incremental backups. This should give you some leeway. BackupPC does some cool tricks to save space, so you will have more space than you think you may need.

This article assumes you are using some flavor of Ubuntu (or Debian) that has a binary install of BackupPC by a repository. The computer used in this articles contains:

Intel Pentium D 830
Intel 955XBK Motherboard
2GB Crucial DDR2 RAM
Dell Perc5/i RAID Controller*
4x 320GB Seagate SATA drives
Four drive RAID 5 array

The machine is no slouch, but the most important thing is the disks and the controller. Under Linux, I don't recommend the use of fakeraid chipsets such as the ICH* series from Intel (which is present on this motherboard). *The Dell Perc5/i I'm using is a re-badged LSI MegaRAID card. If the card doesn't carry on-board RAM, it probably isn't real RAID. And to anyone that finds this article, I need to use a PCI video card with the Perc5/i to get it to boot.

Your server will need some form of DNS name or static IP. This review assumes that all computers can be setup with static IPs. If you have a different situation, please »post in the forums for help.

Now that you have a baseline of what you will need and what is expected, we can move on to installing BackupPC onto the server.

Installation:

This guide assumes that the server is located at 192.168.1.4. Each place you see this IP, feel free to change it to suit your needs.

Linux was fairly unfriendly about new program installation in the past. Not so with repository installations. If you are using Debian based distributions, apt-get is the tool for this. Under Red Hat based distributions, yum is the tool. You can still compile programs from the source, but repository installations take care of dependencies and such by itself. Since the server is running some flavor of Debian (Kubuntu 7.10), we can use apt-get to perform the install. At a prompt type:

sudo apt-get install backuppc

It should ask for your sudo password...

aronschatz@asetest:~$ sudo apt-get install backuppc
[sudo] password for aronschatz:

Now type in your account password to begin the install.

Code

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  apache2 apache2-mpm-worker apache2-utils apache2.2-common exim4 exim4-base
  exim4-config exim4-daemon-light libapr1 libaprutil1 libarchive-zip-perl
  libcompress-raw-zlib-perl libcompress-zlib-perl libdb4.3 libfile-rsyncp-perl
  libio-compress-base-perl libio-compress-zlib-perl libpcre3 libperl5.8 libpq5
  perl perl-base perl-modules perl-suid samba-common smbclient
Suggested packages:
  apache2-doc par2 mail-reader eximon4 exim4-doc-html exim4-doc-info
  gnutls-bin openssl libmail-spf-query-perl libterm-readline-gnu-perl
  libterm-readline-perl-perl smbfs
Recommended packages:
  mailx perl-doc
The following NEW packages will be installed:
  apache2 apache2-mpm-worker apache2-utils apache2.2-common backuppc exim4
  exim4-base exim4-config exim4-daemon-light libapr1 libaprutil1
  libarchive-zip-perl libcompress-raw-zlib-perl libcompress-zlib-perl libdb4.3
  libfile-rsyncp-perl libio-compress-base-perl libio-compress-zlib-perl
  libpcre3 libperl5.8 libpq5 perl-suid samba-common smbclient
The following packages will be upgraded:
  perl perl-base perl-modules
3 upgraded, 24 newly installed, 0 to remove and 10 not upgraded.
Need to get 20.2MB of archives.
After unpacking 36.0MB of additional disk space will be used.
Do you want to continue [Y/n]?


Press y and then enter to begin the installation.

1.png


BackupPC will now ask for some configuration options. On the first screen, which web server should BackupPC setup automatically? In this case, apache2 is the best choice. Select that and press enter.

2.png


This screen is very important. It lists the initial backuppc password. If you want to change it, it also gives you instructions on how to proceed. We will be changing the password as soon as we are done with the installation. Once you are back at the prompt, open up a browser and navigate to http://192.168.1.4/backuppc . You need to enter "backuppc" as the user name and the password given to you during the installation.

Did you forget the password? We can change it before going forward. At a prompt, type:

sudo htpasswd /etc/backuppc/htpasswd backuppc

It will now ask you for a new password:

aronschatz@asetest:~$ sudo htpasswd /etc/backuppc/htpasswd backuppc
New password:

Enter a new password to use twice.

aronschatz@asetest:~$ sudo htpasswd /etc/backuppc/htpasswd backuppc
New password:
Re-type new password:
Updating password for user backuppc

Login


Once that is complete, you can log into the web site again by using the new password.

Setup:

Status Host Summary


You can now see the basic layout of the web portion of BackupPC. Under the Host configuration, localhost is inserted by default. Since you probably don't want to backup the server to itself, we can remove that now. You can add it again later if you want.

Main Config


The next stop is the main configuration screen. You can make pretty much all changes you would need to the base configuration on the web. If you only have a few clients that will be backed up the same way, you don't have to go into the command line configuration at all. Each option is explained in detail in the manual included with the program. You should read it through to understand how to setup the program for your exact needs. We can get by using the default configs. By default, the path for the backups is /var/lib/backuppc . You are free to change that if you wish. Make sure you change the "TopDir" configuration option and change the home directory of the backuppc user in /etc/passwd as well.

The default schedule for backups is one weekly full backup and six daily incremental backups. This gives you a retention time of about a week with a daily snapshot of each day in the previous week. This should be fine for most people.

Host Config Add Host


We will now add a host on the host configuration screen. I've added a client called 'asewebdns' to the server. Now this is a DNS name of the client PC. We need to make sure that the server can resolve this address. The best way is to place the IP address of the client in the hosts files of the server. If the client PC's IP address is 192.168.1.115 and the name is "asewebdns" the entry in the /etc/hosts file would look like

192.168.1.115 asewebdns

To insert this into the hosts file, you can type:

sudo vi /etc/hosts

Your file may currently look like this:

127.0.0.1 localhost
127.0.1.1 asetest

And then has some IPv6 information after. You want to navigate down to the blank line after the 127.x.x.x address and add 192.168.1.115 asewebdns. You need to know how to use vi(m) for this or another text editor. You could even open the file as root in a graphical text editor and accomplish the same thing.

The file should look somewhat like this:

127.0.0.1 localhost
127.0.1.1 asetest
192.168.1.115 asewebdns

And you can try to ping the client PC by name and it should work.

Code

aronschatz@asetest:/etc/backuppc$ ping asewebdns
PING asewebdns (192.168.1.115) 56(84) bytes of data.
64 bytes from asewebdns (192.168.1.115): icmp_seq=1 ttl=64 time=0.403 ms
64 bytes from asewebdns (192.168.1.115): icmp_seq=2 ttl=64 time=0.317 ms
64 bytes from asewebdns (192.168.1.115): icmp_seq=3 ttl=64 time=0.220 ms

--- asewebdns ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2011ms
rtt min/avg/max/mdev = 0.220/0.313/0.403/0.076 ms


Excellent. Now we can move on to the transfer settings of the client PC.
members/attachments/upload/2007/12/19/2166m.png 1.png members/attachments/upload/2007/12/19/2167m.png 2.png members/attachments/upload/2007/12/19/2168.png Login members/attachments/upload/2007/12/19/2169m.png Status members/attachments/upload/2007/12/19/2170m.png Host Summary members/attachments/upload/2007/12/19/2171m.png Host Config members/attachments/upload/2007/12/19/2172m.png Main Config members/attachments/upload/2007/12/19/2173m.png Add Host members/attachments/upload/2007/12/19/2174m.png Stored Backups members/attachments/upload/2007/12/19/2175m.png Select Restore members/attachments/upload/2007/12/19/2176m.png Restore members/attachments/upload/2007/12/20/2177.jpg title.jpg

Title

Medium Image View Large