Installing Bacula and Webacula on Fedora

Bacula is one of the most widely used enterprise backup solutions for Linux, allowing systems administrators to automate backups using an array of tools. Bacula bacula-logoallows administrators to backup files from multiple clients to several different types of storage devices, including tape, raid, removable storage and networked storage. Webacula is a web application which allows you to monitor and control your Bacula jobs from a browser.


Before we begin you will need to make sure that you have Apache, PHP and MySQL installed in order to use the Webacula web interface. Ensure that you have the Apache and MySQL services running and that you have your username and password setup for the root user by using the following commands.

service httpd start
service mysqld start
mysqladmin –u root password “yourpassword”
chkconfig mysqld on

You can test if your privileges are working by using

mysqld –u root -p

Next install the following Bacula and Webacula packages using yum

yum –y install bacula-storage bacula-storage-mysql bacula-docs bacula-director-mysql bacula-console-gnome bacula-console bacula-client
 bacula-traymonitor webacula

Once you have all the packages installed, you will now need to browse to the installation directory.

Cd /usr/libexec/bacula

Using your MySQL username and password which you setup earlier you will now need to run the following shell scripts. As the names suggest these shell scripts are using your MySQL privileges to setup a new database, tables, and the username “webacula” for your database.

./grant_mysql_privileges -u root -p
./create_mysql_database -u root -p
./make_mysql_tables -u root -p
./grant_bacula_privileges -u root -p

Next you will need to browse to your /etc/bacula directory and modify all the addresses to localhost and passwords in the configuration files to something you will remember. You should also modify bacula-sd.conf Device {} section to contain the directory you want to save your backups to (by default it will backup to /tmp).

Next you will need to start the Bacula services. If the service fails to start it is because you have not modified the password or address in the corresponding configuration file.

Service bacula-dir start
Service bacula-fd start
Service bacula-sd start

Now that you have bacula running, you will need to browse to the /usr/share/webacula directory to configure webacula.

cd /usr/share/webacula/install

You will need to check if you have all the requirements first by using the php file supplied.


If you are using MySQL you will not need the Postgre requirements. Apart from that, if you have all the requirements you can continue configuring Webacula using the following commands:

./ -u root –p
./ -u root –p

Webacula will create a new username and password for accessing the database in the file, which you should ideally change. The default username and password set for MySQL is:

Username: wbuser

Password: wbpass

You will need to modify the /usr/share/webacula/application/config.ini file if you decide to change this password. You will also need to modify bacula.bconsole in this file to point to /usr/sbin/bconsole instead of /sbin/bconsole.

Now that you have modified the configuration file for webacula, it’s time to test if the installation was successful by visiting http://localhost/webacula from your local machine. If you are able to browse to the page without any errors then your installation was successful and you can move onto the next section.

If your page comes up with the error:

ERROR: There was a problem executing bconsole. See below. 
 ERROR Command: 
 /usr/bin/sudo /usr/sbin/bconsole -n -c /etc/bacula/bconsole.conf 


You can fix this by modifying bacula.sudo = “/usr/bin/sudo”to bacula.sudo = “” and modifying the /etc/bacula/bconsole.conf to run as the apache user with the following command.

chown apache /etc/bacula/bconsole.conf




Now that we have installed both of our applications, it’s time to start learning about some of the basic features of Bacula so that we can start using Webacula. bacula-logoLet’s start out with learning a bit more about the three main services responsible for running Bacula.



Bacula director or bacula-dir is the service responsible for monitoring, recovering and verifying backups. The backup director configuration file /etc/bacula/bacula-sd.confcontains the Job information which will be used to schedule jobs.

Bacula File Daemon

Bacula File Daemon or bacula-fd is the service responsible for reading, writing and verifying files which are being backed up to another directory over the network. Each client that is being backed up will need to have the Bacula file daemon installed.

Bacula Storage Daemon

Bacula Storage Daemon or bacula-sd is the service which controls the storage devices which the data will be backed up to. The /etc/bacula/bacula-sd.conf configuration file is used for specifying what type of media you are backing up your data to and how it is going to be backed up.

Bacula Console

The Bacula console or bconsole, although not a service, is an important application used for relaying information between the Bacula console and Bacula director. In this tutorial we will be using the Bacula console through the Webacula interface.

Backup levels

