This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Feature: Backup & Data Recovery

Bacula: backups that don't suck

By Robert D. Currier on April 23, 2008 (9:00:00 AM)

Share    Print    Comments   

Good systems administrators know that implementing a robust backup procedure is one of their most important duties. Unfortunately, it's also one of the most complex and least fun. When the phone rings and there's a panic-stricken user on the other end who has just lost a crucial document, you need to be confident that you can promptly recover his missing files. Failure to do so can bring about a speedy end to a promising career in systems administration. So what's a budding sysadmin to do? Download the latest release of Bacula and watch those backup woes disappear into the dark of night.

Led by head developer Kern Sibbald, the Bacula team has built an open source backup solution that is fast, reliable, and exceptionally configurable. Bacula is not a monolithic application, but rather a collection of programs that together provide a robust backup, recovery, and verification toolset suitable for five or 500 systems.

Getting started

For this review we tested Bacula on a single CentOS 4 server using the file system as our backup medium. In our production environment we use Bacula to manage more than 500GB of backups from multiple clients using a tape robot. However, the lengthy process of configuring the tape robot and multiple clients makes this a daunting task for the first-time user. We recommend you stick with a single host for your test drive if you've not worked with Bacula before.

Bacula is available as a package using the standard package management tools yum or apt-get, but we prefer to install the application from source. When you're just getting started with Bacula, building from source gives you a better feel for how the application operates.

After downloading and uncompressing the project's source code you'll need to run the configure script. Bacula's configure script is well written and produces meaningful debug output but requires a large number of command-line settings. To simplify the configuration process the development team has included a suggested list of options that handle most environments. Start with these settings and modify them where appropriate. Case in point: the choice of database. Bacula is a database-driven application and requires MySQL, SQLite, or PostgreSQL. Make sure you have one of these databases installed prior to configuring Bacula. Once you've run the configure script, you can build Bacula using the normal make; make install process.

Next, you must create the Bacula database and tables and set appropriate access permissions. Located in Bacula's bin directory, the script create_bacula_database will create Bacula's database after determining what database you are using. After a successful termination of this script, executing make_bacula_tables will create and populate the database tables. Finally, grant_bacula_privileges will establish the necessary access controls. A word of warning: grant_bacula_privileges creates an unrestricted access policy for the user bacula. You should modify this policy to suit your needs. At a minimum you should consider setting passwords for the MySQL users root and bacula.

After successfully building and installing Bacula, the next step is setting up the config files. That can take some time, but once you've gotten them working you won't have to touch them again except when you add a new client or fileset.

To understand the configuration files, you need to understand how Bacula operates. Bacula comprises four main modules: the director, the storage daemon, the file daemon, and the console. The director is the "boss" of Bacula, providing job scheduling, backup media descriptions, and access control. In a typical Bacula deployment there is only one director.

The storage daemon handles all communications with the defined backup architecture: disks, single tape drives, tape robots, and optical drives. As with the director, there is usually only one storage daemon running per Bacula installation, but the storage daemon may have many backup devices defined.

The file daemon is installed on each client machine and provides the communications link between the storage daemon and the client. It needs access to all files that will be backed up on that client.

The console handles communications between the administrator and Bacula. The adminstrator can start or stop jobs, estimate backup sizes, and review messages from Bacula. Consoles are available that use wxWidgets, GNOME, and Web browsers, but we prefer the TTY version of bconsole.

The bacula-dir.conf file, which controls the director, contains detailed information on the clients to be backed up, job definitions, filesets, and job schedules. One of the outstanding features of Bacula is how close the configuration files as supplied come to being ready to rumble. While a large installation with many clients will require significant editing to the configuration files, our test of Bacula required us to only to give Bacula a list of files to back up.

