Create an office backup system with Bacula

Michael Reed shows us how to automate backups from a collection of computers on your home or office network using Bacula

Bacula Office Backup

Putting a good backup system in place can be one of the best investments of time you can make when managing a network of computers, but it can also be time-consuming to keep running. Bacula makes it easy to automate your backup policy. The clients (called ‘file daemons’ in Bacula-speak) can run on a variety of platforms, which makes Bacula potentially a one-size-fits-all solution.

Frankly, Bacula is quite complicated to set up on the server side of things, and that’s why we’ve created this guide. For this tutorial, we’ll start with a local backup of a single system, and then we’ll add other clients and back them up too. There are GUI tools to help you work with a Bacula system, and we’ll cover them, but they tend to be oriented towards monitoring and maintaining a working system. For that reason, this tutorial focuses on setting up the system manually by editing the config files and using the command console, giving you a clear image of how everything works. Most of the configuration happens in three configuration files – and thankfully, these are well commented. With our help, you’ll soon be designing a Bacula scheme that is tailored to your own unique requirements.



Step by Step

Step 01

Get community support

Bacula’s flexibility comes at a cost, in that it can be quite complicated to set up and operate. We’d recommend visiting the documentation section of the website and maybe joining the IRC channel (#bacula on before starting.

Bacula Office Backup
Install MySQL3

Step 02

Install MySQl3

Start by installing MySQL with ‘sudo apt-get install mysql-server’. You’ll be prompted to make up a password. Do so and make a note of it. You’ll have to note a few passwords in this tutorial. Test it with ‘service mysql status’.

Step 03

Install Bacula (server and client)

Install the server components of Bacula with ‘sudo apt-get install bacula-server bacula- client’. Don’t use a GUI package manager because the installation script will prompt you for the MySQL password, a new password for Bacula and other things. Allow it to set up Bacula Director.

Step 04

Create directories

Create a directory to contain backup files and another to contain restores: ‘sudo mkdir /backups /restore’. Set permissions for both directories with: ‘sudo chmod 777 / backups /restore’.

Step 05

Edit config files

By default, all Bacula files are accessible only to the root user. The files that we are going to be working with are all located in the /etc/bacula directory: bacula-dir.conf, bacula-sd.conf and bacula-dir.conf. Type ‘sudo gedit /etc/bacula/ *.conf’ to open them all.

Step 06

Configure restore directory

The Director is the program that controls all of the daemons that carry out the actual backing up. Its config file is bacula-dir.conf. Specify the directory for restored files by locating the section that begins ‘Name = “RestoreFiles” ’ and changing the ‘Where =’ path to ‘/restore’.

Step 07

Configure file set

Go to the ‘FileSet {’ section and add extra directories that you would like to back up by adding extra ‘File=’ parameters. By default, the system will attempt to back up /usr/sbin for initial testing. Consider adding another, smallish directory from within your home directory.

Step 08

Configure storage daemon

The storage daemon is the part that actually stores the files on your server, and its config file is called bacula-sd.conf. Some of this config file is set up for tape backup, and we’ll be ignoring that for this tutorial. Point ‘Archive Device =’ to ‘/backups’.

Step 09

Test config files

Each of the configuration files has a corresponding test utility. These are called bacula-dir, bacula-fd and bacula-sd. Run them with the -t and -c parameters. So, for example, run ‘sudo bacula-sd -t -c bacula-sd.conf’ to flag any errors. No output means no errors.

Warning: file_get_contents( failed to open stream: HTTP request failed! HTTP/1.0 500 Internal Server Error in /var/www/html/ on line 9