Almost with every other program used to backup data, there are three main types of backup levels. When adding your jobs to the Bacula director, Bacula allows you to set your backup level to one of three levels.

Full backup

A full backup is as the name suggests a complete backup of all the contents on the specified drive or directory. Full backups are typically the least efficient of all the backups and require the largest amount of disk space.


An incremental backup is a backup which allows you to backup only the files which have been modified sine the last backup.


A differential backup is a backup which only backs up the files which have modified since the last full backup.

Scheduling your first job

Now that you know a bit more about Bacula, some of the features of Webacula will now be easier for us to learn to use. When first installing Bacula, two backups will be scheduled by default: these are BackupClient1 and BackupCatalog. The client is the machine which has bacula-fd installed on it, which in this case is the machine we are using. The catalog is a list of all the files and details about each file stored in the database, the catalog keeps track of size and modification date in order to indentify if a file needs to be backed up again if you’re using a incremental or differential backup.

For this tutorial we will just be doing a simple backup of the client to the /backup folder which we setup earlier during the installation. So let’s open up our bacula-dirs.conf file and take a look a closer look at our default jobs.

We can skip the Director section at this stage and move directly onto the JobDefs section. The JobDefs section defines how each job will run, you can create multiple JobDefs or you can just stick with the default one. In this case we will use the default JobDefs, but you should copy and paste the block of code and comment out of the second block so that you have a reference incase you make a mistake or want to revert back.

JobDefs { Name = “DefaultJob” Type = Backup Level = Incremental Client = bacula-fd FileSet = “Full Set” Schedule = “WeeklyCycle” Storage = File Messages = Standard Pool = Default Priority = 10 }

Let’s say for this tutorial that we want an incremental backup of all text files on our client inside the /var/www/html directory to be performed once weekly. Taking a look at our default job definition we can see that the level is already incremental, but our FileSet is set to Full Set. The Full Set is a backup of all the files on the client inside the /usr/sbin directory, which is not what we want. If we take a look below we can see our default FileSet, so let’s copy and paste this file set and create a new one with a few different values.

FileSet { Name = “Full Set” Include { Options { signature = MD5 } File = /usr/sbin } Exclude { File = /var/spool/bacula File = /tmp File = /proc File = /tmp File = /.journal File = /.fsck } }

The first thing we want to do is modify the name of the file set to something suitable such as Apache Text, we also need to modify the File directory to /var/www/html. Next we need to add a few extra lines to Include {} which tells Bacula that we only want to include text files. We can do this by adding wildfile = “*.txt”. It should look something like this when you’re done.

FileSet { Name = “Apache Text” Include { Options { signature = MD5 wildfile = “*.txt” } File = /var/www/html } }

Now we will need to go back to the JobDefs section and modify the following lines to suit our example backup scenario.

JobDefs { Name = “Apache” Type = Backup Level = Incremental Client = bacula-fd FileSet = “Apache Text” Schedule = “WeeklyCycle” Storage = File Messages = Standard Pool = Default Priority = 10 }

Next we need to create the job, give it a new name and tell it which JobDefs to read. It’s also a good idea to give the bootstrap a new name in case you want to run multiple jobs. The bootstrap file contains statistical information about what files are to be restored and can be read through a text editor once created.

Job { Name = “BackupApacheText” JobDefs = “Apache” Write Bootstrap = “/var/spool/bacula/Apache.bsr” }

Once you have finished writing to bacula-dirs.conf, be sure to save the file and restart the bacula director service using “service bacula-dir restart” and your job will now be setup.

Monitoring your jobs

You can now start using Webacula to monitor and view running jobs, storage and client information. Using your browser, open up http://localhost/webacula and browse to the job section. From here you will be able to force your job to start, restore your last backup or view errors which have happened during your backup. If you click on run under jobs you will be able to schedule a time for your job to run.

Before you run your first job you will need to go into the Bacula Console under desktop or bconsole from the terminal and create a label for your new volume. Simply typing in label, giving it a name and putting it in the default pool will be enough to allow you to run your first job. You can modify details about the volume later on through the Bacula console or through the Pool/Volume section of Webacula.

The first time you run your job, the backup will be a full backup, so depending on how many files you have means it may take longer. However, any additional backups you run will be incremental, so you can expect the incremental backups to be a lot quicker.


Categories: linux

Comments are closed.