1 Introduction

1.1 Goals

1.2 Notes

2 Exercises

2.1 Installation

$ sudo apt-get install backuppc

As a dependency, Postfix (the mail transport agent) may be installed.

If it does, answer the questions about Postfix configuration as the screens below indicate:

Postfix Configuration

Postfix Configuration

If asked about the type of mail configuration for Postfix, answer "Internet Site", as below:

Postfix Configuration

Postfix Configuration

2.2 BackupPC user and password

Pay attention, this last scree is very important; it'll display a login and a passord to access to backuppc web interface.

Configuring BackupPC

Configuring BackupPC

In the example above, the user is backuppc, and the password is 'NfitZim5'.

Write the user and password you see on YOUR screen down on paper!!

You have installed BackupPC, let’s configure it to take backups.

2.3 Changing password

The first thing we'll do is change the password. To do this, you have to use the htpasswd command. If you can't find that command, install it with:

$ sudo apt-get install apache2-utils

Then, change the password.

$ sudo htpasswd /etc/backuppc/htpasswd backuppc

It'll ask you for a new password. Please use the CLASS PASSWORD!

2.4 Starting

Before we start using BackupPC, add the current user (sysadm) to the backuppc group :

$ sudo adduser sysadm backuppc

2.5 Web interface configuration

Install the Apache2 BackupPC config

$ sudo cp /etc/backuppc/apache.conf /etc/apache2/sites-available/backuppc.conf

Enable the apache config:

$ sudo a2ensite backuppc.conf

Restart apache server

$ sudo service apache2 restart

You can now access to BackupPC using a web browser:

http://hostN.ws.nsrc.org/backuppc

You know the login and the password.

2.6 Configuration

The configuration lives in /etc/backuppc/config.pl

But we are going to use the web interface.

By default, backups are stored in /var/lib/backuppc, but this can be changed.

2.7 Backup local directory

To allow backups to take place without being prompted for a password, we have to configure sudo to allow it.

$ sudo visudo

Add the following line:

     backuppc ALL=NOPASSWD: /bin/tar

Navigate to http://hostN.ws.nsrc.org/backuppc, log in if required, then:

  1. In the left Hosts menu, choose localhost from the pull-down menu.

  2. Now select Edit Config

  3. At the top, click on 'Xfer
    1. XferMethod : make sure Override is checked, then choose tar from the pull-down menu.
    2. TarShareName : make sure Override is checked, then add the directory /var/www/ (click Add button when done)
    3. "TarClientCmd" : make sure Override is checked, then make sure the command is /usr/bin/sudo LC_ALL=C $tarPath -c -v -f - -C $shareName –totals
    4. Click on Save
  4. Click on localhost Home in the top left, then click on Start full backup

When asked to confirm, click Start Full Backup again.

The backup will finish almost immediately.

  1. In the top left, click on Browse backups

Browse the contents of the backup, and check that it's ok.

Next, we'll move to backing up another host!