]> git.sur5r.net Git - bacula/docs/blob - docs/manual/quickstart.tex
Update home page -- donations
[bacula/docs] / docs / manual / quickstart.tex
1 %%
2 %%
3
4 \section*{Getting Started with Bacula}
5 \label{_ChapterStart37}
6 \index[general]{Getting Started with Bacula }
7 \addcontentsline{toc}{section}{Getting Started with Bacula}
8
9 If you are like me, you want to get Bacula running immediately to get a feel
10 for it, then later you want to go back and read about all the details. This
11 chapter attempts to accomplish just that: get you going quickly without all
12 the details. If you want to skip the section on Pools, Volumes and Labels, you
13 can always come back to it, but please read to the end of this chapter, and in
14 particular follow the instructions for testing your tape drive. 
15
16 We assume that you have managed to build and install Bacula, if not, you might
17 want to first look at the 
18 \ilink{System Requirements}{SysReqs} then at the 
19 \ilink{Compiling and Installing Bacula}{_ChapterStart17} chapter of
20 this manual. 
21
22 \label{JobsandSchedules}
23 \subsection*{Understanding Jobs and Schedules}
24 \index[general]{Jobs!Understanding}
25 \index[general]{Schedules!Understanding}
26 \addcontentsline{toc}{subsection}{Understanding Jobs and Schedules}
27
28 In order to make Bacula as flexible as possible, the directions given 
29 to Bacula are specified in several pieces.  The main instruction is the 
30 job resource, which defines a job.  A backup job generally consists of a 
31 FileSet, a Client, a Schedule for one or several types or times of backups, 
32 a Pool, as well as additional instructions. Another way of looking
33 at it is the FileSet is what to backup; the Client is who to backup; the
34 Schedule defines when, and the Pool defines where (i.e. what Volume).
35
36 Typically one FileSet/Client combination will have one corresponding job.
37 Most of the directives, such as FileSets, Pools, Schedules, can be mixed
38 and matched among the jobs.  So you might have two different Job
39 definitions (resources) backing up different servers using the same
40 Schedule, the same Fileset (backing up the same directories on 2 machines)
41 and maybe even the same Pools.  The Schedule will define what type of
42 backup will run when (e.g Full on Monday, incremental the rest of the
43 week), and when more than one job uses the same schedule, the job priority
44 determines which actually runs first.  If you have a lot of jobs, you might
45 want to use JobDefs, where you can set defaults for the jobs, which can
46 then be changed int the job resource, but this saves rewriting the
47 identical parameters for each job.  In addition to the FileSets you want to
48 back up, you should also have a job that backs up your catalog.
49
50 Finally, be aware that in addition to the backup jobs there are 
51 restore, verify, and admin jobs, which have different requirements.
52
53 \ label{PoolsVolsLabels}
54 \ subsection*{Understanding Pools, Volumes and Labels}
55 \ index[general]{Labels!Understanding Pools Volumes and }
56 \ index[general]{Understanding Pools, Volumes and Labels }
57 \ addcontentsline{toc}{subsection}{Understanding Pools, Volumes and Labels}
58
59 If you have been using a program such as {\bf tar} to backup your system,
60 Pools, Volumes, and labeling may be a bit confusing at first. A Volume is a
61 single physical tape (or possibly a single file) on which Bacula will write
62 your backup data. Pools group together Volumes so that a backup is not
63 restricted to the length of a single Volume (tape). Consequently, rather than
64 explicitly naming Volumes in your Job, you specify a Pool, and Bacula will
65 select the next appendable Volume from the Pool and request you to mount it. 
66
67 Although the basic Pool options are specified in the Director's Pool resource,
68 the {\bf real} Pool is maintained in the Bacula Catalog. It contains
69 information taken from the Pool resource (bacula-dir.conf) as well as
70 information on all the Volumes that have been added to the Pool. Adding
71 Volumes to a Pool is usually done manually with the Console program using the
72 {\bf label} command. 
73
74 For each Volume, Bacula maintains a fair amount of catalog information such as
75 the first write date/time, the last write date/time, the number of files on
76 the Volume, the number of bytes on the Volume, the number of Mounts, etc. 
77
78 Before Bacula will read or write a Volume, the physical Volume must have a
79 Bacula software label so that Bacula can be sure the correct Volume is
80 mounted. This is usually done using the {\bf label} command in the Console
81 program. 
82
83 The steps for creating a Pool, adding Volumes to it, and writing software
84 labels to the Volumes, may seem tedious at first, but in fact, they are quite
85 simple to do, and they allow you to use multiple Volumes (rather than being
86 limited to the size of a single tape). Pools also give you significant
87 flexibility in your backup process. For example, you can have a "Daily" Pool
88 of Volumes for Incremental backups and a "Weekly" Pool of Volumes for Full
89 backups. By specifying the appropriate Pool in the daily and weekly backup
90 Jobs, you thereby insure that no daily Job ever writes to a Volume in the
91 Weekly Pool and vice versa, and Bacula will tell you what tape is needed and
92 when. 
93
94 For more on Pools, see the 
95 \ilink{Pool Resource}{PoolResource} section of the Director
96 Configuration chapter, or simply read on, and we will come back to this
97 subject later. 
98
99 \subsection*{Setting Up Bacula Configuration Files}
100 \label{config}
101 \index[general]{Setting Up Bacula Configuration Files }
102 \index[general]{Files!Setting Up Bacula Configuration }
103 \addcontentsline{toc}{subsection}{Setting Up Bacula Configuration Files}
104
105 After running the appropriate {\bf ./configure} command and doing a {\bf
106 make}, and a {\bf make install}, if this is the first time you are running
107 Bacula, you must create valid configuration files for the Director, the File
108 daemon, the Storage daemon, and the Console programs. If you have followed our
109 recommendations, default configuration files as well as the daemon binaries
110 will be located in your installation directory. In any case, the binaries are
111 found in the directory you specified on the {\bf \verb:--:sbindir} option to the
112 {\bf
113 ./configure} command, and the configuration files are found in the directory
114 you specified on the {\bf \verb:--:sysconfdir} option. 
115
116 When initially setting up Bacula you will need to invest a bit of time in
117 modifying the default configuration files to suit your environment. This may
118 entail starting and stopping Bacula a number of times until you get everything
119 right. Please do not despair. Once you have created your configuration files,
120 you will rarely need to change them nor will you stop and start Bacula very
121 often. Most of the work will simply be in changing the tape when it is full. 
122
123 \subsubsection*{
124 \ilink{Configuring the Console Program}{_ChapterStart36}}
125 \index[general]{Configuring the Console Program }
126 \index[general]{Program!Configuring the Console }
127 \addcontentsline{toc}{subsubsection}{Configuring the Console Program}
128
129 The Console program is used by the administrator to interact with the Director
130 and to manually start/stop Jobs or to obtain Job status information. 
131
132 The Console configuration file is found in the directory specified on the {\bf
133 \verb:--:sysconfdir} option that you specified on the {\bf ./configure} command
134 and
135 by default is named {\bf console.conf}.
136
137 If you choose to build the GNOME console with the {\bf \verb:--:enable-gnome}
138 option,
139 you also find a default configuration file for it, named {\bf
140 gnome-console.conf}.
141
142 The same applies to the wxWidgets console, which is build with the {\bf
143 \verb:--:enable-wx-console} option, and the name of the default configuration
144 file
145 is, in this case, {\bf wx-console.conf}.
146
147 Normally, for first time users, no change is needed to these files. Reasonable
148 defaults are set. 
149
150 \subsubsection*{
151 \ilink{Configuring the Monitor Program}{_MonitorChapter}}
152 \index[general]{Program!Configuring the Monitor }
153 \index[general]{Configuring the Monitor Program }
154 \addcontentsline{toc}{subsubsection}{Configuring the Monitor Program}
155
156 The Monitor program is typically an icon in the system tray. However, once the
157 icon is expanded into a full window, the administrator or user can obtain
158 status information about the Director or the backup status on the local
159 workstation or any other Bacula daemon that is configured. 
160
161 \addcontentsline{lof}{figure}{Bacula Tray Monitor}
162 \includegraphics{./Bacula-tray-monitor.eps} 
163
164 The image shows a tray-monitor configured for three daemons. By clicking on
165 the radio buttons in the upper left corner of the image, you can see the
166 status for each of the daemons. The image shows the status for the Storage
167 daemon (MainSD) that is currently selected. 
168
169 The Monitor configuration file is found in the directory specified on the {\bf
170 \verb:--:sysconfdir} option that you specified on the {\bf ./configure} command
171 and
172 by default is named {\bf tray-monitor.conf}. Normally, for first time users,
173 you just need to change the permission of this file to allow non-root users to
174 run the Monitor, as this application must run as the same user as the
175 graphical environment (don't forget to allow non-root users to execute {\bf
176 bacula-tray-monitor}). This is not a security problem as long as you use the
177 default settings. 
178
179 \subsubsection*{
180 \ilink{Configuring the File daemon}{_ChapterStart25}}
181 \index[general]{Daemon!Configuring the File }
182 \index[general]{Configuring the File daemon }
183 \addcontentsline{toc}{subsubsection}{Configuring the File daemon}
184
185 The File daemon is a program that runs on each (Client) machine. At the
186 request of the Director, finds the files to be backed up and sends them (their
187 data) to the Storage daemon. 
188
189 The File daemon configuration file is found in the directory specified on the
190 {\bf \verb:--:sysconfdir} option that you specified on the {\bf ./configure}
191 command.
192 By default, the File daemon's configuration file is named {\bf
193 bacula-fd.conf}. Normally, for first time users, no change is needed to this
194 file. Reasonable defaults are set. However, if you are going to back up more
195 than one machine, you will need to install the File daemon with a unique
196 configuration file on each machine to be backed up. The information about each
197 File daemon must appear in the Director's configuration file. 
198
199 \subsubsection*{
200 \ilink{Configuring the Director}{_ChapterStart40}}
201 \index[general]{Director!Configuring the }
202 \index[general]{Configuring the Director }
203 \addcontentsline{toc}{subsubsection}{Configuring the Director}
204
205 The Director is the central control program for all the other daemons. It
206 schedules and monitors all jobs to be backed up. 
207
208 The Director configuration file is found in the directory specified on the
209 {\bf \verb:--:sysconfdir} option that you specified on the {\bf ./configure}
210 command.
211 Normally the Director's configuration file is named {\bf bacula-dir.conf}. 
212
213 In general, the only change you must make is modify the FileSet resource so
214 that the {\bf Include} configuration directive contains at least one line with
215 a valid name of a directory (or file) to be saved. 
216
217 If you do not have a DLT tape drive, you will probably want to edit the
218 Storage resource to contain names that are more representative of your actual
219 storage device. You can always use the existing names as you are free to
220 arbitrarily assign them, but they must agree with the corresponding names in
221 the Storage daemon's configuration file. 
222
223 You may also want to change the email address for notification from the
224 default {\bf root} to your email address. 
225
226 Finally, if you have multiple systems to be backed up, you will need a
227 separate File daemon or Client specification for each system, specifying its
228 name, address, and password. We have found that giving your daemons the same
229 name as your system but post fixed with {\bf -fd} helps a lot in debugging.
230 That is, if your system name is {\bf foobaz}, you would give the File daemon
231 the name {\bf foobaz-fd}. For the Director, you might use {\bf foobaz-dir},
232 and for the storage daemon, you might use {\bf foobaz-sd}. 
233
234 \subsubsection*{
235 \ilink{Configuring the Storage daemon}{_ChapterStart31}}
236 \index[general]{Daemon!Configuring the Storage }
237 \index[general]{Configuring the Storage daemon }
238 \addcontentsline{toc}{subsubsection}{Configuring the Storage daemon}
239
240 The Storage daemon is responsible, at the Director's request, for accepting
241 data from a File daemon and placing it on Storage media, or in the case of a
242 restore request, to find the data and send it to the File daemon. 
243
244 The Storage daemon's configuration file is found in the directory specified on
245 the {\bf \verb:--:sysconfdir} option that you specified on the {\bf ./configure}
246 command. By default, the Storage daemon's file is named {\bf bacula-sd.conf}.
247 Edit this file to contain the correct Archive device names for any tape
248 devices that you have. If the configuration process properly detected your
249 system, they will already be correctly set. These Storage resource name and
250 Media Type must be the same as the corresponding ones in the Director's
251 configuration file {\bf bacula-dir.conf}. If you want to backup to a file
252 instead of a tape, the Archive device must point to a directory in which the
253 Volumes will be created as files when you label the Volume. 
254 \label{ConfigTesting}
255
256 \subsection*{Testing your Configuration Files}
257 \index[general]{Testing your Configuration Files }
258 \index[general]{Files!Testing your Configuration }
259 \addcontentsline{toc}{subsection}{Testing your Configuration Files}
260
261 You can test if your configuration file is syntactically correct by running
262 the appropriate daemon with the {\bf -t} option. The daemon will process the
263 configuration file and print any error messages then terminate. For example,
264 assuming you have installed your binaries and configuration files in the same
265 directory. 
266
267 \footnotesize
268 \begin{verbatim}
269 cd <installation-directory>
270 ./bacula-dir -t -c bacula-dir.conf
271 ./bacula-fd -t -c bacula-fd.conf
272 ./bacula-sd -t -c bacula-sd.conf
273 ./bconsole -t -c bconsole.conf
274 ./gnome-console -t -c gnome-console.conf
275 ./wx-console -t -c wx-console.conf
276 su <normal user> -c "./bacula-tray-monitor -t -c tray-monitor.conf"
277 \end{verbatim}
278 \normalsize
279
280 will test the configuration files of each of the main programs. If the
281 configuration file is OK, the program will terminate without printing
282 anything. Please note that, depending on the configure options you choose,
283 some, or even all, of the three last commands will not be available on your
284 system. If you have installed the binaries in traditional Unix locations
285 rather than a single file, you will need to modify the above commands
286 appropriately (no ./ in front of the command name, and a path in front of the
287 conf file name). 
288 \label{TapeTesting}
289
290 \subsection*{Testing Bacula Compatibility with Your Tape Drive}
291 \index[general]{Drive!Testing Bacula Compatibility with Your Tape }
292 \index[general]{Testing Bacula Compatibility with Your Tape Drive }
293 \addcontentsline{toc}{subsection}{Testing Bacula Compatibility with Your Tape
294 Drive}
295
296 Before spending a lot of time on Bacula only to find that it doesn't work with
297 your tape drive, please read the 
298 \ilink{btape -- Testing Your Tape Drive}{_ChapterStart27}
299 chapter of this manual. If you have a modern standard SCSI tape drive on a
300 Linux or Solaris, most likely it will work, but better test than be sorry. For
301 FreeBSD (and probably other xBSD flavors), reading the above mentioned tape
302 testing chapter is a must. Also, for FreeBSD, please see 
303 \elink{The FreeBSD Diary}{http://www.freebsddiary.org/bacula.php} for a
304 detailed description on how to make Bacula work on your system. In addition,
305 users of FreeBSD prior to 4.9-STABLE dated Mon Dec 29 15:18:01 2003 UTC who
306 plan to use tape devices, please see the file {\bf
307 platforms/freebsd/pthreads-fix.txt} in the main Bacula directory concerning
308 important information concerning compatibility of Bacula and your system. 
309 \label{notls}
310
311 \subsection*{Get Rid of the /lib/tls Directory}
312 \index[general]{Directory!Get Rid of the /lib/tls }
313 \index[general]{Get Rid of the /lib/tls Directory }
314 \addcontentsline{toc}{subsection}{Get Rid of the /lib/tls Directory}
315
316 The new pthreads library {\bf /lib/tls} installed by default on recent Red Hat
317 systems running kernel 2.4.x is defective. You must remove it or rename it,
318 then reboot your system before running Bacula otherwise after a week or so of
319 running, Bacula will either block for long periods or deadlock entirely. 
320 You may want to use the loader environment variable override rather
321 than removing /lib/tls. Please see \ilink{ Supported Operating
322 Systems}{SupportedOSes} for more
323 information on this problem. 
324
325 This problem does not seem to occur on systems running 2.6.x kernels. 
326
327 \label{Running1}
328
329 \subsection*{Running Bacula}
330 \index[general]{Bacula!Running }
331 \index[general]{Running Bacula }
332 \addcontentsline{toc}{subsection}{Running Bacula}
333
334 Probably the most important part of running Bacula is being able to restore
335 files. If you haven't tried recovering files at least once, when you actually
336 have to do it, you will be under a lot more pressure, and prone to make
337 errors, than if you had already tried it once. 
338
339 To get a good idea how to use Bacula in a short time, we {\bf strongly}
340 recommend that you follow the example in the 
341 \ilink{Running Bacula Chapter}{_ChapterStart1} of this manual where
342 you will get detailed instructions on how to run Bacula. 
343
344 \subsection*{Log Rotation}
345 \index[general]{Rotation!Log }
346 \index[general]{Log Rotation }
347 \addcontentsline{toc}{subsection}{Log Rotation}
348 If you use the default {\bf bacula-dir.conf} or some variation of it, you will
349 note that it logs all the Bacula output to a file. To avoid that this file
350 grows without limit, we recommend that you copy the file {\bf logrotate} from
351 the {\bf scripts/logrotate} to {\bf /etc/logrotate.d/bacula}. This will cause
352 the log file to be rotated once a month and kept for a maximum of 5 months.
353 You may want to edit this file to change the default log rotation preferences.
354
355 \subsection*{Log Watch}
356 \index[general]{Watch!Log}
357 \index[general]{Log Watch}
358 \addcontentsline{toc}{subsection}{Log Watch}
359 Some systems such as RedHat and Fedora run the logwatch program
360 every night, which does an analysis of your log file and sends an
361 email report.  If you wish to include the output from your Bacula 
362 jobs in that report, please look in the {\bf scripts/logwatch}
363 directory.  The {\bf README} file in that directory gives a brief
364 explanation on how to install it and what kind of output to expect.
365
366
367 \subsection*{Disaster Recovery}
368 \index[general]{Recovery!Disaster }
369 \index[general]{Disaster Recovery }
370 \addcontentsline{toc}{subsection}{Disaster Recovery}
371
372 If you intend to use Bacula as a disaster recovery tool rather than simply a
373 program to restore lost or damaged files, you will want to read the 
374 \ilink{Disaster Recovery Using Bacula Chapter}{_ChapterStart38} of
375 this manual. 
376
377 In any case, you are strongly urged to carefully test restoring some files
378 that you have saved rather than wait until disaster strikes. This way, you
379 will be prepared.