]> git.sur5r.net Git - bacula/docs/blob - docs/manuals/en/concepts/general.tex
ab0f100b1098ab3dba6676cb3c5f64e1d1885196
[bacula/docs] / docs / manuals / en / concepts / general.tex
1 %%
2 %%
3
4 \chapter{What is Bacula?}
5 \label{GeneralChapter}
6 \index[general]{Bacula!What is }
7 \index[general]{What is Bacula? }
8
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
13 and disk.
14
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. 
21
22 \section{Who Needs Bacula?}
23 \index[general]{Who Needs Bacula? }
24 \index[general]{Bacula!Who Needs }
25
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 
32 tar or dump. 
33
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.
41
42 If you 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.
46
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. 
51
52 \section{Bacula Components or Services}
53 \index[general]{Bacula Components or Services }
54 \index[general]{Services!Bacula Components or }
55
56 Bacula is made up of the following five major components or services:
57 Director, Console, File, Storage, and Monitor services.
58
59
60 \addcontentsline{lof}{figure}{Bacula Applications}
61 \includegraphics{\idir 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
64
65 \subsection*{Bacula Director}
66    \label{DirDef}
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?
74    \label{UADef}
75
76 \subsection*{Bacula Console}
77
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}.
92
93 \subsection*{Bacula File}
94    \label{FDDef}
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.
97    It is specific to the
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
104    backed up.
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
108    98).
109 % TODO: maybe do not list Windows here as that is listed elsewhere
110 % TODO: remove "possibly"?
111 % TODO: mention Vista?
112
113 \subsection*{Bacula Storage}
114    \label{SDDef}
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
122    drive).
123 % TODO: may switch e.g. to "for example" or "such as" as appropriate
124 % TODO: is "usually" correct? Maybe "such as" instead?
125
126 \subsection*{Catalog}
127    \label{DBDefinition}
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
137    Bacula.
138
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.
145
146    The packages for MySQL and PostgreSQL are available for several operating
147    systems.
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}.
156
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.
160
161 \subsection*{Bacula Monitor} 
162    \label{MonDef}
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
168    standard. 
169
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). 
173
174 \section{Bacula Configuration}
175 \index[general]{Configuration!Bacula }
176 \index[general]{Bacula Configuration }
177
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: 
181
182 \addcontentsline{lof}{figure}{Bacula Objects}
183 \includegraphics{\idir bacula-objects.eps} 
184
185 \section{Conventions Used in this Document}
186 \index[general]{Conventions Used in this Document }
187 \index[general]{Document!Conventions Used in this }
188
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
195
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
204
205 \section{Quick Start}
206 \index[general]{Quick Start }
207 \index[general]{Start!Quick }
208
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
218 chapter on 
219 \ilink{ Running Bacula}{TutorialChapter}. 
220
221 \section{Terminology}
222 \index[general]{Terminology }
223
224 \begin{description}
225
226 \item [Administrator]
227    \index[fd]{Administrator }
228    The person or persons responsible for administrating the Bacula system. 
229
230 \item [Backup]
231    \index[fd]{Backup }
232    The term Backup refers to a Bacula Job that saves files. 
233
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.
242
243 \item [Catalog]
244    \index[fd]{Catalog }
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.
251    The Catalog is an
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).
256
257    The catalog feature is one part of Bacula that distinguishes it from
258    simple backup and archive programs such as dump and tar.
259
260 \item [Client]
261    \index[fd]{Client }
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.
266
267 \item [Console]
268    \index[fd]{Console }
269    The program that interfaces to the Director allowing  the user or system
270    administrator to control Bacula. 
271
272 \item [Daemon]
273    \index[fd]{Daemon }
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. 
277
278 \item [Directive]
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.
283
284 \item [Director]
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. 
288
289 \item [Differential]
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. 
293
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. 
301
302 \item [File Daemon]
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
306    FD. 
307
308 \label{FileSetDef}
309 \item [FileSet]
310 \index[fd]{a name }
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.
317
318 \item [Incremental]
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. 
323
324 \label{JobDef}
325 \item [Job]
326 \index[fd]{a name }
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
335
336 \item [Monitor]
337    \index[fd]{Monitor }
338    The program that interfaces to all the daemons  allowing the user or
339    system administrator to monitor Bacula status. 
340
341 \item [Resource]
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
349
350 \item [Restore]
351    \index[fd]{Restore }
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"??
359
360 % TODO: define "Save"
361 % TODO: define "Full"
362
363 \item [Schedule]
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.
370
371 \item [Service]
372    \index[fd]{Service }
373    This is a program that remains permanently in memory awaiting
374    instructions.  In Unix environments, services are also known as
375    {\bf daemons}. 
376
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.
386
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
391    disk).
392
393 \item [Session]
394    \index[sd]{Session }
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).
399
400 \item [Verify]
401    \index[sd]{Verify }
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.
412
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
418 \item [*Archive]
419    \index[fd]{*Archive }
420    An Archive operation is done after a Save, and it  consists of removing the
421    Volumes on which data is saved from active  use. These Volumes are marked as
422    Archived, and may no longer be  used to save files. All the files contained
423    on an Archived Volume  are removed from the Catalog. NOT YET IMPLEMENTED. 
424
425 \item [Retention Period]
426    \index[fd]{Retention Period }
427    There are various kinds of retention periods that Bacula recognizes.
428    The most important are the {\bf File} Retention Period, {\bf Job}
429    Retention Period, and the {\bf Volume} Retention Period.  Each of these
430    retention periods applies to the time that specific records will be kept
431    in the Catalog database.  This should not be confused with the time that
432    the data saved to a Volume is valid.
433
434    The File Retention Period determines the time that File records are kept
435    in the catalog database.  This period is important for two reasons: the
436    first is that as long as File records remain in the database, you
437    can "browse" the database with a console program and restore any
438    individual file. Once the File records are removed or pruned from the
439    database, the individual files of a backup job can no longer be
440    "browsed".  The second reason for carefully choosing the File Retention
441    Period is because the volume of
442    the database File records use the most storage space in the
443    database.  As a consequence, you must ensure that regular "pruning" of
444    the database file records is done to keep your database from growing 
445    too large. (See the Console {\bf prune}
446    command for more details on this subject).
447
448    The Job Retention Period is the length of time that Job records will be
449    kept in the database.  Note, all the File records are tied to the Job
450    that saved those files.  The File records can be purged leaving the Job
451    records.  In this case, information will be available about the jobs
452    that ran, but not the details of the files that were backed up.
453    Normally, when a Job record is purged, all its File records will also be
454    purged.
455
456    The Volume Retention Period is the minimum of time that a Volume will be
457    kept before it is reused.  Bacula will normally never overwrite a Volume
458    that contains the only backup copy of a file.  Under ideal conditions,
459    the Catalog would retain entries for all files backed up for all current
460    Volumes.  Once a Volume is overwritten, the files that were backed up on
461    that Volume are automatically removed from the Catalog.  However, if
462    there is a very large pool of Volumes or a Volume is never overwritten,
463    the Catalog database may become enormous.  To keep the Catalog to a
464    manageable size, the backup information should be removed from the
465    Catalog after the defined File Retention Period.  Bacula provides the
466    mechanisms for the catalog to be automatically pruned according to the
467    retention periods defined.
468
469 \item [Scan]
470    \index[sd]{Scan }
471    A Scan operation causes the contents of a Volume or a series of Volumes
472    to be scanned.  These Volumes with the information on which files they
473    contain are restored to the Bacula Catalog.  Once the information is
474    restored to the Catalog, the files contained on those Volumes may be
475    easily restored.  This function is particularly useful if certain
476    Volumes or Jobs have exceeded their retention period and have been
477    pruned or purged from the Catalog.  Scanning data from Volumes into the
478    Catalog is done by using the {\bf bscan} program.  See the \ilink{ bscan
479    section}{bscan} of the Bacula Utilities Chapter of this manual for more
480    details.
481
482 \item [Volume]
483    \index[sd]{Volume }
484    A Volume is an archive unit, normally a tape or a named disk file where
485    Bacula stores the data from one or more backup jobs.  All Bacula Volumes
486    have a software label written to the Volume by Bacula so that it
487    identifies what Volume it is really reading.  (Normally there should be
488    no confusion with disk files, but with tapes, it is easy to mount the
489    wrong one.)
490 \end{description}
491
492 \section{What Bacula is Not}
493 \index[general]{What Bacula is Not}
494
495 Bacula is a backup, restore and verification program and is not a
496 complete disaster recovery system in itself, but it can be a key part of one
497 if you plan carefully and follow the instructions included in the 
498 \ilink{ Disaster Recovery}{RescueChapter} Chapter of this manual. 
499
500 With proper planning, as mentioned in the Disaster Recovery chapter,
501 Bacula can be a central component of your disaster recovery system. For
502 example, if you have created an emergency boot disk, and/or a Bacula Rescue disk to
503 save the current partitioning information of your hard disk, and maintain a
504 complete Bacula backup, it is possible to completely recover your system from
505 "bare metal" that is starting from an empty disk. 
506
507 If you have used the {\bf WriteBootstrap} record in your job or some other
508 means to save a valid bootstrap file, you will be able to use it to extract
509 the necessary files (without using the catalog or manually searching for the
510 files to restore). 
511
512 \section{Interactions Between the Bacula Services}
513 \index[general]{Interactions Between the Bacula Services}
514 \index[general]{Services!Interactions Between the Bacula}
515
516 The following block diagram shows the typical interactions between the Bacula
517 Services for a backup job. Each block represents in general a separate process
518 (normally a daemon). In general, the Director oversees the flow of
519 information. It also maintains the Catalog. 
520
521 \addcontentsline{lof}{figure}{Interactions between Bacula Services}
522 \includegraphics{\idir flow.eps}