Getting started with Bacula

Exclusive offer: get 50% off this eBook here
Network Backup with Bacula How-To [Instant]

Network Backup with Bacula How-To [Instant] — Save 50%

Create an autonomous backup solution for your computer network using practical, hands-on recipes with this book and ebook

$14.99    $7.50
by Eugene Pankov | February 2013 | Open Source

The author of the book Network Backup with Bacula How-To, Eugene Pankov, explains how to set up the simplest Bacula Director and Bacula Storage installations and how the bconsole utility can be used to monitor and interact with daemons through this article.

(For more resources related to this topic, see here.)

Getting ready

You will need root access to a BSD or Linux machine where you will be installing the Bacula server. This article is using Debian Linux 6.0 as an example. The machine is assumed to have an IP address of 10.10.1.100.

How to do it...

To install Bacula Director and Bacula Storage, perform the following steps:

  1. Log in to the target machine using SSH client or a physical console.

  2. Install the Bacula Director and Bacula Storage daemons plus the bconsole utility, using the package manager of your choice as follows (this example uses APT):

    $ apt-get install bacula-director-sqlite bacula-sd-sqlite baculaconsole

  3. Now, replace the contents of the /etc/bacula/bacula-dir.conf file with the following code:

    Director { Name = debian-dir DIRport = 9101 QueryFile = "/etc/bacula/scripts/query.sql" WorkingDirectory = "/var/lib/bacula" PidDirectory = "/var/run/bacula" Maximum Concurrent Jobs = 1 Password = "password-dir" DirAddress = 10.10.1.100 } Storage { Name = LocalStorage Address = 10.10.1.100 SDPort = 9103 Password = "password-sd" Device = FileStorage Media Type = File } Job { Name = DefaultJob Type = Backup Messages = Standard Pool = Default Client = DefaultClient Fileset = DefaultFileset Storage = LocalStorage } Client { Name = DefaultClient Address = 10.10.1.100 Password = "" Catalog = DefaultCatalog } Fileset { Name = DefaultFileset } Catalog { Name = DefaultCatalog dbname = "bacula"; dbuser = ""; dbpassword = "" }

    The highlighted lines contain information you might want to alter, such as passwords and network addresses.

  4. Replace the bacula-sd.conf file with a new one that has the following code:

    Storage { Name = LocalStorage SDPort = 9103 WorkingDirectory = "/var/lib/bacula" Pid Directory = "/var/run/bacula" Maximum Concurrent Jobs = 20 SDAddress = 10.10.1.100 } Director { Name = debian-dir Password = "password-sd" } Device { Name = FileStorage Media Type = File Archive Device = /tmp/test-backups LabelMedia = yes; Random Access = Yes; AutomaticMount = yes; RemovableMedia = no; AlwaysOpen = no; } Messages { Name = Standard director = debian-dir = all }

  5. And finally, the bconsole.conf file would look as follows:

    Director { Name = localhost-dir DIRport = 9101 address = 10.10.1.100 Password = "password-dir" }

    Note that appropriate passwords should match in both files.

  6. Now restart the daemons as follows so the new configuration is applied:

    $ /etc/init.d/bacula-director restart $ /etc/init.d/bacula-sd restart

  7. Create a directory for backup storage mentioned in the bacula-sd.conf file as follows:

    $ mkdir /tmp/test-backups

    Now you should be able to use the bconsole utility to inspect the status of Director and Storage using the status director and status storage commands as follows:

    $ bconsole Connecting to Director 10.10.1.100:9101 1000 OK: debian-dir Version: 5.0.2 (28 April 2010) Enter a period to cancel a command. *status director debian-dir Version: 5.0.2 (28 April 2010) i486-pc-linux-gnu debian squeeze/sid Daemon started 07-Jun-12 13:54, 0 Jobs run since started. Heap: heap=245,760 smbytes=48,038 max_bytes=48,940 bufs=109 max_ bufs=119 No Scheduled Jobs. ==== Running Jobs: No Jobs running. ==== *status storage Automatically selected Storage: LocalStorage Connecting to Storage daemon LocalStorage at 10.10.1.100:9103 LocalStorage Version: 5.0.2 ... Running Jobs: No Jobs running. Device status: Device "FileStorage" (/tmp/test-backups) is not open. *

How it works...

A typical Bacula system consists of three independently running daemons:

  • Storage daemon (SD): This daemon receives backups from Director and stores them into the storage (files or tapes)

  • File daemon (FD): This daemon collects the files from client machines and sends them to the Director

  • Director daemon: This daemon performs job scheduling and negotiates data transfers between Storage and File daemons

In this setup, we installed Director and Storage daemons on the same machine and configured a file-based storage at /tmp/test-backups in our filesystem.

The bconsole utility is used to connect to the Director daemon, pass commands to it, and receive messages from it. When we requested the status of Storage with the status storage command, Director forwarded the request to Storage. Therefore, it's only important to have a direct connection from console to Director.

Replace the sample passwords of Director, Storage and the bconsole utility. Each component can reside on a separate machine as long as connectivity between them is possible. Don't forget to always use fully qualified domain names or non-local IP addresses when specifying remote components.

Summary

In this article we learned to set up the simplest Bacula Director and Bacula Storage installations using the Bacula's bconsole utility.

Resources for Article :


Further resources on this subject:


Network Backup with Bacula How-To [Instant] Create an autonomous backup solution for your computer network using practical, hands-on recipes with this book and ebook
Published: November 2012
eBook Price: $14.99
See more
Select your format and quantity:

About the Author :


Eugene Pankov

Eugene Pankov is a Lead Software Architect and Developer at Linology Networks LLC. For over a decade, he has been providing software design and development services, as well as Linux server setup and maintenance for a large variety of companies, from web hosting to sports telemetry. Eugene is the founder and main developer of the Ajenti open source web server administration panel, which is used by nearly 10,000 people worldwide at the time of writing this book. He has successfully completed a large variety of projects, from Django websites to Android games.

Books From Packt


OpenAM
OpenAM

Active Directory Disaster Recovery
Active Directory Disaster Recovery

 Windows Server 2012 Automation with PowerShell
Windows Server 2012 Automation with PowerShell

Metasploit Penetration Testing Cookbook
Metasploit Penetration Testing Cookbook

Nmap 6: Network Exploration and Security Auditing Cookbook
Nmap 6: Network Exploration and Security Auditing Cookbook

 Microsoft Data Protection Manager 2010
Microsoft Data Protection Manager 2010

 Microsoft System Center Data Protection Manager 2012
Microsoft System Center Data Protection Manager 2012

 Ruby on Rails Enterprise Application Development: Plan, Program, Extend
Ruby on Rails Enterprise Application Development: Plan, Program, Extend


No votes yet

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Z
b
L
r
H
9
Enter the code without spaces and pay attention to upper/lower case.
Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software