4 \chapter{What is Bacula?}
6 \index[general]{Bacula!What is }
7 \index[general]{What is Bacula? }
9 Bacula is a set of computer programs that permits the system
10 administrator to manage backup, recovery, and verification of computer data
11 across a network of computers of different kinds. Bacula can also run entirely
12 upon a single computer and can backup to various types of media, including tape
15 In technical terms, it is a
16 network Client/Server based backup program. Bacula is relatively easy to use
17 and efficient, while offering many advanced storage management features that
18 make it easy to find and recover lost or damaged files. Due to its modular
19 design, Bacula is scalable from small single computer systems to systems
20 consisting of hundreds of computers located over a large network.
22 \section{Who Needs Bacula?}
23 \index[general]{Who Needs Bacula? }
24 \index[general]{Bacula!Who Needs }
26 If you are currently using a program such as tar, dump, or
27 bru to backup your computer data, and you would like a network solution, more
28 flexibility, or catalog services, Bacula will most likely provide the
29 additional features you want. However, if you are new to Unix systems or do
30 not have offsetting experience with a sophisticated backup package, the Bacula project does not
31 recommend using Bacula as it is much more difficult to setup and use than
34 If you want Bacula to behave like the above mentioned simple
35 programs and write over any tape that you put in the drive, then you will find
36 working with Bacula difficult. Bacula is designed to protect your data
37 following the rules you specify, and this means reusing a tape only
38 as the last resort. It is possible to "force" Bacula to write
39 over any tape in the drive, but it is easier and more efficient to use a
40 simpler program for that kind of operation.
42 If you are running Amanda and would like a backup program that can write
43 to multiple volumes (i.e. is not limited by your tape drive capacity), Bacula
44 can most likely fill your needs. In addition, quite a number of Bacula users
45 report that Bacula is simpler to setup and use than other equivalent programs.
47 If you are currently using a sophisticated commercial package such as Legato
48 Networker. ARCserveIT, Arkeia, or PerfectBackup+, you may be interested in
49 Bacula, which provides many of the same features and is free software
50 available under the GNU Version 2 software license.
52 \section{Bacula Components or Services}
53 \index[general]{Bacula Components or Services }
54 \index[general]{Services!Bacula Components or }
56 Bacula is made up of the following five major components or services:
57 Director, Console, File, Storage, and Monitor services.
60 \addcontentsline{lof}{figure}{Bacula Applications}
61 \includegraphics{./bacula-applications.eps}
62 (thanks to Aristedes Maniatis for this graphic and the one below)
63 % TODO: move the thanks to Credits section in preface
65 \subsection*{Bacula Director}
67 The Bacula Director service is the program that supervises
68 all the backup, restore, verify and archive operations. The system
69 administrator uses the Bacula Director to schedule backups and to
70 recover files. For more details see the Director Services Daemon Design
71 Document in the Bacula Developer's Guide. The Director runs as a daemon
72 (or service) in the background.
73 % TODO: tell reader where this Developer's Guide is at?
76 \subsection*{Bacula Console}
78 The Bacula Console service is the program that allows the
79 administrator or user to communicate with the Bacula Director
80 Currently, the Bacula Console is available in three versions:
81 text-based console interface, GNOME-based interface, and a
82 wxWidgets graphical interface.
83 The first and simplest is to run the Console program in a shell window
84 (i.e. TTY interface). Most system administrators will find this
85 completely adequate. The second version is a GNOME GUI interface that
86 is far from complete, but quite functional as it has most the
87 capabilities of the shell Console. The third version is a wxWidgets GUI
88 with an interactive file restore. It also has most of the capabilities
89 of the shell console, allows command completion with tabulation, and
90 gives you instant help about the command you are typing. For more
91 details see the \ilink{Bacula Console Design Document}{_ConsoleChapter}.
93 \subsection*{Bacula File}
95 The Bacula File service (also known as the Client program) is the software
96 program that is installed on the machine to be backed up.
98 operating system on which it runs and is responsible for providing the
99 file attributes and data when requested by the Director. The File
100 services are also responsible for the file system dependent part of
101 restoring the file attributes and data during a recovery operation. For
102 more details see the File Services Daemon Design Document in the Bacula
103 Developer's Guide. This program runs as a daemon on the machine to be
105 In addition to Unix/Linux File daemons, there is a Windows File daemon
106 (normally distributed in binary format). The Windows File daemon runs
107 on current Windows versions (NT, 2000, XP, 2003, and possibly Me and
109 % TODO: maybe do not list Windows here as that is listed elsewhere
110 % TODO: remove "possibly"?
111 % TODO: mention Vista?
113 \subsection*{Bacula Storage}
115 The Bacula Storage services consist of the software programs that
116 perform the storage and recovery of the file attributes and data to the
117 physical backup media or volumes. In other words, the Storage daemon is
118 responsible for reading and writing your tapes (or other storage media,
119 e.g. files). For more details see the Storage Services Daemon Design
120 Document in the Bacula Developer's Guide. The Storage services runs as
121 a daemon on the machine that has the backup device (usually a tape
123 % TODO: may switch e.g. to "for example" or "such as" as appropriate
124 % TODO: is "usually" correct? Maybe "such as" instead?
126 \subsection*{Catalog}
128 The Catalog services are comprised of the software programs
129 responsible for maintaining the file indexes and volume databases for
130 all files backed up. The Catalog services permit the system
131 administrator or user to quickly locate and restore any desired file.
132 The Catalog services sets Bacula apart from simple backup programs like
133 tar and bru, because the catalog maintains a record of all Volumes used,
134 all Jobs run, and all Files saved, permitting efficient restoration and
135 Volume management. Bacula currently supports three different databases,
136 MySQL, PostgreSQL, and SQLite, one of which must be chosen when building
139 The three SQL databases currently supported (MySQL, PostgreSQL or
140 SQLite) provide quite a number of features, including rapid indexing,
141 arbitrary queries, and security. Although the Bacula project plans to support other
142 major SQL databases, the current Bacula implementation interfaces only
143 to MySQL, PostgreSQL and SQLite. For the technical and porting details
144 see the Catalog Services Design Document in the developer's documented.
146 The packages for MySQL and PostgreSQL are available for several operating
148 Alternatively, installing from the
149 source is quite easy, see the \ilink{ Installing and Configuring
150 MySQL}{MySqlChapter} chapter of this document for the details. For
151 more information on MySQL, please see:
152 \elink{www.mysql.com}{http://www.mysql.com}. Or see the \ilink{
153 Installing and Configuring PostgreSQL}{PostgreSqlChapter} chapter of this
154 document for the details. For more information on PostgreSQL, please
155 see: \elink{www.postgresql.org}{http://www.postgresql.org}.
157 Configuring and building SQLite is even easier. For the details of
158 configuring SQLite, please see the \ilink{ Installing and Configuring
159 SQLite}{SqlLiteChapter} chapter of this document.
161 \subsection*{Bacula Monitor}
163 A Bacula Monitor service is the program that allows the
164 administrator or user to watch current status of Bacula Directors,
165 Bacula File Daemons and Bacula Storage Daemons.
166 Currently, only a GTK+ version is available, which works with GNOME,
167 KDE, or any window manager that supports the FreeDesktop.org system tray
170 To perform a successful save or restore, the following four daemons must be
171 configured and running: the Director daemon, the File daemon, the Storage
172 daemon, and the Catalog service (MySQL, PostgreSQL or SQLite).
174 \section{Bacula Configuration}
175 \index[general]{Configuration!Bacula }
176 \index[general]{Bacula Configuration }
178 In order for Bacula to understand your system, what clients you want backed
179 up and how, you must create a number of configuration files containing
180 resources (or objects). The following presents an overall picture of this:
182 \addcontentsline{lof}{figure}{Bacula Objects}
183 \includegraphics{./bacula-objects.eps}
185 \section{Conventions Used in this Document}
186 \index[general]{Conventions Used in this Document }
187 \index[general]{Document!Conventions Used in this }
189 Bacula is in a state of evolution, and as a consequence, this manual
190 will not always agree with the code. If an item in this manual is preceded by
191 an asterisk (*), it indicates that the particular feature is not implemented.
192 If it is preceded by a plus sign (+), it indicates that the feature may be
193 partially implemented.
194 % TODO: search for plus sign and asterisk and "IMPLEMENTED" and fix for printed book
196 If you are reading this manual as supplied in a released version of the
197 software, the above paragraph holds true. If you are reading the online
198 version of the manual,
199 \elink{ www.bacula.org}{http://www.bacula.org}, please bear in
200 mind that this version describes the current version in development (in the
201 CVS) that may contain features not in the released version. Just the same, it
202 generally lags behind the code a bit.
203 % TODO: is this still true? there are separate websites
205 \section{Quick Start}
206 \index[general]{Quick Start }
207 \index[general]{Start!Quick }
209 To get Bacula up and running quickly, the author recommends
210 that you first scan the
211 Terminology section below, then quickly review the next chapter entitled
212 \ilink{The Current State of Bacula}{StateChapter}, then the
213 \ilink{Getting Started with Bacula}{QuickStartChapter}, which will
214 give you a quick overview of getting Bacula running. After which, you should
215 proceed to the chapter on
216 \ilink{Installing Bacula}{InstallChapter}, then
217 \ilink{How to Configure Bacula}{ConfigureChapter}, and finally the
219 \ilink{ Running Bacula}{TutorialChapter}.
221 \section{Terminology}
222 \index[general]{Terminology }
226 \item [Administrator]
227 \index[fd]{Administrator }
228 The person or persons responsible for administrating the Bacula system.
232 The term Backup refers to a Bacula Job that saves files.
234 \item [Bootstrap File]
235 \index[fd]{Bootstrap File }
236 The bootstrap file is an ASCII file containing a compact form of
237 commands that allow Bacula or the stand-alone file extraction utility
238 (bextract) to restore the contents of one or more Volumes, for
239 example, the current state of a system just backed up. With a bootstrap
240 file, Bacula can restore your system without a Catalog. You can create
241 a bootstrap file from a Catalog to extract any file or files you wish.
245 The Catalog is used to store summary information about the Jobs,
246 Clients, and Files that were backed up and on what Volume or Volumes.
247 The information saved in the Catalog permits the administrator or user
248 to determine what jobs were run, their status as well as the important
249 characteristics of each file that was backed up, and most importantly,
250 it permits you to choose what files to restore.
252 online resource, but does not contain the data for the files backed up.
253 Most of the information stored in the catalog is also stored on the
254 backup volumes (i.e. tapes). Of course, the tapes will also have a
255 copy of the file data in addition to the File Attributes (see below).
257 The catalog feature is one part of Bacula that distinguishes it from
258 simple backup and archive programs such as dump and tar.
262 In Bacula's terminology, the word Client refers to the machine being
263 backed up, and it is synonymous with the File services or File daemon,
264 and quite often, it is referred to it as the FD. A Client is defined in a
265 configuration file resource.
269 The program that interfaces to the Director allowing the user or system
270 administrator to control Bacula.
274 Unix terminology for a program that is always present in the background to
275 carry out a designated task. On Windows systems, as well as some Unix
276 systems, daemons are called Services.
279 \index[fd]{Directive }
280 The term directive is used to refer to a statement or a record within a
281 Resource in a configuration file that defines one specific setting. For
282 example, the {\bf Name} directive defines the name of the Resource.
285 \index[fd]{Director }
286 The main Bacula server daemon that schedules and directs all Bacula
287 operations. Occasionally, the project refers to the Director as DIR.
290 \index[fd]{Differential }
291 A backup that includes all files changed since the last Full save started.
292 Note, other backup programs may define this differently.
294 \item [File Attributes]
295 \index[fd]{File Attributes }
296 The File Attributes are all the information necessary about a file to
297 identify it and all its properties such as size, creation date, modification
298 date, permissions, etc. Normally, the attributes are handled entirely by
299 Bacula so that the user never needs to be concerned about them. The
300 attributes do not include the file's data.
303 \index[fd]{File Daemon }
304 The daemon running on the client computer to be backed up. This is also
305 referred to as the File services, and sometimes as the Client services or the
311 A FileSet is a Resource contained in a configuration file that defines
312 the files to be backed up. It consists of a list of included files or
313 directories, a list of excluded files, and how the file is to be stored
314 (compression, encryption, signatures). For more details, see the
315 \ilink{FileSet Resource definition}{FileSetResource} in the Director
316 chapter of this document.
319 \index[fd]{Incremental }
320 A backup that includes all files changed since the last Full, Differential,
321 or Incremental backup started. It is normally specified on the {\bf Level}
322 directive within the Job resource definition, or in a Schedule resource.
327 A Bacula Job is a configuration resource that defines the work that
328 Bacula must perform to backup or restore a particular Client. It
329 consists of the {\bf Type} (backup, restore, verify, etc), the {\bf
330 Level} (full, incremental,...), the {\bf FileSet}, and {\bf Storage} the
331 files are to be backed up (Storage device, Media Pool). For more
332 details, see the \ilink{Job Resource definition}{JobResource} in the
333 Director chapter of this document.
334 % TODO: clean up "..." for book
338 The program that interfaces to all the daemons allowing the user or
339 system administrator to monitor Bacula status.
342 \index[fd]{Resource }
343 A resource is a part of a configuration file that defines a specific
344 unit of information that is available to Bacula. It consists of several
345 directives (individual configuration statements). For example, the {\bf
346 Job} resource defines all the properties of a specific Job: name,
347 schedule, Volume pool, backup type, backup level, ...
348 % TODO: clean up "..." for book
352 A restore is a configuration resource that describes the operation of
353 recovering a file from backup media. It is the inverse of a save,
354 except that in most cases, a restore will normally have a small set of
355 files to restore, while normally a Save backs up all the files on the
356 system. Of course, after a disk crash, Bacula can be called upon to do
357 a full Restore of all files that were on the system.
358 % TODO: Why? Why say "Of course"??
360 % TODO: define "Save"
361 % TODO: define "Full"
364 \index[fd]{Schedule }
365 A Schedule is a configuration resource that defines when the Bacula Job
366 will be scheduled for execution. To use the Schedule, the Job resource
367 will refer to the name of the Schedule. For more details, see the
368 \ilink{Schedule Resource definition}{ScheduleResource} in the Director
369 chapter of this document.
373 This is Windows terminology for a {\bf daemon} -- see above. It is
374 frequently used in Unix environments as well.
375 % TODO: maybe do not say this is "Windows" terminology because it is common
377 \item [Storage Coordinates]
378 \index[fd]{Storage Coordinates }
379 The information returned from the Storage Services that uniquely locates
380 a file on a backup medium. It consists of two parts: one part pertains
381 to each file saved, and the other part pertains to the whole Job.
382 Normally, this information is saved in the Catalog so that the user
383 doesn't need specific knowledge of the Storage Coordinates. The Storage
384 Coordinates include the File Attributes (see above) plus the unique
385 location of the information on the backup Volume.
387 \item [Storage Daemon]
388 \index[fd]{Storage Daemon }
389 The Storage daemon, sometimes referred to as the SD, is the code that
390 writes the attributes and data to a storage Volume (usually a tape or
395 Normally refers to the internal conversation between the File daemon and
396 the Storage daemon. The File daemon opens a {\bf session} with the
397 Storage daemon to save a FileSet or to restore it. A session has a
398 one-to-one correspondence to a Bacula Job (see above).
402 A verify is a job that compares the current file attributes to the
403 attributes that have previously been stored in the Bacula Catalog. This
404 feature can be used for detecting changes to critical system files
405 similar to what a file integrity checker like Tripwire does.
406 One of the major advantages of
407 using Bacula to do this is that on the machine you want protected such
408 as a server, you can run just the File daemon, and the Director, Storage
409 daemon, and Catalog reside on a different machine. As a consequence, if
410 your server is ever compromised, it is unlikely that your verification
411 database will be tampered with.
413 Verify can also be used to check that the most recent Job data written
414 to a Volume agrees with what is stored in the Catalog (i.e. it compares
415 the file attributes), *or it can check the Volume contents against the
416 original files on disk.
417 % TODO: fix book for asterisk above and below
420 \index[fd]{*Archive }
421 An Archive operation is done after a Save, and it consists of removing the
422 Volumes on which data is saved from active use. These Volumes are marked as
423 Archived, and may no longer be used to save files. All the files contained
424 on an Archived Volume are removed from the Catalog. NOT YET IMPLEMENTED.
428 An Update operation causes the files on the remote system to be updated to be
429 the same as the host system. This is equivalent to an {\bf rdist} capability.
432 \item [Retention Period]
433 \index[fd]{Retention Period }
434 There are various kinds of retention periods that Bacula recognizes.
435 The most important are the {\bf File} Retention Period, {\bf Job}
436 Retention Period, and the {\bf Volume} Retention Period. Each of these
437 retention periods applies to the time that specific records will be kept
438 in the Catalog database. This should not be confused with the time that
439 the data saved to a Volume is valid.
441 % TODO: the following sentence is unclear to me
442 The File Retention Period determines the time that File records are kept
443 in the catalog database. This period is important because the volume of
444 the database File records by far use the most storage space in the
445 database. As a consequence, you must ensure that regular "pruning" of
446 the database file records is done. (See the Console {\bf retention}
447 command for more details on this subject).
450 The Job Retention Period is the length of time that Job records will be
451 kept in the database. Note, all the File records are tied to the Job
452 that saved those files. The File records can be purged leaving the Job
453 records. In this case, information will be available about the jobs
454 that ran, but not the details of the files that were backed up.
455 Normally, when a Job record is purged, all its File records will also be
458 The Volume Retention Period is the minimum of time that a Volume will be
459 kept before it is reused. Bacula will normally never overwrite a Volume
460 that contains the only backup copy of a file. Under ideal conditions,
461 the Catalog would retain entries for all files backed up for all current
462 Volumes. Once a Volume is overwritten, the files that were backed up on
463 that Volume are automatically removed from the Catalog. However, if
464 there is a very large pool of Volumes or a Volume is never overwritten,
465 the Catalog database may become enormous. To keep the Catalog to a
466 manageable size, the backup information should be removed from the
467 Catalog after the defined File Retention Period. Bacula provides the
468 mechanisms for the catalog to be automatically pruned according to the
469 retention periods defined.
473 A Scan operation causes the contents of a Volume or a series of Volumes
474 to be scanned. These Volumes with the information on which files they
475 contain are restored to the Bacula Catalog. Once the information is
476 restored to the Catalog, the files contained on those Volumes may be
477 easily restored. This function is particularly useful if certain
478 Volumes or Jobs have exceeded their retention period and have been
479 pruned or purged from the Catalog. Scanning data from Volumes into the
480 Catalog is done by using the {\bf bscan} program. See the \ilink{ bscan
481 section}{bscan} of the Bacula Utilities Chapter of this manual for more
486 A Volume is an archive unit, normally a tape or a named disk file where
487 Bacula stores the data from one or more backup jobs. All Bacula Volumes
488 have a software label written to the Volume by Bacula so that it
489 identifies what Volume it is really reading. (Normally there should be
490 no confusion with disk files, but with tapes, it is easy to mount the
494 \section{What Bacula is Not}
495 \index[general]{What Bacula is Not}
497 Bacula is a backup, restore and verification program and is not a
498 complete disaster recovery system in itself, but it can be a key part of one
499 if you plan carefully and follow the instructions included in the
500 \ilink{ Disaster Recovery}{RescueChapter} Chapter of this manual.
502 With proper planning, as mentioned in the Disaster Recovery chapter,
503 Bacula can be a central component of your disaster recovery system. For
504 example, if you have created an emergency boot disk, a Bacula Rescue disk to
505 save the current partitioning information of your hard disk, and maintain a
506 complete Bacula backup, it is possible to completely recover your system from
507 "bare metal" that is starting from an empty disk.
508 % TODO: should is say "or" between boot disk and rescue disk?
510 If you have used the {\bf WriteBootstrap} record in your job or some other
511 means to save a valid bootstrap file, you will be able to use it to extract
512 the necessary files (without using the catalog or manually searching for the
515 \section{Interactions Between the Bacula Services}
516 \index[general]{Interactions Between the Bacula Services}
517 \index[general]{Services!Interactions Between the Bacula}
519 The following block diagram shows the typical interactions between the Bacula
520 Services for a backup job. Each block represents in general a separate process
521 (normally a daemon). In general, the Director oversees the flow of
522 information. It also maintains the Catalog.
524 \addcontentsline{lof}{figure}{Interactions between Bacula Services}
525 \includegraphics{./flow.eps}