Menu

How To Setup Bareos Backup Solution On CentOS 7

Bareos (Backup Archiving Recovery Open Sourced) is a reliable, cross-network Open Source Software for backup, archiving and recovery of data across all common operating systems (Linux, UN*X, MacOS, Windows). With Bareos file or rather directory trees can be configured centrally and then automatically and periodically be saved as a full, differential or incremental backup onto hard drives, tape drives or into the cloud. It also offers its own web frontend, by using web frontend administrators or users can select files for recovery. Due to open interfaces Bareos can easily be extended with scripts or plugins, e.g. to run application-specific commands before, during or after a backup. Plugins for backing up MySQL/MariaDB, LDAP, MSSQL or VMWare Snapshots incrementally are already possible using bareos.

Bareos Components

The basic structure of Bareos consists of a control unit, the Backup Director, one or more Storage daemons, and the File daemons on the clients to be backed up.

The File daemons are responsible for backing up the data from the client or restoring the data on the client again. This daemon runs permanently on the clients and carries out the Director’s instructions.

The Director is the controller: It contains all the logic and accounts for most of the settings.

Installing Bareos Backup:

On RHEL 7 and CentOS 7 bareos is available through the RHEL Server Optional channel. On CentOS 7 and Fedora is it included on the main repository which you can get using below command.

After downloading the repository, use below command to install Bareos along with its dependent packages using the command below.

# yum install bareos bareos-database-mysql

Press ‘y’ key to continue installation of following shown packages.

You have the option whether to choose mysql database or postgresql along with bareos, but in this article we are using the MySQL database.

Prepare Bareos database:

First of all make sure that your preferred database should be installed and running. The easiest way to set up a database is using a system account that have passwordless local access to the database. Often this is the user root for MySQL or the user postgres for PostgreSQL.

Let’s run the below command to install MySQL/MariaDB on your CentOS 7 server if its not already installed on your system and then start its services.

# yum install mariadb-server

# systemctl start mariadb.service

# systemctl enable mariadb.service

Make sure, that ‘root’ has direct access to the local MySQL server. Check if the command mysql connects to the database without deﬁning the password. This is the default on RedHat and SUSE distributions. On other systems (Debian, Ubuntu), create the ﬁle ‘~/.my.cnf’ with your authentication informations like given below.

Zend Framework 2.2.x or later. Note: Unfortunately, not all distributions oﬀer a Zend Framework 2 package. The following list shows where to get the Zend Framework 2 package.

Run the command below to install Apache and PHP on your CentOS 7 server.

# yum install httpd php php-cli php-common

Add the Bareos repository that is matching your Linux distribution, here we will be using the ‘yum’ command to installa the latest epel release.

# yum install epel-release

Now you can install the Barios-webui with the help of below command, which will be install barios-webui along with its required packages.

# yum install bareos-webui

Barios-webui Configurations:

The bareos-webui package provides a default console and proﬁle conﬁguration under ‘/etc/bareos/bareos-dir.d/’, which have to be included at the bottom of your ‘/etc/bareos/bareos-dir.conf’ and edited as per your needs.

Save and close the configuration file and then restart Apache web services.

#systemctl restart httpd

# systemctl restart bareos-dir

To install bareos-webui on a system with SELinux enabled, the following additional steps have to be performed to Allow HTTPD scripts and modules to connect to the network.

#setsebool -P httpd_can_network_connect on

Accessing Bareos-webui:

Now open your browser of choice following the FQDN or your servers IP provided by your login credentials deﬁned in your Bareos Director Console conﬁguration.

http://your_servers_ip/bareos-webui/

login: user1
passwd: CHANGEME

You can change these credentials in file ‘/etc/bareos/bareos-dir.d/webui-consoles.conf’.
After providing the successful login credentials, you will be directed towards its dashboard where you can see staus of your current and previous backups.

Using bconsole:

The bconsole runs the Bareos Console program, once you connected to the bconsole, type ‘help’ to see a list of available commands.

#bconsole

The most useful commands among the above list are given below.

* show filesets

* status dir

* status client

* status storage

Now Lets run the backup Job using the ‘run’ command as shown.

*run

Conclusion:

That’s it we have successfully installed and setup Bareos Backup solution on CentOS 7. Bareos is an Open source backup solution with its awesome features. Bareos is a fork of Bacula with offers prebuild binaries for all major Linux distributions and Windows. It also includes numerous new features like Passive Clients, Copy Jobs between different storage daemons, NDMP backup, and so on. Everything is developed as Open Source. Let’s play with Bareos and do not forget to share your experience while backing up and restoring your backup.