Installing Bacula open source backup solution on CentOS/RHEL, Debian, Ubuntu

Overview

Bacula is a set of Open Source, computer programs that permit you (or the system administrator) to manage backup, recovery, and verification of computer data across a network of computers of different kinds. Bacula is relatively easy to use and efficient, while offering many advanced storage management features that make it easy to find and recover lost or damaged files. In technical terms, it is an Open Source, network based backup program. (Source www.bacula.org)

Installing Bacula open source backup solution on CentOS/RHEL, Debian, Ubuntu

Install some dependencies

On Debian, Ubuntu system


$ sudo su -
# apt-get install mysql-server mysql build-essential libmysqlclient15-dev ncurse*

On CentOS/RHEL, Fedora


# yum install mysql-devel mysql-server mysql ncurse* gcc gcc-c++ autoconf automake

Download the latest stable version and untar the package.


# wget http://sourceforge.net/projects/bacula/files/latest/download?source=files
# tar zxvf bacula-5.2.12.tar.gz

Lets compile the package, run configure, make and make install


# cd bacula-5.2.12
# CFLAGS="-g -Wall" ./configure --enable-smartalloc --with-mysql --enable-conio
# make
# make install
# make install-autostart

Create user database and tables for bacula, enter root password when prompted.


# cd /etc/bacula
# ./grant_mysql_privileges -p
# ./create_mysql_database -p
# ./make_mysql_tables -p

Now if you wish to install Bacula Administration Tool use yum to do that. BAT does not change much from version to version thus the easiest way is to use yum or apt.

On CentOS/RHEL, Fedora


# yum -y install bacula-console-bat

On Debian, Ubuntu


# apt-get install bacula-console-qt

Open the director config file and set the following values.


# vi /etc/bacula/bacula-dir.conf
# line 22: set password and director name
# line 110: Set the backup target on Client, the backup will be taken under this directory
# line 156: setup client name and address
# line 185: set storage Daemon's hostname and password, in our case the storage daemon and director is installed on the same host.
# line 232: set username dbname and password for bacula on MySQL
# line 281: tweak the pool definition or leave it default

Open storage daemon config file and set director name and password


# vi /etc/bacula/bacula-sd.conf

Open the bconsole config file and set director hostname and password.


# vi /etc/bacula/bconsole.conf

Start the services and make sure these start on server reboots


# /etc/init.d/bacula-dir start
# /etc/init.d/bacula-sd start
# chkconfig bacula-dir on
# chkconfig bacula-sd on

On the Client System you wish to backup, bacula-fd needs to be installed.


# wget http://sourceforge.net/projects/bacula/files/latest/download?source=files
# tar zxvf bacula-5.2.12.tar.gz
# ./configure --enable-client-only
# make
# make install
# make install-autostart-fd

Open the bacula-fd config file using an editor and set Director name and password.


# vi /etc/bacula/bacula-fd.conf

Open the bconsole config file and set director hostname and password.


# vi /etc/bacula/bconsole.conf

Restart bacula-fd service and make sure it starts automatically on server reboots.


# /etc/init.d/bacula-fd start
# chkconfig bacula-fd on

To run backup using cli execute the bconsole binary either on client or use BAT for GUI

bacula01 300x169 Installing Bacula open source backup solution on CentOS/RHEL, Debian, Ubuntu