Install and configure the BackupPC backup software
Perform a Backup
$ 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
If asked about the type of mail configuration for Postfix, answer "Internet Site", as below:
Postfix Configuration
Pay attention, this last scree is very important; it'll display a login and a passord to access to backuppc web interface.
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.
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!
Before we start using BackupPC, add the current user (sysadm
) to the backuppc
group :
$ sudo adduser sysadm backuppc
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.
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.
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:
In the left Hosts menu, choose localhost
from the pull-down menu.
Now select Edit Config
Xfer
XferMethod
: make sure Override
is checked, then choose tar
from the pull-down menu.TarShareName
: make sure Override
is checked, then add the directory /var/www/
(click Add
button when done)Override
is checked, then make sure the command is /usr/bin/sudo LC_ALL=C $tarPath -c -v -f - -C $shareName –totals
Save
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.
Browse backups
Browse the contents of the backup, and check that it's ok.
Next, we'll move to backing up another host!