Installing and Configuring Bacula

Bacula – a set of client-server programs for managing backups.
It consists of the components of Director Daemon (DD), Storage Daemon (SD), File Daemon (FD) and Bacula Console (BC).

To install in Ubuntu/Debian, perform:

sudo apt-get install bacula

During the installation process, the MySQL user’s root password will be requested and a database created, and Postfix installed.

Create directories and set permissions:

sudo mkdir -p /bacula/backup /bacula/restore
sudo chown -R bacula:bacula /bacula
sudo chmod -R 700 /bacula

Open the configuration file DD, for example, in the text editor nano:

sudo nano /etc/bacula/bacula-dir.conf

Let’s find “Standard Restore template” and there where “Where” we change the path:

Job {
Name = "RestoreFiles"
Type = Restore
Client=Blank-fd
FileSet="Full Set"
Storage = File
Pool = Default
Messages = Standard
Where = /bacula/restore
}

Further we find “List of files to be backed up” and a little bit lower where “File =” we specify that it is necessary to copy in a backup copy.

Unnecessary directories can be deleted by adding for example:

Exclude {
File = /bacula
File = /proc
File = /tmp
}

Open the configuration file SD:

sudo nano /etc/bacula/bacula-sd.conf

Let’s find “Devices supported by this Storage daemon” and specify in “Archive Device =” where to store backup copies, for example:

Archive Device = /bacula/backup

We test the correctness of the configuration:

sudo bacula-dir -tc /etc/bacula/bacula-dir.conf
sudo bacula-sd -tc /etc/bacula/bacula-sd.conf

If the command did not say anything, then everything is fine and there are no errors.

Restart bacula services to apply configuration changes:

sudo service bacula-sd restart
sudo service bacula-director restart

Let’s check if all three services are running:

netstat -nlpt | grep [b]acula

Open the console bacula:

sudo bconsole

Check status:

status

We type the command:

label

and specify the name of the backup, then specify 2 that this file.

Run our configured backup process (select 1 and yes):

run

View successful completion messages:

messages

Leave the console bacula:

quit

A backup file should appear in the /bacula/backup directory.

See also:
How to install Bacula-web

How to install Bacula-web

Bacula-Web – a web-based tool for creating reports and monitoring Bacula.

Install the necessary components:

sudo apt-get install apache2 libapache2-mod-php5 php5-mysql php5-gd
sudo a2enmod php5
sudo a2enmod rewrite

Open the PHP configuration file in the editor and specify the time zone:

sudo nano /etc/php5/apache2/php.ini
date.timezone = Europe/Kiev

And also for the directory with Bacula-Web we specify the option:

sudo nano /etc/apache2/sites-enabled/000-default.conf
<Directory /var/www/html/bacula-web>
AllowOverride All
</Directory>

Restart apache2 to apply the changes:

sudo service apache2 restart

Let’s go to the web server directory, download the archive with the latest version of Bacula-web and unpack it:

cd /var/www/html
curl -O http://www.bacula-web.org/files/bacula-web.org/downloads/bacula-web-latest.tgz
mkdir -v /var/www/html/bacula-web
tar -xzf bacula-web-latest.tgz -C /var/www/html/bacula-web

Make a copy of the sample configuration file and open it for example in the text editor nano:

cd /var/www/html/bacula-web/application/config
cp -v config.php.sample config.php
sudo nano /var/www/html/bacula-web/application/config/config.php

Uncomment and configure MySQL parameters:

$config[0]['label'] = 'Backup Server';
$config[0]['host'] = 'localhost';
$config[0]['login'] = 'bacula';
$config[0]['password'] = 'test';
$config[0]['db_name'] = 'bacula';
$config[0]['db_type'] = 'mysql';
$config[0]['db_port'] = '3306';

Since some commands were executed through sudo, we will specify the correct owner of the files:

sudo chown -R www-data:www-data /var/www/html/bacula-web

This completes the installation, you can open the Bacula-Web from the http://SERVER/bacula-web link, and also it is advisable to look at the http://SERVER/bacula-web/test.php test page that will tell you whether all the necessary components are installed and configured.

See also:
Installing and Configuring Bacula