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