Bacula typically installs to a subdirectory named bacula in the home directory of the user that is deploying the software. The configuration files are located in the bin subdirectory of /home/user/bacula. Switch to this directory and edit bacula-dir.conf. Search for the section of text beginning with "# By default this is defined to point to the Bacula build directory to give a reasonable FileSet to backup to disk storage during initial testing." Directly below these lines should be: File = /home/username/bacula/bacula-2.2.8. This is the FileSet definition, which controls what files and directories are to be backed up. You may change this definition to a directory of your choice or leave it as is during testing.

Your first backup

By default Bacula uses the filesystem as its backup media. To keep things simple we won't attempt to configure Bacula to use a tape drive -- we'll stick with the preconfigured definitions.

Change directories to Bacula's bin folder. Execute the bacula script with start as an argument: ./bacula start. You should see the following three lines:

  • Starting the Bacula Storage daemon.
  • Starting the Bacula File daemon.
  • Starting the Bacula Director daemon.
  • If Bacula successfully started, that's great -- you're ready to run your first backup. If not, carefully read the error messages and double-check the bacula-dir.conf file. Make sure you've pointed Bacula to the directory you wish to be backed up and that the directory exists and is readable.

    The final step in taking Bacula for a test drive is using the console to initiate the job. From the Bacula bin directory execute the bconsole script. Bconsole should return an asterisk prompt. At the prompt enter run. Bconsole will display a list of defined jobs for you to pick from. Since we're only backing up one machine (our test box) you should only have one job resource to choose from. Select the job and press Enter. Bacula will prompt you with a short list of settings, including client name, backup type (full, differential, or incremental) and the storage device. If all the settings look correct, enter yes to kick off the backup.

    After a short wait, Bacula should return a "backup completed successfully" message with details including the file(s) backed up, the amount of space the backup consumed, compression ratios, and so on. Congratulations -- you've just run your first Bacula backup.

    Only the beginning

    Of course at this point we've barely scratched the surface of Bacula's many features -- the user manual is 665 pages long. New users should read the excellent tutorial before embarking on a multi-client Bacula installation.

    Despite its apparent complexity, Bacula is straightforward to install and configure, comes with excellent documentation, and works right out of the box. If you have been considering moving from basic tar or rdump backup processes to a more substantial package, you can't go wrong by choosing Bacula. It definitely doesn't suck.

    Bob Currier is a senior data engineer at Mote Marine Laboratory in Sarasota, Florida, where he manages a Linux server farm and writes code for a fleet of autonomous underwater vehicles. He is the author of more than 100 features, reviews, and opinion pieces in Linux.com, Network World, ZDnet.com, Smart Computing, and other trade publications.

    Share    Print    Comments   

    Comments

    on Bacula: backups that don't suck

    Note: Comments are owned by the poster. We are not responsible for their content.

    Bacula: backups that don't suck

    Posted by: Anonymous [ip: 64.141.137.164] on April 23, 2008 01:20 PM
    I tried Bacula and I really liked it and wanted to make it work. While I was able to get it setup and working without a problem, I was never able to get to back up fast enough to use in production. Even running everything on a single box, and backing up just that box so no network traffic was involved, the tape write speed was only about 25% of what I would get using tar or dump. Now, I didn't expect it to be as fast as tar, and I know there is more overhead involved, but this was never going to work. I tried hundreds of config tweaks and read every post I could find about Bacula and speed, and nothing seemed to help. Could be my hardware, but I use typical Dell servers, LTO drives, and Red Hat ES 5, so it isn't like I'm running something weird. If anybody has any thoughts on this, I would love to give Bacula another shot.

    #

    Re: Bacula: backups that don't suck

    Posted by: Anonymous [ip: 72.78.223.75] on April 24, 2008 11:01 PM
    Speed? You've got to get onto the Bacula users mailing list. They'll sort you out.

    #

    Bacula: backups that don't suck

    Posted by: Anonymous [ip: 172.25.241.95] on April 23, 2008 03:48 PM
    Ok, so Bacula is relatively easy to setup (for a simple test case, anyway), but what about recovering a file? How easy is that process with Bacula? This review is way too light on details!

    #

    Re: Bacula: backups that don't suck

    Posted by: Anonymous [ip: 60.242.22.11] on April 24, 2008 09:17 AM
    Bacula has a sofisticated way of recovering files. You can search and then restore files and directories based on backup job ID or time. You are also free to choose your destination directory or even a differnt client!

    #

    Re: Bacula: backups that don't suck

    Posted by: Anonymous [ip: 72.78.223.75] on April 24, 2008 11:02 PM
    It's easy to recover files. There is a Catalog which contains a complete list of every file, when it was backed up, from what host, when, and what Volume it is on.

    #

    Re: Bacula: backups that don't suck

    Posted by: Anonymous [ip: 207.245.2.85] on April 28, 2008 04:06 PM
    Recovery is easy from the console and is fully documented (restore command).
    But I recommend you try Webmin once you understand the concept.
    Webmin comes standard with a full blown Bacula module that makes maintenance real easy.

    #

    Bacula: backups that don't suck

    Posted by: Anonymous [ip: 192.168.0.103] on April 23, 2008 05:10 PM
    We use Bacula as our Backup server in our datacenter (more than 10000 servers) and with works flawlessy.

    Only a note DELL SERVER are weird belive it or not, but we stop using DELL SERVER...

    #

    Re: Bacula: backups that don't suck

    Posted by: Anonymous [ip: 83.18.62.158] on April 24, 2008 12:12 PM
    Can you tell me what tape library are you using and how hard is to configure to work with Bacula?
    I'm using now Bacula and backup servers to NAS server but I need some tape backup too and I don't know if some LTO-3 or 4 tape libriaries will work well with Bacula.

    #

    Re(1): Bacula: backups that don't suck

    Posted by: Anonymous [ip: 192.168.23.35] on April 24, 2008 02:29 PM
    I'm using a Dell ML6010 tape vault with 2 LTO3 drives, no problems at all. The drives are fiber-channel connected to a McData FC switch and QLogic FC card in the server (running Debian Sarge). Incredibly fast.

    #

    Re: Bacula: backups that don't suck

    Posted by: Anonymous [ip: 194.158.240.20] on April 28, 2008 02:56 PM
    I would like to talk to a person who is backing up 10,000 servers just to understand your problems (if any).
    Please send me an email at: kern at sibbald.com

    Thanks,

    Kern
    Bacula Project manager

    #

    Bacula: backups that don't suck

    Posted by: Anonymous [ip: 206.39.12.245] on April 24, 2008 02:08 PM
    I tooled around with Bacula and it was fine, but for a small office we ended up using BackupPC http://backuppc.sourceforge.net/ which was IMO easier to setup and recover files.

    #

    Re: Bacula: backups that don't suck

    Posted by: Anonymous [ip: 158.234.64.173] on April 25, 2008 08:02 AM
    We use a combination of BackupPC *and* Bacula.

    We use BackupPC to suck the data from the workgroup's PCs onto the server, then use Bacula to back up the server (including the BackupPC store) to tape. This has the advantage that the backup solution doesn't require the client PCs to be on at particular times to match the backup schedule, whilst still making sure that the PCs are ultimately backed up to tape.

    All-in-all I'm very impressed with Bacula. The user interface isn't as obvious as other solutions I've used (principally BackupEXEC), but if you're comfortable with the command-line and configuring Linux you'll have no trouble with it if you take a little time with the (excellent) documentation.

    #

    Re: Bacula: backups that don't suck

    Posted by: Anonymous [ip: 67.173.12.114] on April 25, 2008 07:54 PM
    We recently moved from backuppc to bacula. backuppc gets crazy with large numbers of files.

    #

    Bacula: backups that don't suck

    Posted by: Anonymous [ip: 192.168.200.50] on April 25, 2008 02:10 AM
    Bacula kicks ass. Seriously. You can take quite a wide variety of exceptionally expensive software that you might intend to buy like Netbackup, and drop it straight into the bin for Bacula.

    The only limiting thing with Bacula I find, in comparison with Amanda, is the backup schedules. It's fine if you want to do a full backup once a month, but putting in logic to back do a full back up once every two or three months requires a lot of convoluted scripting I'm not keen on. Anybody have any tips on getting more out of Bacula schedules?

    #

    Bacula: backups that don't suck

    Posted by: Anonymous [ip: 24.248.89.66] on April 25, 2008 04:14 PM
    I'd love to bring free source backup solutions into our Data Center. In order for me to have a chance to move this to a data center environment, I'd need the following:

    1. I'd need the capability of bare metal restore
    2. What also would help me sell it would to have CDP (Continuous Data Protection) our current solution also has that

    Also what is the status of the windows version? I got the impression of some licensing weirdness with it.

    #

    Re: Bacula: backups that don't suck

    Posted by: Anonymous [ip: 70.126.254.76] on April 27, 2008 09:35 PM
    Whoops. There's that 800 pound gorilla in the room again. Quick everyone look away. Look away.

    The feature set, performance and general usability of Bacula pales in comparison to your Backup Exec solution.

    I'm not sure why no one is willing to compare their open source solutions to the various mainstream industry standards like Backup Exec. Perhaps it is a lack of experience with mainstream products or perhaps it is FOSS zealotry that we love so much.

    The important thing to remember is that you must be able to restore your data when needed. This is almost always at the most inconvenient time and under the most adverse conditions. Your backup software needs to be bulletproof and your familiarity with restoring single files, databases or bare metal restores to different hardware needs to be intimate. Anything less than that is just begging to be fired!

    #

    Re(1): Bacula: backups that don't suck

    Posted by: Anonymous [ip: 67.173.12.114] on April 28, 2008 03:40 AM
    Zealotry? Some people find it difficult to make their point without using emotionally loaded words... How about this?

    I use bacula

    Files go in.

    Files come out.

    I get notifications on backup failures (which I've only had 2 of, all related to the tape in the robot)

    Doesn't get much simpler then that, and its exactly what I need for a backup solution.

    #

    Re(1): Bacula: backups that don't suck

    Posted by: Anonymous [ip: 192.168.200.44] on April 28, 2008 09:17 PM
    Wonderful. There's yet another terrified user of expensive 'enterprise' software there who believes we're all going to be fired if we don't use it.

    #

    Re: Bacula: backups that don't suck

    Posted by: Anonymous [ip: 194.158.240.20] on April 28, 2008 02:53 PM
    1. I'd need the capability of bare metal restore

    Bacula has a bare metal restore, but unfortunately, it works on RH type distros and doesn't work on Debian.
    However I hopt to correct that in the next release or two.

    2. What also would help me sell it would to have CDP (Continuous Data Protection) our current solution also has that

    No, Bacula does not have CDP, and it probably will not for the next few releases ...

    Also what is the status of the windows version? I got the impression of some licensing weirdness with it.

    It is weird only because we use Volume Shadow Copy (VSS -- i.e. open file backup) and VSS uses Microsoft code that is
    forbidden for us to release. However, we show you how to get Microsoft's code if you *really* want to build the Win32 FD from
    source. All *our* code is GPLv2 ...

    Regards,

    Kern

    #

    Bacula: backups that don't suck

    Posted by: Anonymous [ip: 194.158.240.20] on April 28, 2008 02:58 PM
    Thanks for the article.

    Kern
    Bacula Project manager

    #

    Re: Bacula: backups that don't suck

    Posted by: Anonymous [ip: 70.104.164.69] on April 28, 2008 10:16 PM
    Thank *you* for the software!

    Bob Currier

    #

    Bacula: backups that don't suck

    Posted by: Anonymous [ip: 203.219.177.171] on April 29, 2008 12:55 PM
    I think bacula is bundled with Ubuntu 8.04 server. Perhaps that deserves a mention?

    #

    This story has been archived. Comments can no longer be posted.



     
    Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya