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