Tux + Linux Items

Help promote Linux and FOSS at the
Sample T-Shirt from the ERACC Cafe Press Store
ERACC Cafe Press Store

Linux: Bacula is for Everyone* (backup software)

* Well, almost everyone. If one just wants to backup a few files on random occasions then Bacula is not the software to use. But if one wants to run regular, scheduled backups to just about any type of storage media then Bacula will most definitely work.

I must admit, I have been a tar + cron Unix guy for over 20 years and never really considered anything else necessary for backups on Unix, until now. I recently decided to learn how to use Bacula to implement it for one of our clients that needs a new backup solution for their shiny, new PC systems and Linux server. The server is running Mandriva 2010.2 Linux with SAMBA and can easily handle adding Bacula to the mix. The PC systems are running Windows 7 Professional 64-bit, for which Bacula has a solution. During this process I have decided I can now add Bacula to my short list of "must have" Unix software for small, medium and large businesses.

In all honesty, I am still a Bacula novice. However, I am not a backup software novice and can already see, based on my slightly over two weeks of working with Bacula, that this is some excellent, well designed and well documented software. Bacula is also complex software and takes a willingness to study and learn before one can get one's mind around how it all works. Here is a PDF of a simple diagram I created based on my experience with Bacula for those who like to see graphics: Bacula Components

It can be daunting to begin working with Bacula if one is completely new to business backup systems, especially enterprise grade business backup systems. But with some study of the Bacula documentation, experimentation with several non-critical test backups and the Webmin (Warning!) Bacula module, the work to get several PC systems backed up on a regular schedule can be much easier. In my experience, it is easier than running something like Retrospect Express, a typical small business backup solution, on each PC.

Here is how it works on Linux in a nutshell. One installs an SQL database back-end, such as MySQL or PostgreSQL. Then one installs the Bacula components from one's distribution or downloads and compiles the Bacula components oneself. (The former method is recommended unless one needs to compile Bacula from source for some reason.) Then, one runs these commands to set up the Bacula database (In our system these are in /usr/lib/bacula and are symbolically linked to the actual script to run for the database chosen.):

  • create_bacula_database
  • make_bacula_tables
  • grant_bacula_privileges

One's Linux distribution may or may not run these for one. By default the database is password-less. One may or may not wish to add a password to the Bacula database. If one does, then the password needs to be used in the Director configuration file.

Then the configuration files need to be set up for one's system and LAN. The files one needs to edit are bacula-dir.conf, bacula-fd.conf, bacula-sd.conf, and bconsole.conf. (In our system these are in /etc/bacula). This can be a bit confusing at first, but experiment and keep reading the documentation. Eventually the way it works should "click" in one's mind. Since Bacula integrates all the components at the Director, once all the system configuration files are done one can then do all the work to create storage volumes, create backup jobs, and so on using the bconsole program at the command-line or the Webmin Bacula module in a web browser. We recommend Firefox.

Here are some example files from my working test setup here at the ERACC office.

File Daemon, bacula-fd.conf, on a PC to be backed up:

#
# List Directors who are permitted to contact this File daemon
#
Director {
  Name = router-dir
  Password = "BigSecretStuff"
}

#
# Restricted Director, used by tray-monitor to get the
#   status of the file daemon
#
Director {
  Name = era4-mon
  Password = "MySecretStuff"
  Monitor = yes
}

#
# "Global" File daemon configuration specifications
#
FileDaemon {                          # this is me
  Name = era4-fd
  FDport = 9102                  # where we listen for the director
  WorkingDirectory = /var/lib/bacula
  Pid Directory = /var/run
  Maximum Concurrent Jobs = 20
  FDAddress = 10.10.10.4
}

# Send all messages except skipped files back to Director
Messages {
  Name = Standard
  director = router-dir = all, !skipped, !restored
}

The passwords can be any text string one desires, including random characters, as long as they match when each daemon tries to contact one another.

Storage Daemon, bacula-sd.conf, on the system handling the storage media:

Storage {                             # definition of myself
  Name = router-sd
  SDport = 9103
  WorkingDirectory = /var/lib/bacula
  Pid Directory = "/var/run"
  Maximum Concurrent Jobs = 2
  SDAddress = 10.10.10.100
}

#
# List Directors who are permitted to contact Storage daemon
#
Director {
  Name = router-dir
  Password = "BigSecretStuff"
}

#
# Restricted Director, used by tray-monitor to get the
#   status of the storage daemon
#
Director {
  Name = router-mon
  Password = "OurSecretStuff"
  Monitor = yes
}

Device {
  Name = Data_r0
  Media Type = File
  Archive Device = /data_r0/bacula
  LabelMedia = yes;                   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;               # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
}

#
# Send all messages to the Director,
# mount messages also are sent to the email address
#
Messages {
  Name = Standard
  director = router-dir = all
}

The Director configuration file, bacula-dir.conf, is rather large, so I will just post some of the parts that one needs to edit to get started.

The section of bacula-dir.conf that tells the Director about its own setup:

Director {                            # define myself
  Name = router-dir
  DIRport = 9101
  QueryFile = "/etc/bacula/scripts/query.sql"
  WorkingDirectory = /var/lib/bacula
  PidDirectory = "/var/run"
  Maximum Concurrent Jobs = 2
  Password = "BigSecretStuff"         # Console password
  Messages = Daemon
  DirAddress = 10.10.10.100
}

The Name should be unique.

The section of bacula-dir.conf where one will tell the Director the database password, if one set a database password. Otherwise, leave this section alone.

# Generic catalog service
Catalog {
  Name = MyCatalog
  dbname = "bacula"; dbuser = "bacula"; dbpassword = "dbSecretStuff"
}

Here is the bconsole.conf configuration file:

#
# Bacula User Agent (or Console) Configuration File
#

Director {
  Name = router-dir
  DIRport = 9101
  address = 10.10.10.100
  Password = "BigSecretStuff"
}

As stated near the beginning of this article, Bacula is well documented. One should be ready to spend some time reading documentation and looking at the configuration files before starting on a Bacula implementation. Once one does "get it" then using Bacula to backup one, dozens or hundreds of PC systems should be easy to understand and use.

Warning! We strongly recommend reading the documentation and learning how things work at the command-line before using Webmin! Webmin cannot substitute for lack of knowledge. (Go back.)

analytics
Powered by web analytics statistics.

Notice: All comments here are approved by a moderator before they will show up. Depending on the time of day this can take several hours. Please be patient and only post comments once. Thank you.

Share

4 comments to Linux: Bacula is for Everyone* (backup software)

  • Homer

    Just moved from HP's Data Protector Express (awful software), to bacula and love it.  Finally a full feature free backup solution that works and I don't have to worry about it getting incremental backups messed up and wanting to re-backup 5TB of data!
    Brilliant software and one of the reasons Open Source is superior to commercial software in so many ways.

  • […] Linux: Bacula is for Everyone* (backup software) Here is how it works on Linux in a nutshell. One installs an SQL database back-end, such as MySQL or PostgreSQL. Then one installs the Bacula components from one’s distribution or downloads and compiles the Bacula components oneself. (The former method is recommended unless one needs to compile Bacula from source for some reason.) Then, one runs these commands to set up the Bacula database (In our system these are in /usr/lib/bacula and are symbolically linked to the actual script to run for the database chosen.): […]

  • Charles

    I've been using bacula at work for the past 3 years and it has been great. I have the server components running on Linux but have Mac (10.3-5), Linux and Windows clients backing up to it. We mostly have Macs so its ability to backup resource forks was a life saver.

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Follow the directions below to post a comment if you are human. After 3 failed tries reload the page to start with new images.