This article and the image have been created by a joint effort between Bacula Systems S.A, bytemine GmbH, and ProfitBricks GmbH.
We offer an image with a basic Bacula install that should cover everything you need to get started with Bacula Enterprise and cloud storage. We will show you how use Bacula to build a proper and solid backup environment.
This guide is intended to show you around and give some basic examples on how to use Bacula and how to extend your setup. We mainly use Bweb Management Suite in this guide.
Create and start your Bacula server
Get your Bacula Server running in three steps:
- Create a Server in the Data Center Designer and attach two storage volumes. The second storage volume will be automatically integrated by the Bacula server and is used as a backup repository. Recommended size for the storage volumes:
- Volume 1: 30 GB
- Volume 2: 100 GB or bigger according to your backup needs.
- Assign the image
bacula_server$to the first hard disk.
- Provision the server. The password of the bweb interface can be found in the
/rootdirectory in the file new-bweb-password
Once your system is set up, point your browser to:
http://[your IP address]:9180/bweb
Bacula Enterprise overview
Bacula Enterprise has five main components:
- The Director: Supervises all the backup, restore, verify and archive operations.
- The Storage Daemon: Performs the storage of the file attributes and data to the physical backup media.
- The File Daemon or Client: Installed on each machine to be backed up.
- The Catalog: Maintains the file indexes for all files backed up.
- The Console: Allows users to interact with the Director. The console is available in two versions:
- Bconsole: Text-based console interface.
- BWeb Management Suite: Web interface.
It is important to understand some of the basic Bacula architecture and terminology before setting up and using your backup environment, as it will ease your task and will avoid future mistakes.
All of the terms used are explained in the concept guide available here.
If you want to dig deeper check out the main manual available here.
Managing your Bacula setup
There are multiple ways to manage your Bacula setup.
For some administrators the bconsole, a text-based console interface, is the way to go.
However in this guide, we will mostly cover the Bweb Management Suite, as it is a good way to start if you are new to Bacula.
Bweb Management Suite is a web interface that interacts with the Director and offers tools to run backup and restore jobs, to monitor and to configure your Bacula infrastructure.
Bweb also offers a lot of help feautures. If you ever get lost, click on one of the help buttons.
Bacula uses worksets to track the configuration changes you make. Any time you make a change, it needs to be committed in order to go live.
If you discover that you made a mistake during your configuration, you can clear your workset and start over.
The workset is available at Configuration –> Configure Bacula.
Backup a Linux client with Bweb Management Suite
We will begin by configuring and creating your first backup.
Go to Configuration –> Configure Bacula –> Clients.
As you can see there is already a Bacula client,
bacula-fd which has been configured.
There are also some default jobs defined.
To start a job for our
bacula-fd, in the main menu go to Jobs –> Defined Jobs. Choose the job you want to start from the drop-down menu.
Let’s choose the
/usr directory. Click on the Run now button.
Another drop down menu will appear. Choose the default values and click Run now again.
You will be taken to the running job information window. You can click Refresh to watch the progress.
Once the job is complete, an automatic refresh will take you to the job report window, where you can see the outcome of the backup job.
You can also find this information by going to Jobs –> Jobs History and clicking on the status icon.
Adding a new backup client
In our next example we’ll add a new client and configure everything needed for a valid backup. The first step is to install the client software and make it accessible.
Installing a file daemon
Bacula file daemons, called bacula-fd, exist for almost all platforms.
We provide a cd image, available in the image section of your datacenter, which can be mounted onto your server.
Add a cd-rom drive, available in the storage section of your server and assign the “bacula-agent-client.iso” to the cd-rom drive. You need to provision your changes for this to be made available.
On windows systems the cd-rom drive will automatically be detected and mounted. You can now browse the image, choose the required version, execute the installer package and follow the instructions.
On Linux systems the following steps have to be taken:
Mounting the Image
mkdir /mnt/bacula-clients mount -o ro /dev/cdrom /mnt/bacula-clients/
debian based systems:
Example for an Ubuntu14.04 system:
dpkg -i /mnt/bacula-clients/8.2.7/trusty-64/bacula-enterprise-common_8.2.7-1_amd64.deb dpkg -i /mnt/bacula-clients/8.2.7/trusty-64/bacula-enterprise-client_8.2.7-1_amd64.deb apt-get install -f
redhat based systems:
Example for a Centos7 system:
rpm -i /mnt/client-installer/8.2.7/rhel7-64/bacula-enterprise-libs-8.2.7-1.el7.x86_64.rpm rpm -i /mnt/client-installer/8.2.7/rhel7-64/bacula-enterprise-client-8.2.7-1.el7.x86_64.rpm
suse based systems:
Example for a SLES12 system:
rpm -i /mnt/client-installer/8.2.7/sles12-64/bacula-enterprise-libs-8.2.7-1.su120.x86_64.rpm rpm -i /mnt/client-installer/8.2.7/sles12-64/bacula-enterprise-client-8.2.7-1.su120.x86_64.rpm
Be aware that your clients have to be able to resolve the bacula-director via the hostname “bacula”. This can be achieved by adding a DNS ‘A’ record pointing to the IP address of the Director to your own domain name server, or by adding an /etc/hosts entry on your clients.
When adding the client in bweb you have to specify an address where the client is reachable within your network. You can specify an ip address or a fqdn like bacula-client.example.org.
When using a fqdn make sure this is resolvable from your bacula-director.
The bacula-director has to be able to reach the bacula-fd at tcp port 9102. On windows machines this will be blocked by default, if the windows firewall is active.
And your bacula-fd has to be able to reach the bacula storage daemon (bacula-sd) at port 9103. Keep this in mind when putting your system into production.
Overall needed firewall rules:
bacula-dir -> bacula-sd:9103 bacula-dir -> bacula-fd:9102 bacula-fd -> bacula-sd:9103
Configuring the file daemon
Go to Configuration –> Configure Bacula.
On the left hand side you will find wizards to help you in adding a variety of resources.
Click on Add a new Client resource. The wizard will guide you through the next steps.
If yout want to use TLS Encryption for your backups, choose the appropriate certificate(s).
The Bweb Management Suite also offers a wizard for the creation of these certificates at Configuration –> Configure Bacula –> Security Center.
However in our example we will leave this one out.
The wizard will generate the configuration for your client (file daemon).
There are two ways to get this configuration onto your client:
- Copy and paste the output into the
bacula-fd.confof the machine that is going to be backed up.
- Use Bweb Management Suite’s “push configuration” option. Click on edit and deploy this newly created FileDaemon Resource.
Note: Make sure the client is accessible via password or public-key authentication if you plan on using this.
Once this is done go to Workset and commit your changes.
To show some more of the flexibility Bacula offers we will apply a new fileset for your newly created file daemon.
One potential issue is the availability of backup space. For a Linux client it is possible to backup everything starting at the root directory
But do we need all that data?
Many files will be the same, for example if you use the same Linux distribution on several servers.
In most cases this doesn’t matter as we use the deduplication plugin. But if you have a specific server where you need to backup a large amount of data (e.g. everything in
/opt) you should start by adding a new fileset.
In the base setup we have defined a job for
Now we will do the same for
Using the Bweb Management Console, navigate to Filesets and click on Add a new fileset resource:
Enter a name for the fileset and an optional description.
On the next screen you will be prompted with a wide variety of options, in our example we will choose:
Yes – backup all Client content followed by No – Select paths and files
Adjust the config snippet so it looks like the one in the screenshot below and click on Save.
Creating a database backup
Backing up a database is a little more complicated than backing up a filesystem.
Bacula Enterprise has many plugins which can be used. In this example we will take a closer look at the MySQL and the MSSQLplugin.
Begin by creating a new fileset. Choose the MySQL plugin in the list down below.
Fill out the needed information and create the needed permissions and users on your backup client.
Next, create the job.
For Windows systems, Bacula Enterprise uses Volume Shadow Copy Service (VSS) to ensure file system consistency.
Begin by creating a new fileset. Choose the Microsoft VSS MSSQL in the list down below.
Fill out the needed information and create the needed permissions and users on your backup client.
More info on database backups and restoring them can be found here.
Create the job
Next, create and configure a new job resource to use the new fileset.
Go to Configuration –> Configure Bacula and on the left hand side choose Add a new Backup.
After that you will be prompted with more configuration options the newly created job. You can still edit some of the available options.
If everything fits your need, click Save.
Restore files on a Linux Client using Bweb Management Suite
From the main menu go to Jobs –> Web Restore.
Select the client in the Select a client… list and job in the Select a job… list.
The directory tree will automatically show up on the directories panel.
In the directories panel, browse to
The content will show up in the panel directory content.
Highlight some or all of the files in
/usr/bin, and drag them to the restore selection panel located below.
Click Run Restore.
A Restore Selection pop-up will appear.
Note: By default, your recovered files will be sent to
/tmp/bacula-restores/using the value in the Where field.
You can change this to a different path or client if you already have multiple clients configured.
Click on Run to start the job. You will be redirected to a status window. Click the Refresh button to see a green status bar that will show the job progress.
When the restore is successful, you will be redirected to a job status window.
To check for the restored files, e.g. ssh to the bacula-client,change to the path you selected in the restore process, and list the contents.
Example: Backing up a directory with BConsole
This will show you how to use BConsole, a text based console interface used to interact with the Director, to run backup and restore jobs and to monitor your Bacula infrastructure.
To access BConsole, log on your server directly or via ssh.
This scenario uses the folder
/home/bacula located on your server.
First, create a 200Mb file with random data which we will use as an example:
dd if=/dev/urandom of=/home/bacula/random.log bs=100M count=2
In the console, type
run and hit Enter.
Select the job labeled
home by typing the number in front of it.
Review the job settings. Note that this job is an incremental one. You may modify parameters at run time, but in this case just type
yes to start the job.
You should be returned to the prompt and given an indication that the job has been queued, like
Job queued. JobId=x.
To view the status of the job, type
You might see the job listed under Running Jobs or under Terminated Jobs if it is already finished. You can also see scheduled jobs and jobs which were completed in the past.
You can review the job log at any time by using the
You should now have a full backup of your
/home/bacula folder. The next step is to restore this data to the default restore location, currently the folder
Example: Restoring files with BConsole
In this scenario we are restoring data from an existing backup folder from
/home/bacula which we backed up in the previous example.
Here you will see the different ways to find what you want to restore. Type 5, which will select the last backup job run. Note that your backup client is automatically selected since there is only one client available.
Here you will see all data sets that have been run. Select the fileset labeled
home by typing the number before
home to select that folder.
When you hit Enter, Bacula Enteprise Edition will build a file tree from the catalog. This will let you browse through and choose the files you want to restore.
Many standard commands are available such as
ls to list the directory, and
cd to change directories.
/home/bacula begin with:
Type the command:
That will mark the contents of the directory for restore.
When you are done selecting files and folders, type
Review the job settings, most importantly the Where and Restore Client directives. We can leave these alone for now, but if you ever want to restore to a different location or another client machine, here is one way to accomplish it.
yes to run the restore job.
To view the status of the job, type
messages in BConsole to review the job log. Run the
messages command periodically to check the status.
When the job is complete, you will see
exit to close BConsole.