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