]> git.sur5r.net Git - bacula/docs/blob - docs/manuals/en/install/configure.tex
Update
[bacula/docs] / docs / manuals / en / install / configure.tex
1 %%
2 %%
3
4 \chapter{Customizing the Configuration Files}
5 \label{ConfigureChapter}
6 \index[general]{Files!Customizing the Configuration }
7 \index[general]{Customizing the Configuration Files }
8
9 When each of the Bacula programs starts, it reads a configuration file
10 specified on the command line or the default {\bf bacula-dir.conf}, {\bf
11 bacula-fd.conf}, {\bf bacula-sd.conf}, or {\bf console.conf} for the Director
12 daemon, the File daemon, the Storage daemon, and the Console program
13 respectively. 
14
15 Each service (Director, Client, Storage, Console) has its own configuration
16 file containing a set of Resource definitions. These resources are very
17 similar from one service to another, but may contain different directives
18 (records) depending on the service. For example, in the Director's resource
19 file, the {\bf Director} resource defines the name of the Director, a number
20 of global Director parameters and his password. In the File daemon
21 configuration file, the {\bf Director} resource specifies which Directors are
22 permitted to use the File daemon. 
23
24 Before running Bacula for the first time, you must customize the configuration
25 files for each daemon. Default configuration files will have been created by
26 the installation process, but you will need to modify them to correspond to
27 your system. An overall view of the resources can be seen in the following: 
28
29 \addcontentsline{lof}{figure}{Bacula Objects}
30 \includegraphics{\idir bacula-objects.eps} 
31 \label{ResFormat}
32
33 \section{Character Sets}
34 \index[general]{Character Sets}
35 Bacula is designed to handle most character sets of the world,
36 US ASCII, German, French, Chinese, ...  However, it does this by
37 encoding everything in UTF-8, and it expects all configuration files
38 (including those read on Win32 machines) to be in UTF-8 format.
39 UTF-8 is typically the default on Linux machines, but not on all
40 Unix machines, nor on Windows, so you must take some care to ensure
41 that your locale is set properly before starting Bacula.  
42
43 To ensure that Bacula configuration files can be correctly read including
44 foreign characters the {bf LANG} environment variable
45 must end in {\bf .UTF-8}. An full example is {\bf en\_US.UTF-8}. The
46 exact syntax may vary a bit from OS to OS, and exactly how you define
47 it will also vary.  On most newer Win32 machines, you can use {\bf notepad}
48 to edit the conf files, then choose output encoding UTF-8.
49
50 Bacula assumes that all filenames are in UTF-8 format on Linux and
51 Unix machines. On Win32 they are in Unicode (UTF-16), and will
52 be automatically converted to UTF-8 format.
53
54 \section{Resource Directive Format}
55 \index[general]{Resource Directive Format }
56 \index[general]{Format!Resource Directive }
57
58 Although, you won't need to know the details of all the directives a basic
59 knowledge of Bacula resource directives is essential. Each directive contained
60 within the resource (within the braces) is composed of a keyword followed by
61 an equal sign (=) followed by one or more values. The keywords must be one of
62 the known Bacula resource record keywords, and it may be composed of upper or
63 lower case characters and spaces. 
64
65 Each resource definition MUST contain a Name directive, and may optionally
66 contain a Description directive. The Name directive is used to
67 uniquely identify the resource. The Description directive is (will be) used
68 during display of the Resource to provide easier human recognition. For
69 example: 
70
71 \footnotesize
72 \begin{verbatim}
73 Director {
74   Name = "MyDir"
75   Description = "Main Bacula Director"
76   WorkingDirectory = "$HOME/bacula/bin/working"
77 }
78 \end{verbatim}
79 \normalsize
80
81 Defines the Director resource with the name "MyDir" and a working directory
82 \$HOME/bacula/bin/working. In general, if you want spaces in a name to the
83 right of the first equal sign (=), you must enclose that name within double
84 quotes. Otherwise quotes are not generally necessary because once defined,
85 quoted strings and unquoted strings are all equal.
86
87 \label{Comments}
88 \subsection{Comments}
89 \index[general]{Comments}
90
91 When reading the configuration file, blank lines are ignored and everything
92 after a hash sign (\#) until the end of the line is taken to be a comment. A
93 semicolon (;) is a logical end of line, and anything after the semicolon is
94 considered as the next statement. If a statement appears on a line by itself,
95 a semicolon is not necessary to terminate it, so generally in the examples in
96 this manual, you will not see many semicolons. 
97 \label{Case1}
98
99 \subsection{Upper and Lower Case and Spaces}
100 \index[general]{Spaces!Upper/Lower Case}
101 \index[general]{Upper and Lower Case and Spaces}
102
103 Case (upper/lower) and spaces are totally ignored in the resource directive
104 keywords (the part before the equal sign). 
105
106 Within the keyword (i.e. before the equal sign), spaces are not significant.
107 Thus the keywords: {\bf name}, {\bf Name}, and {\bf N a m e} are all
108 identical. 
109
110 Spaces after the equal sign and before the first character of the value are
111 ignored. 
112
113 In general, spaces within a value are significant (not ignored), and if the
114 value is a name, you must enclose the name in double quotes for the spaces to
115 be accepted. Names may contain up to 127 characters. Currently, a name may
116 contain any ASCII character. Within a quoted string, any character following a
117 backslash (\textbackslash{}) is taken as itself (handy for inserting
118 backslashes and double quotes (")).
119
120 Please note, however, that Bacula resource names as well as certain other
121 names (e.g. Volume names) must contain only letters (including ISO accented
122 letters), numbers, and a few special characters (space, underscore, ...). 
123 All other characters and punctuation are invalid.
124
125 \label{Includes}
126 \subsection{Including other Configuration Files}
127 \index[general]{Including other Configuration Files }
128 \index[general]{Files!Including other Configuration }
129 \index[general]{Using @ to include other files}
130 \index[general]{@{\bf filename}}
131
132 If you wish to break your configuration file into smaller pieces, you can do
133 so by including other files using the syntax @{\bf filename} where {\bf
134 filename} is the full path and filename of another file. The @filename
135 specification can be given anywhere a primitive token would appear.
136
137 \label{DataTypes}
138 \subsection{Recognized Primitive Data Types}
139 \index[general]{Types!Recognized Primitive Data }
140 \index[general]{Recognized Primitive Data Types }
141
142 When parsing the resource directives, Bacula classifies the data according to
143 the types listed below. The first time you read this, it may appear a bit
144 overwhelming, but in reality, it is all pretty logical and straightforward. 
145
146 \begin{description}
147
148 \item [name]
149    \index[fd]{name}
150    A keyword or name consisting of alphanumeric characters, including the
151 hyphen, underscore, and dollar  characters. The first character of a {\bf
152 name} must be  a letter.  A name has a maximum length currently set to 127
153 bytes.  Typically keywords appear on the left side of an equal (i.e.  they are
154 Bacula keywords -- i.e. Resource names or  directive names). Keywords may not
155 be quoted.  
156
157 \item [name-string]
158    \index[fd]{name-string}
159    A name-string is similar to a name,  except that the name may be quoted and
160 can thus contain  additional characters including spaces. Name strings  are
161 limited to 127 characters in length. Name strings  are typically used on the
162 right side of an equal (i.e.  they are values to be associated with a keyword).
163
164
165 \item [string]
166    \index[fd]{string}
167    A quoted string containing virtually any  character including spaces, or a
168 non-quoted string. A  string may be of any length. Strings are typically
169 values  that correspond to filenames, directories, or system  command names. A
170 backslash (\textbackslash{}) turns the next character into  itself, so to
171 include a double quote in a string, you precede the  double quote with a
172 backslash. Likewise to include a backslash. 
173
174 \item [directory]
175    \index[dir]{directory}
176    A directory is either a quoted or  non-quoted string. A directory will be
177 passed to your  standard shell for expansion when it is scanned. Thus 
178 constructs such as {\bf \$HOME} are interpreted to be  their correct values. 
179
180 \item [password]
181    \index[dir]{password}
182    This is a Bacula password and it is stored internally in MD5 hashed format. 
183
184 \item [integer]
185    \index[dir]{integer}
186    A 32 bit integer value. It may be positive or negative. 
187
188 \item [positive integer]
189    \index[dir]{positive integer }
190    A 32 bit positive integer value. 
191
192 \item [long integer]
193    \index[dir]{long integer}
194    A 64 bit integer value. Typically these  are values such as bytes that can
195 exceed 4 billion and thus  require a 64 bit value. 
196
197 \item [yes\vb{}no]
198    \index[dir]{yes or no }
199    Either a {\bf yes} or a {\bf no}. 
200
201 \label{Size1}
202 \item [size]
203 \index[dir]{size}
204 A size specified as bytes. Typically, this is  a floating point scientific
205 input format followed by an optional modifier. The  floating point input is
206 stored as a 64 bit integer value.  If a modifier is present, it must
207 immediately follow the  value with no intervening spaces. The following
208 modifiers are permitted:  
209
210 \begin{description}
211 \item [k]
212    1,024 (kilobytes)  
213
214 \item [kb]
215    1,000 (kilobytes)  
216
217 \item [m]
218    1,048,576 (megabytes)  
219
220 \item [mb]
221    1,000,000 (megabytes)  
222
223 \item [g]
224    1,073,741,824 (gigabytes) 
225
226 \item [gb]
227    1,000,000,000 (gigabytes) 
228 \end{description}
229
230 \label{Time}
231 \item [time]
232 \index[dir]{time}
233 A time or duration specified in seconds.  The time is stored internally as
234 a 64 bit integer value, but it is specified in two parts: a number part and
235 a modifier part.  The number can be an integer or a floating point number.
236 If it is entered in floating point notation, it will be rounded to the
237 nearest integer.  The modifier is mandatory and follows the number part,
238 either with or without intervening spaces.  The following modifiers are
239 permitted:
240
241 \begin{description}
242
243 \item [seconds]
244    \index[dir]{seconds}
245    seconds 
246
247 \item [minutes]
248    \index[dir]{minutes}
249    minutes (60 seconds)  
250
251 \item [hours]
252    \index[dir]{hours }
253    hours (3600 seconds)  
254
255 \item [days]
256    \index[dir]{days}
257    days (3600*24 seconds)  
258
259 \item [weeks]
260    \index[dir]{weeks}
261    weeks (3600*24*7 seconds)
262
263 \item [months]
264    \index[dir]{months }
265    months (3600*24*30 seconds)  
266
267 \item [quarters]
268    \index[dir]{quarters }
269    quarters (3600*24*91 seconds)  
270
271 \item [years]
272    \index[dir]{years }
273    years (3600*24*365 seconds)  
274 \end{description}
275
276 Any abbreviation of these modifiers is also permitted (i.e.  {\bf seconds}
277 may be specified as {\bf sec} or {\bf s}).  A specification of {\bf m} will
278 be taken as months.
279
280 The specification of a time may have as many number/modifier parts as you
281 wish.  For example:
282
283 \footnotesize
284 \begin{verbatim}
285 1 week 2 days 3 hours 10 mins
286 1 month 2 days 30 sec
287    
288 \end{verbatim}
289 \normalsize
290
291 are valid date specifications.
292
293 \end{description}
294
295 \label{ResTypes}
296 \section{Resource Types}
297 \index[general]{Types!Resource }
298 \index[general]{Resource Types }
299
300 The following table lists all current Bacula resource types. It shows what
301 resources must be defined for each service (daemon). The default configuration
302 files will already contain at least one example of each permitted resource, so
303 you need not worry about creating all these kinds of resources from scratch. 
304
305 \addcontentsline{lot}{table}{Resource Types}
306 \begin{longtable}{|l|l|l|l|l|}
307  \hline 
308 \multicolumn{1}{|c| }{\bf Resource } & \multicolumn{1}{c| }{\bf Director } &
309 \multicolumn{1}{c| }{\bf Client } & \multicolumn{1}{c| }{\bf Storage } &
310 \multicolumn{1}{c| }{\bf Console  } \\
311  \hline 
312 {Autochanger } & {No  } & {No } & {Yes } & {No  } \\
313 \hline
314 {Catalog } & {Yes } & {No  } & {No } & {No  } \\
315  \hline 
316 {Client  } & {Yes } & {Yes } & {No } & {No  } \\
317  \hline 
318 {Console } & {Yes } & {No } & {No } & {Yes  } \\
319  \hline 
320 {Device  } & {No  } & {No } & {Yes } & {No  } \\
321  \hline 
322 {Director } & {Yes } & {Yes } & {Yes } & {Yes  } \\
323  \hline 
324 {FileSet } & {Yes } & {No } & {No } & {No  } \\
325  \hline 
326 {Job  } & {Yes } & {No } & {No } & {No  } \\
327  \hline 
328 {JobDefs } & {Yes } & {No } & {No } & {No  } \\
329  \hline 
330 {Message } & {Yes } & {Yes } & {Yes } & {No  } \\
331  \hline 
332 {Pool  } & {Yes } & {No } & {No } & {No  } \\
333  \hline 
334 {Schedule } & {Yes } & {No } & {No } & {No  } \\
335  \hline 
336 {Storage } & {Yes } & {No } & {Yes } & {No }
337 \\ \hline 
338
339 \end{longtable}
340
341 \section{Names, Passwords and Authorization}
342 \label{Names}
343 \index[general]{Authorization!Names Passwords and }
344 \index[general]{Names, Passwords and Authorization }
345 \index[general]{Passwords}
346
347 In order for one daemon to contact another daemon, it must authorize itself
348 with a password. In most cases, the password corresponds to a particular name,
349 so both the name and the password must match to be authorized. Passwords are
350 plain text, any text.  They are not generated by any special process; just
351 use random text.
352
353 The default configuration files are automatically defined for correct
354 authorization with random passwords. If you add to or modify these files, you
355 will need to take care to keep them consistent. 
356
357 Here is sort of a picture of what names/passwords in which files/Resources
358 must match up: 
359
360 \includegraphics{\idir Conf-Diagram.eps} 
361
362 In the left column, you will find the Director, Storage, and Client resources,
363 with their names and passwords -- these are all in {\bf bacula-dir.conf}. In
364 the right column are where the corresponding values should be found in the
365 Console, Storage daemon (SD), and File daemon (FD) configuration files. 
366
367 Please note that the Address, {\bf fd-sd}, that appears in the Storage
368 resource of the Director, preceded with and asterisk in the above example, is
369 passed to the File daemon in symbolic form. The File daemon then resolves it
370 to an IP address. For this reason, you must use either an IP address or a
371 fully qualified name. A name such as {\bf localhost}, not being a fully
372 qualified name, will resolve in the File daemon to the localhost of the File
373 daemon, which is most likely not what is desired. The password used for the
374 File daemon to authorize with the Storage daemon is a temporary password
375 unique to each Job created by the daemons and is not specified in any .conf
376 file. 
377
378 \section{Detailed Information for each Daemon}
379 \index[general]{Detailed Information for each Daemon }
380 \index[general]{Daemon!Detailed Information for each }
381
382 The details of each Resource and the directives permitted therein are
383 described in the following chapters. 
384
385 The following configuration files must be defined: 
386
387 \begin{itemize}
388 \item 
389    \ilink{Console}{ConsoleConfChapter} -- to define the resources for 
390    the Console program (user interface to the Director).  It defines which
391 Directors are  available so that you may interact with them. 
392 \item 
393    \ilink{Director}{DirectorChapter} -- to define the resources 
394    necessary for the Director. You define all the Clients  and Storage daemons
395 that you use in this configuration file.  
396 \item 
397    \ilink{Client}{FiledConfChapter} -- to define the resources for 
398    each client to be backed up. That is, you will have a separate  Client
399 resource file on each machine that runs a File daemon. 
400 \item 
401    \ilink{Storage}{StoredConfChapter} -- to define the resources to 
402    be used by each Storage daemon. Normally, you will have  a single Storage
403 daemon that controls your tape drive or tape  drives. However, if you have
404 tape drives on several machines,  you will have at least one Storage daemon
405 per machine.  
406 \end{itemize}