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