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