Official website for Linux User & Developer

Create an office backup system with Bacula

by Michael Reed

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

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.

Pages: 1 2
Tags: ,
  • Tell a Friend
  • Follow our Twitter to find out about all the latest Linux news, reviews, previews, interviews, features and a whole more.
    • Pingback: Documentation about Bacula « Giovanni’s Blog

    • James Youngman

      List of configuration files in step 5 is wrong.

    • Pingback: Create an office backup system with Bacula | Linux User | The Daily Kebab

    • apexwm

      Bacula is a very very good backup suite. But this article hits it right on the point, it takes time and patience to set up. However, once it is set up, it will give you years of reliable backups. There are so many scenarios for backups that you do really need to plan out your strategy before you set up Bacula. What many do not know is that Bacula is enterprise grade. It can easily handle media pools, scheduled backups, bare metal backups/restores, and much more. I still prefer to use the commandline app (bconsole) for administering backups, however the front end GUI (bat) is also very good. Just today I had to help with Symantec Backup Exec which is absolute garbage in comparison. Bacula, in comparison to an enterprise grade backup solution, offers way more and is much much more reliable than some proprietary products are. I also find Bacula much easier to use and administer. I highly recommend it, and have used it daily for years with excellent results.

    • Pingback: Links 21/11/2012: GNU/Linux Preinstalled on More Systems, Linux Rootkit Claimed | Techrights

    • Pingback: Office backup walkthrough (Bacula) « 0ddn1x: tricks with *nix

    • protect files

      Very nice write-up. I definitely appreciate this website.
      Stick with it!

    • Maggie

      Hi there every one, here every person is sharing these experience, so it’s nice to read this blog, and I used to pay a visit this weblog all the time.

    • TheMetalHeadBiker

      trying to setup with HP msl2024 tape library. almost a week now, almost setup.
      Do you use tape for your backups?
      need help to configure schedules and filesets.