Bareos

From ArchWiki
Jump to navigation Jump to search

Bareos (Backup Archiving Recovery Open Sourced) is a backup software, originally forked from the Bacula project. It is network-based, multi-client and very flexible with an architecture oriented towards scalability. Thus the learning curve might be considered somewhat steep. The project is backed by the commercial company Bareos GmbH & Co. KG, based in Germany.

The open-source project site is located at http://www.bareos.org, the source code is hosted on Github https://github.com/bareos/

Installation

There is a group of packages in AUR that will install the software, but there is some minor manual labour necessary to make it run. It is recommended to use Bareos with PostgreSQL, since use with MariaDB/MySQL was deprecated with version 19.0.

Install the requirements first:

Minimal configuration for Apache HTTP Server and PHP:

  • Follow the steps described in Apache HTTP Server#Using libphp
  • You will also need to enable the rewrite module, to do this, modify /etc/httpd/conf/httpd.conf and uncomment:
    LoadModule rewrite_module modules/mod_rewrite.so
  • Then enable the postgresql extension in PHP as listed in PHP#PostgreSQL

Minimal configuration for PostgreSQL

Make sure both Systemd services are enabled and start them:

httpd.service and postgresql.service

Install the packages from Arch User Repository:

Configuration

These steps mostly follow the Instructions from docs.bareos.org, and include some Arch-specifics.

Setup the Bareos database

As user postgres run:
$ /usr/lib/bareos/scripts/create_bareos_database
$ /usr/lib/bareos/scripts/make_bareos_tables
$ /usr/lib/bareos/scripts/grant_bareos_privileges

Copy default config files to the /etc/bareos/ directory

As root, run these commands:
# cp -r /usr/share/bareos/config/* /etc/bareos/
# chown -R bareos:bareos /etc/bareos

Set the correct DB driver in the catalog config file

edit /etc/bareos/bareos-dir.d/catalog/MyCatalog.conf and replace the line containing the placeholder with this line:
dbdriver = "postgresql"

The Systemd services for Bareos can now be enabled and started:

bareos-dir.service, bareos-sd.service and bareos-fd.service

Configure Web-UI

Use the bconsole tool to add a user for the webui.

  • to start the interactive management shell, run:
    $ bconsole
  • inside the shell, you get a * as prompt, where you can enter the following commands (replace secret with an actual password):
    *reload
    *configure add console name=admin password=secret profile=webui-admin tlsenable=false
    *quit

Configure Apache to include the config for the Bareos Web-UI

  • we need to fix a path in /etc/httpd/conf.d/extra/bareos-webui.conf, inside, replace the two lines:
    Alias /bareos-webui  /usr/share/bareos-webui
    # ...
    <Directory /usr/share/bareos-webui>
with the correct path:
Alias /bareos-webui  /usr/share/webapps/bareos-webui
# ...
<Directory /usr/share/webapps/bareos-webui>
  • in the file /etc/httpd/conf/httpd.conf add the line:
    Include conf.d/extra/bareos-webui.conf
  • restart Apache httpd.serive

Now you can now login to Bareos Webui at http://localhost/bareos-webui/ and login using the account you just created with bconsole.