]> git.sur5r.net Git - bacula/docs/blob - docs/manual-fr/storedconf.tex
Debut de stored.conf.
[bacula/docs] / docs / manual-fr / storedconf.tex
1 %%
2 %%
3
4 \section*{Configuration du Storage Daemon}
5 \label{_ChapterStart31}
6 \index[general]{Configuration du Storage Daemon}
7 \index[general]{Configuration!Storage Daemon}
8 \addcontentsline{toc}{section}{Configuration du Storage Daemon}
9
10 \subsection*{General}
11 \index[general]{General}
12 \addcontentsline{toc}{subsection}{General}
13 Le fichier de configuration du Storage Daemon a relativement peu de d\'efinitions 
14 de resources. Cependant, en raison du nombre pl\'ethorique de media et de syst\`emes, 
15 il doit \^etre hautement param\'etrable. Par cons\'equent, il existe un nombre assez important 
16 de directives dans la d\'eficnition de ressource Devices qui vous permet de d\'efinir 
17 toutes les caract\'eristiques de votre p\'eriph\'erique de stockage. Heureusement, avec les 
18 mat\'eriels modernes, les valeurs par d\'efaut sont g\'en\'eralement suffisantes, et tr\`es 
19 peu de directives sont r\'eellement indispensables.
20
21 Des exemples de directives de ressources device connues pour fonctionner pour 
22 beaucoup de lecteurs de bandes communs peuvent \^etre trouv\'es dans le r\'epertoire : 
23 \lt{}bacula-src\gt{}/examples/devices}. La plupart seront \'enum\'er\'es ici.
24
25 Pour un discussion g\'en\'erale concernant les fichiers de configuration de Bacula, 
26 les ressources et les types de donn\'ees reconnus, veuillez consulter le 
27 chapitre \ilink{Configuration}{_ChapterStart16} de ce manuel. Les d\'efinitions de 
28 ressources Storage suivantes doivent \^etre d\'efinies :
29
30 \begin{itemize}
31 \item 
32    \ilink{Storage}{StorageResource} -- Pour d\'efinir le nom du Storage Daemon.
33 \item 
34    \ilink{Director}{DirectorResource1} -- Pour d\'efinir le nom du Director et le mot 
35    de passe permettant d'y acc\'eder.
36 \item 
37    \ilink{Device}{DeviceResource} -- Pour d\'efinir les caract\'eristiques de votre 
38    p\'eriph\'erique de stockage.
39 \item 
40    \ilink{Messages}{_ChapterStart15} -- Pour d\'efinir o\`u les messages d'erreurs 
41    et d'information doivent \^etre exp\'edi\'es.
42 \end{itemize}
43
44 \subsection*{Ressource Storage}
45 \label{StorageResource}
46 \index[general]{Ressource!Storage}
47 \index[general]{Ressource Sorage}
48 \addcontentsline{toc}{subsection}{Ressource Storage}
49
50 En g\'en\'eral, les propri\'et\'es sp\'ecifi\'ees au niveau de la ressource Storage d\'efinissent 
51 des propri\'et\'es globales du Storage Daemon. Chaque fichier de configuration de 
52 Storage Daemon doit avoir sa propre d\'efinition de ressource Storage.
53
54 \begin{description}
55
56 \item [Name = \lt{}Storage-Daemon-Name\gt{}]
57    \index[sd]{Name}
58    \index[sd]{Directive!Name}
59    Sp\'ecifie le nom du Storage Daemon. Cette directive est requise.
60 \item [Working Directory = \lt{}R\'epertoire\gt{}]
61    \index[sd]{Working Directory}
62    \index[sd]{Directive!Working Directory}
63    Cette directive sp\'ecifie un r\'epertoire o\`u le Storage Daemon peut placer ses fichiers 
64    d'\'etat. Ce r\'epertoire ne devrait \^etre utilis\'e que par Bacula, mais peut \^etre 
65    partag\'e par d'autres daemons Bacula, pourvu que les noms donn\'es \`a chaque daemon 
66    soient uniques. Cette directive est requise.
67
68 \item [Pid Directory = \lt{}R\'epertoire\gt{}]
69    \index[sd]{Pid Directory}
70    \index[sd]{Directive!Pid Directory}
71       Cette directive sp\'ecifie un r\'epertoire o\`u le Storage Daemon peut d\'eposer son fichier
72 d'Id de processus. Ce fichier est utilis\'e pour stopper Bacula et pr\'evenir l'ex\'ecution
73 simultan\'ee de plusieurs copies de Bacula. Les substitutions shell standard sont
74 effectu\'ees \`a la lecture du fichier de configuration, de sorte que des valeurs
75 telles que {\bf \$HOME} seront correctement substitu\'ees. 
76    
77 Typiquement, sur les syst\`emes Linux, vous utiliserez ici {\bf /var/run}. Si vous
78 n'installez pas Bacula dans les r\'epertoires syst\`eme, vous pouvez utiliser le
79 r\'epertoire de travail {\bf Working Directory} d\'efini plus haut.
80 Cette directive est requise.
81
82 \item [Heartbeat Interval = \lt{}P\'eriode\gt{}]
83    \index[sd]{Heartbeat Interval}
84    \index[sd]{Directive!Heartbeat Interval}
85    \index[general]{Heartbeat Interval}
86    \index[general]{Broken pipe}
87    Cette directive d\'efinit la p\'eriode des pulsations \'emises par le Storage Daemon 
88    vers le File Daemon lorqu'il (le SD) se trouve en situation d'attente du montage 
89    d'une cartouche par l'op\'erateur. La valeur par d\'efaut est z\'ero, ce qui d\'esactive 
90    les pulsations. Cette fonctionnalit\'e est particuli\`erement utile si vous avez un 
91    routeur (tel que les 3Com) qui ne suit pas les standards Internet et expire une 
92    connection valide apr\`es une courte dur\'ee, bien que {\it keepalive} soit activ\'e. 
93    Ceci produit habituellement un message d'erreur du type {\it broken pipe}.
94
95 \item [Maximum Concurrent Jobs = \lt{}nombre\gt{}]
96    \index[sd]{Maximum Concurrent Jobs}
97    \index[sd]{Directive!Maximum Concurrent Jobs}
98    O\`u \lt{}nombre\gt{} est nombre maximal de jobs qui peuvent \^etre ex\'ecut\'es 
99    simultan\'ement. La valeur par d\'efaut est fix\'ee \`a 10, mais vous pouvez d\'efinir 
100    une valeur plus grande. Chaque connexion depuis le Director (par exemple 
101    une requ\^ete de statut, le lancement d'un job...) est consid\'er\'ee comme un job, 
102    aussi, si vous voulez conserver la possibilit\'e d'utiliser la commande 
103    {\bf status} dans la console alors qu'un job est en cours d'ex\'ecution, vous 
104    devez utiliser une valeur strictement sup\'erieure \`a 1. Pour ex\'ecuter plusieurs 
105    jobs simultan\'ement, vous devez param\'etrer plusieurs autres directives dans le 
106    fichier de configuration du Director. Selon ce que vous voulez faire, il faudra 
107    intervenir sur l'un ou l'autre param\`etre, mais vous devrez presque surement 
108    r\'egler le param\`etre {\bf Maximum Concurrent Jobs} de la ressource Storage du 
109    fichier de configuration du Director, et peut-\^etre aussi ceux des ressources 
110    Job et Client.
111    
112 \item [SDAddresses = \lt{}Adresse IP\gt{}]
113    \index[sd]{SDAddresses}
114    \index[sd]{Directive!SDAddresses}
115    Pr\'ecise les ports et adresses sur lesquels le Storage Daemon est \`a 
116    l'\'ecoute de connections du Director. En principe, les valeurs par d\'efaut sont 
117    suffisantes, et vous n'avez pas besoin d'utiliser cette directive. La meilleure 
118    explication du fonctionnement de cette directive est certainement un exemple :
119    
120 \footnotesize
121 \begin{verbatim}
122  SDAddresses  = { ip = {
123         addr = 1.2.3.4; port = 1205; }
124     ipv4 = {
125         addr = 1.2.3.4; port = http; }
126     ipv6 = {
127         addr = 1.2.3.4;
128         port = 1205;
129     }
130     ip = {
131         addr = 1.2.3.4
132         port = 1205
133     }
134     ip = {
135         addr = 1.2.3.4
136     }
137     ip = {
138         addr = 201:220:222::2
139     }
140     ip = {
141         addr = bluedot.thun.net
142     }
143 }
144 \end{verbatim}
145 \normalsize
146
147 o\`u "ip", "ip4", "ip6", "addr", et "port" sont des mots-clef. Notez que les adresses 
148 peuvent \^etre sp\'ecifi\'ees sous forme de quadruplets point\'es, de nom symboliques 
149 (uniquement dans la sp\'ecification "ip") ou en notation IPv6 \`a double points. Le port 
150 peut quand \`a lui \^etre sp\'ecifi\'e par son num\'ero, ou par sa valeur mn\'emonique du 
151 fichier /etc/services. Si un port n'est pas sp\'ecifi\'e, la valeur par d\'efaut est 
152 utilis\'ee. Si une section ip est sp\'ecifi\'ee, la r\'esolution peut \^etre r\'ealis\'ee 
153 par ipv4 ou ipv6. En revanche, si ip4 ou ip6 est sp\'ecifi\'ee, seule la r\'esolution 
154 correspondante fonctionne.
155
156 Vous pouvez, avec ces directives, remplacer les valeurs des directives  SDPort et 
157 SDAddress montr\'ees ci-dessous.
158
159 \item [SDPort = \lt{}Num\'ero de port\gt{}]
160    \index[sd]{SDPort}
161    \index[sd]{Directive!SDPort}
162    Sp\'ecifie le num\'ero de port sur lequel le Storage Daemon \'ecoute les connexions 
163    en provenance du Director. La valeur par d\'efaut est 9103.
164    
165 \item [SDAddress = \lt{}Adresse IP\gt{}]
166    \index[sd]{SDAddress}
167    \index[sd]{Directive!SDAddress}
168     Cette directive est optionnelle. Lorsqu'elle est sp\'ecifi\'ee, le Storage Daemon n'accepte
169     de connections (de Director(s) ou de File(s) Daemon(s)) que de l'adresse sp\'ecifi\'ee 
170     {\bf Adresse-IP}, qui peut \^etre
171     soit un nom de domaine, soit une adresse IP au format quadruplet point\'e.
172     Si cette directive n'est pas sp\'ecifi\'ee, le Storage Daemon acceptera des connections de 
173     de toute adresse valide. 
174
175 \end{description}
176
177 Voici une d\'efinition typique d'une ressource Storage Daemon :
178
179
180 \footnotesize
181 \begin{verbatim}
182 #
183 # "Global" Storage daemon configuration specifications appear
184 # under the Storage resource.
185 #
186 Storage {
187   Name = "Storage daemon"
188   Address = localhost
189   WorkingDirectory = "~/bacula/working"
190   Pid    Directory = "~/bacula/working"
191 }
192 \end{verbatim}
193 \normalsize
194
195 \subsection*{La ressource Director}
196 \label{DirectorResource1}
197 \index[general]{Ressource Director}
198 \index[general]{Resource!Director}
199 \addcontentsline{toc}{subsection}{La ressource Director}
200
201 La ressource Director sp\'ecifie le nom du Director qui est autoris\'e 
202 \`a utiliser les services du Storage Daemon. Il peut exister plusieurs 
203 ressources Director. Le nom et le mot de passe du Director doivent 
204 s'accorder avec leurs homologues dans le fichier de configuration 
205 du Storage Daemon.
206
207 \begin{description}
208
209 \item [Name = \lt{}Nom-du-Director\gt{}]
210    \index[sd]{Name}
211    \index[sd]{Directive!Name}
212    Sp\'ecifie le nom du Director autoris\'e \`a se connecter au Storage Daemon.
213    Cette directive est requise.
214
215 \item [Password = \lt{}Mot-de-passe-du-Director\gt{}]
216    \index[sd]{Password}
217    \index[sd]{Directive!Password}
218    Sp\'ecifie le mot de passe qui doit \^etre soumis par le Director susnomm\'e.
219    Cette directive est requise.
220
221 \item [Monitor = \lt{}yes|no\gt{}]
222    \index[sd]{Monitor}
223    \index[sd]{Directive!Monitor}
224    Si cette directive est d\'esactiv\'ee ({\bf no}), ce qui est le cas par d\'efaut, 
225    ce Director dispose d'un acc\`es illimit\'e \`a ce Storage Daemon. Dans le cas 
226    contraire, ce Director est brid\'e de fa\\ 3on \`a pouvoir seulement r\'ecup\'erer le 
227    statut courant de ce Storage Daemon.
228
229    Si ce Director est utilis\'e par un superviseur, nous vous recommandons 
230    fortement d'activer cette directive pour \'eviter de s\'erieux probl\`emes de 
231    s\'ecurit\'e.
232
233 \end{description}
234
235 Voici un exemple d'une d\'efinition de ressource Director valide :
236
237 \footnotesize
238 \begin{verbatim}
239 Director {
240   Name = MainDirector
241   Password = my_secret_password
242 }
243 \end{verbatim}
244 \normalsize
245
246 \label{DeviceResource}
247 \subsection*{La Ressource Device}
248 \index[general]{Resource!Device}
249 \index[general]{Ressource Device}
250 \addcontentsline{toc}{subsection}{Ressource Device}
251
252 La ressource Device sp\'ecifie les d\'etails de chaque p\'eriph\'erique (en g\'en\'eral, 
253 un lecteur de bandes) qui peut \^etre utilis\'e par le Storage Daemon. Un 
254 Storage Daemon peut disposer de plusieurs ressources Device. En g\'en\'eral, 
255 les propri\'et\'es sp\'ecifi\'ees dans la ressource Device sont sp\'ecifiques 
256 au p\'eriph\'erique.
257
258 \begin{description}
259
260 \item [Name = {\it Nom-de-p\'eriph\'erique}]
261    \index[sd]{Name}
262    \index[sd]{Directive!Name}
263    Sp\'ecifie le nom que le Director devra utiliser pour d\'esigner ce p\'eriph\'erique. 
264    Il s'agit d'un nom logique, c'est une cha\^ine qui peut comporter jusqu'\`a 127 
265    caract\`eres. C'est en g\'en\'eral une bonne id\'ee d'utiliser un nom qui corresponde 
266    au nom "humain" du p\'eriph\'erique (NDT: la vo dit "the english name"). Le nom 
267    physique du p\'eriph\'erique est sp\'ecifi\'e au niveau de la directive {\bf Archive Device} 
268    d\'ecrite ci-dessous. Le nom que vous sp\'ecifiez ici est aussi utilis\'e dans le 
269    fichier de configuration de votre Director au niveau de la 
270    \ilink{directive Device}{StorageResource2} de sa ressource Storage.   
271
272 \item [Archive Device = {\it name-string}]
273    \index[sd]{Archive Device}
274    \index[sd]{Directive!Archive Device}
275    The specified {\bf name-string} gives the system file name of the  storage
276    device managed by this storage daemon. This will usually be  the device file
277    name of a removable storage device (tape drive),  for example "{\bf
278    /dev/nst0}" or "{\bf /dev/rmt/0mbn}".  For a DVD-writer, it will be for
279    example {\bf /dev/hdc}.  It may also be a directory name if you are archiving
280    to disk storage.  In this case, you must supply the full absolute path to the
281    directory.  When specifying a tape device, it is preferable that the 
282    "non-rewind" variant of the device file name be given.  In addition, on
283    systems such as Sun, which have multiple tape  access methods, you must be
284    sure to specify to use  Berkeley I/O conventions with the device. The {\bf b}
285    in the Solaris (Sun)  archive specification {\bf /dev/rmt/0mbn} is what is
286    needed in  this case. Bacula does not support SysV tape drive behavior.  
287    
288    As noted above, normally the Archive Device is the name of a  tape drive, but
289    you may also specify an absolute path to  an existing directory. If the Device
290    is a directory  Bacula will write to file storage in the specified directory,
291    and  the filename used will be the Volume name as specified in the  Catalog.
292    If you want to write into more than one directory (i.e.  to spread the load to
293    different disk drives), you will need to define  two Device resources, each
294    containing an Archive Device with a  different directory.  
295    
296    In addition to a tape device name or a directory name, Bacula will  accept the
297    name of a FIFO. A FIFO is a special kind of file that  connects two programs
298    via kernel memory. If a FIFO device is specified  for a backup operation, you
299    must have a program that reads what Bacula  writes into the FIFO. When the
300    Storage daemon starts the job, it  will wait for {\bf MaximumOpenWait} seconds
301    for the read program to start reading, and then time it out and  terminate
302    the job. As a consequence, it is best to start the read  program at the
303    beginning of the job perhaps with the {\bf RunBeforeJob}  directive. For this
304    kind of device, you never want to specify  {\bf AlwaysOpen}, because you want
305    the Storage daemon to open it only  when a job starts, so you must explicitly
306    set it to {\bf No}.  Since a FIFO is a one way device, Bacula will not attempt
307    to read  a label of a FIFO device, but will simply write on it. To create a 
308    FIFO Volume in the catalog, use the {\bf add} command rather than  then {\bf
309    label} command to avoid attempting to write a label.  
310    
311    During a restore operation, if the Archive Device is a FIFO, Bacula  will
312    attempt to read from the FIFO, so you must have an external program  that
313    writes into the FIFO. Bacula will wait {\bf MaximumOpenWait} seconds  for the
314    program to begin writing and will then time it out and  terminate the job. As
315    noted above, you may use the {\bf RunBeforeJob}  to start the writer program
316    at the beginning of the job.  
317    
318    The Archive Device directive is required. 
319
320 \item [Device Type = {\it type-specification}]
321    \index[sd]{Device Type}
322    \index[sd]{Directive!Device Type}
323    The Device Type specification allows you to explicitly tell Bacula
324    what kind of device you are defining. It the {\it type-specification}
325    may be one of the following:
326    \begin{description}
327    \item [File]
328      Tells Bacula that the device is a file. It may either be a
329      file defined on fixed medium or a removable filesystem such as
330      USB.  All files must be random access devices.
331    \item [Tape]
332      The device is a tape device and thus is sequential access. Tape devices
333      are controlled using ioctl() calls.
334    \item [Fifo]
335      The device is a first-in-first out sequential access read-only 
336      or write-only device.
337    \item [DVD]
338      The device is a DVD. DVDs are sequential access for writing, but
339      random access for reading.
340   \end{description}
341   
342   The Device Type directive is not required, and if not specified, Bacula
343   will attempt to guess what kind of device has been specified using the
344   Archive Device specification supplied. There are several advantages to
345   explicitly specifying the Device Type. First, on some systems, block and
346   character devices have the same type, which means that on those systems,
347   Bacula is unlikely to be able to correctly guess that a device is a DVD.
348   Secondly, if you explicitly specify the Device Type, the mount point
349   need not be defined until the device is opened. This is the case with
350   most removable devices such as USB that are mounted by the HAL daemon.
351   If the Device Type is not explicitly specified, then the mount point
352   must exist when the Storage daemon starts.
353
354   This directive was implemented in Bacula version 1.38.6.
355
356
357 \item [Media Type = {\it name-string}]
358    \index[sd]{Media Type}
359    \index[sd]{Directive!Media Type}
360    The specified {\bf name-string} names the type of media supported by this
361    device, for example, "DLT7000".  Media type names are arbitrary in that you
362    set them to anything you want, but they must be known to the volume
363    database to keep track of which storage daemons can read which volumes.  In
364    general, each different storage type should have a unique Media Type
365    associated with it.  The same {\bf name-string} must appear in the
366    appropriate Storage resource definition in the Director's configuration
367    file.
368    
369    Even though the names you assign are arbitrary (i.e.  you choose the name
370    you want), you should take care in specifying them because the Media Type
371    is used to determine which storage device Bacula will select during
372    restore.  Thus you should probably use the same Media Type specification
373    for all drives where the Media can be freely interchanged.  This is not
374    generally an issue if you have a single Storage daemon, but it is with
375    multiple Storage daemons, especially if they have incompatible media.
376    
377    For example, if you specify a Media Type of "DDS-4" then during the
378    restore, Bacula will be able to choose any Storage Daemon that handles
379    "DDS-4".  If you have an autochanger, you might want to name the Media Type
380    in a way that is unique to the autochanger, unless you wish to possibly use
381    the Volumes in other drives.  You should also ensure to have unique Media
382    Type names if the Media is not compatible between drives.  This
383    specification is required for all devices.
384
385    In addition, if you are using disk storage, each Device resource will
386    generally have a different mount point or directory. In order for
387    Bacula to select the correct Device resource, each one must have a
388    unique Media Type.
389
390 \label{Autochanger}
391 \item [Autochanger = {\it Yes|No}]
392    \index[sd]{Autochanger}
393    \index[sd]{Directive!Autochanger}
394    If {\bf Yes}, this device belongs to an automatic tape changer, and  you should also
395    specify a {\bf Changer Device} as well as  a {\bf Changer Command}.  If {\bf
396    No} (default), the volume must be manually changed.  You should also
397    have an identical directive to the  
398    \ilink{Storage resource}{Autochanger1}  in the Director's
399    configuration file so that  when labeling tapes you are prompted for the slot.
400
401 \item [Changer Device = {\it name-string}]
402    \index[sd]{Changer Device}
403    \index[sd]{Directive!Changer Device}
404    The specified {\bf name-string} must be the {\bf generic SCSI} device
405    name of the autochanger that corresponds to the normal read/write
406    {\bf Archive Device}  specified in the Device resource. This
407    gemeric SCSI device name should be specified if you have an autochanger 
408    or if you have a standard tape drive and want to use the
409    {\bf Alert Command} (see below). For example, on Linux systems, for 
410    an Archive Device name of {\bf /dev/nst0}, you would specify {\bf
411    /dev/sg0} for the Changer Device name. Depending on your exact
412    configuration, and the number of autochangers or the type of
413    autochanger, what you specify here can vary.  This directive is
414    optional.  See the \ilink{ Using Autochangers}{_ChapterStart18} chapter
415    of this manual for more details of using this and the following
416    autochanger directives.
417
418 \item [Changer Command = {\it name-string}]
419    \index[sd]{Changer Command}
420    \index[sd]{Directive!Changer Command}
421    The {\bf name-string} specifies an external program to be called  that will
422    automatically change volumes as required by {\bf Bacula}.  Most frequently,
423    you will specify the Bacula supplied {\bf mtx-changer}  script as follows:  
424
425 \footnotesize
426 \begin{verbatim}
427 Changer Command = "/path/mtx-changer %c %o %S %a %d"
428 \end{verbatim}
429 \normalsize
430
431    and you will install the {\bf mtx} on your system (found  in the {\bf depkgs}
432    release). An example of this command is in the default bacula-sd.conf file. 
433    For more details on the substitution characters that may be specified  to
434    configure your autochanger please see  the 
435    \ilink{Autochangers}{_ChapterStart18} chapter of this  manual.
436    For FreeBSD users, you might want to see one of the  several {\bf chio}
437    scripts in {\bf examples/autochangers}.  
438
439 \item [Alert Command = {\it name-string}]
440    \index[sd]{Alert Command}
441    The {\bf name-string} specifies an external program to be called  at the
442    \index[sd]{Directive!Changer Command}
443    completion of each Job after the device is released.  The purpose of this
444    command is to check for Tape Alerts, which  are present when something is
445    wrong with your tape drive  (at least for most modern tape drives).  The same
446    substitution characters that may be specified  in the Changer Command may also
447    be used in this string.  For more information, please see  the 
448    \ilink{Autochangers}{_ChapterStart18} chapter of this  manual. 
449    
450    
451    Note, it is not necessary to have an autochanger to use this  command. The
452    example below uses the {\bf tapeinfo} program  that comes with the {\bf mtx}
453    package, but it can be used  on any tape drive. However, you will need to
454    specify  a {\bf Changer Device} directive in your Device resource  (see above)
455    so that the generic SCSI device name can be  edited into the command (with the
456    \%c).  
457    
458    An example of the use of this command to print Tape Alerts  in the Job report
459    is:  
460
461 \footnotesize
462 \begin{verbatim}
463 Alert Command = "sh -c 'tapeinfo -f %c | grep TapeAlert'"
464       
465 \end{verbatim}
466 \normalsize
467
468 and an example output when there is a problem could be:  
469
470 \footnotesize
471 \begin{verbatim}
472 bacula-sd  Alert: TapeAlert[32]: Interface: Problem with SCSI interface
473                   between tape drive and initiator.
474       
475 \end{verbatim}
476 \normalsize
477
478 \item [Drive Index = {\it number}]
479    \index[sd]{Drive Index}
480    \index[sd]{Directive!Drive Index}
481    The {\bf Drive Index} that you specify is passed to the  {\bf mtx-changer}
482    script and is thus passed to the {\bf mtx}  program. By default, the Drive
483    Index is zero, so if you have only  one drive in your autochanger, everything
484    will work normally.  However, if you have multiple drives, you may specify two
485    Bacula  Device resources. The first will either set Drive Index to zero,  or
486    leave it unspecified, and the second Device Resource should  contain a Drive
487    Index set to 1. This will then permit you to  use two or more drives in your
488    autochanger. However, you must ensure  that Bacula does not request the same
489    Volume on both drives  at the same time. You may also need to modify the
490    mtx-changer  script to do locking so that two jobs don't attempt to use  the
491    autochanger at the same time. An example script can  be found in {\bf
492    examples/autochangers/locking-mtx-changer}.
493
494 \item [Autoselect = {\it Yes|No}]
495    \index[sd]{Autoselect}
496    \index[sd]{Directive!Autoselect}
497    If this directive is set to {\bf yes} (default), and the Device
498    belongs to an autochanger, then when the Autochanger is referenced
499    by the Director, this device can automatically be selected. If this
500    directive is set to {\bf no}, then the Device can only be referenced
501    by directly using the Device name in the Director. This is useful
502    for reserving a drive for something special such as a high priority
503    backup or restore operations.
504
505 \item [Maximum Changer Wait = {\it time}]
506    \index[sd]{Maximum Changer Wait}
507    \index[sd]{Directive!Maximum Changer Wait}
508    This directive specifies the maximum time in seconds for Bacula to wait
509    for an autochanger to change the volume.  If this time is exceeded,
510    Bacula will invalidate the Volume slot number stored in the catalog and
511    try again.  If no additional changer volumes exist, Bacula will ask the
512    operator to intervene.  The default is 5 minutes.      
513
514 \item [Maximum Rewind Wait = {\it time}]
515    \index[sd]{Maximum Rewind Wait}
516    \index[sd]{Directive!Maximum Rewind Wait}
517    This directive specifies the maximum time in seconds for Bacula to wait
518    for a rewind before timing out.  If this time is exceeded,
519    Bacula will cancel the job.  The default is 5 minutes.
520
521 \item [Maximum Open Wait = {\it time}]
522    \index[sd]{Maximum Open Wait}
523    \index[sd]{Directive!Maximum Open Wait}
524    This directive specifies the maximum time in seconds for Bacula to wait
525    for a open before timing out.  If this time is exceeded,
526    Bacula will cancel the job.  The default is 5 minutes.
527
528 \item [Always Open = {\it Yes|No}]
529    \index[sd]{Always Open}
530    \index[sd]{Directive!Always Open}
531    If {\bf Yes} (default), Bacula will always keep the device open unless
532    specifically {\bf unmounted} by the Console program.  This permits
533    Bacula to ensure that the tape drive is always available.  If you set
534    {\bf AlwaysOpen} to {\bf no} {\bf Bacula} will only open the drive when
535    necessary, and at the end of the Job if no other Jobs are using the
536    drive, it will be freed.  The next time Bacula wants to append to a tape
537    on a drive that was freed, Bacula must rewind the tape and position to
538    the end.  To avoid unnecessary tape positioning and to minimize
539    unnecessary operator intervention, it is highly recommended that {\bf
540    Always Open = yes}.  This also ensures that the drive is available when
541    Bacula needs it.
542    
543    If you have {\bf Always Open = yes} (recommended) and you want  to use the
544    drive for something else, simply use the {\bf unmount}  command in the Console
545    program to release the drive. However, don't  forget to remount the drive with
546    {\bf mount} when the drive is  available or the next Bacula job will block.  
547    
548    For File storage, this directive is ignored. For a FIFO storage  device, you
549    must set this to {\bf No}.  
550    
551    Please note that if you set this directive to {\bf No} Bacula  will release
552    the tape drive between each job, and thus the next job  will rewind the tape
553    and position it to the end of the data. This  can be a very time consuming
554    operation. 
555
556 \item [Volume Poll Interval = {\it time}]
557    \index[sd]{Volume Poll Interval}
558    \index[sd]{Directive!Volume Poll Interval}
559    If the time  specified on this directive is non-zero, after  asking the
560    operator to mount a new volume Bacula will  periodically poll (or read) the
561    drive at the specified  interval to see if a new volume has been mounted. If
562    the  time interval is zero (the default), no polling will occur.  This
563    directive can be useful if you want to avoid operator  intervention via the
564    console. Instead, the operator can  simply remove the old volume and insert
565    the requested one,  and Bacula on the next poll will recognize the new tape
566    and  continue. Please be aware that if you set this interval  too small, you
567    may excessively wear your tape drive if the  old tape remains in the drive,
568    since Bacula will read it on  each poll. This can be avoided by ejecting the
569    tape using  the {\bf Offline On Unmount} and the {\bf Close on Poll} 
570    directives. 
571    However, if you are using a Linux 2.6 kernel or other OSes
572    such as FreeBSD or Solaris, the Offline On Unmount will leave the drive
573    with no tape, and Bacula will not be able to properly open the drive and
574    may fail the job.  For more information on this problem, please see the
575    \ilink{description of Offline On Unmount}{NoTapeInDrive} in the Tape
576    Testing chapter.
577
578 \item [Close on Poll= {\it Yes|No}]
579    \index[sd]{Close on Poll}
580    \index[sd]{Directive!Close on Poll}
581    If {\bf Yes}, Bacula close the device (equivalent to  an unmount except no
582    mount is required) and reopen it at each  poll. Normally this is not too
583    useful unless you have the  {\bf Offline on Unmount} directive set, in which
584    case the  drive will be taken offline preventing wear on the tape  during any
585    future polling. Once the operator inserts a new  tape, Bacula will recognize
586    the drive on the next poll and  automatically continue with the backup. 
587    Please see above more more details.
588
589 \item [Maximum Open Wait = {\it time}]
590    \index[sd]{Maximum Open Wait}
591    \index[sd]{Directive!Maximum Open Wait}
592    This directive specifies the maximum amount of time in seconds that
593    Bacula will wait for a device that is busy.  The default is 5 minutes.
594    If the device cannot be obtained, the current Job will be terminated in
595    error.  Bacula will re-attempt to open the drive the next time a Job
596    starts that needs the the drive.
597
598 \item [Removable media = {\it Yes|No}]
599    \index[sd]{Removable media}
600    \index[sd]{Directive!Removable media}
601    If {\bf Yes}, this device supports removable media (for example, tapes
602    or CDs).  If {\bf No}, media cannot be removed (for example, an
603    intermediate backup area on a hard disk).
604
605 \item [Random access = {\it Yes|No}]
606    \index[sd]{Random access}
607    \index[sd]{Directive!Random access}
608    If {\bf Yes}, the archive device is assumed to be a random access medium
609    which supports the {\bf lseek} (or {\bf lseek64} if Largefile is enabled
610    during configuration) facility.
611
612 \item [Minimum block size = {\it size-in-bytes}]
613    \index[sd]{Minimum block size}
614    \index[sd]{Directive!Minimum block size}
615    On most modern tape drives, you will not need or wamt to specify this
616    directive, and if you do so, it will be to make Bacula use fixed block
617    sizes.  This statement applies only to non-random access devices (e.g.
618    tape drives).  Blocks written by the storage daemon to a non-random
619    archive device will never be smaller than the given {\bf size-in-bytes}.
620    The Storage daemon will attempt to efficiently fill blocks with data
621    received from active sessions but will, if necessary, add padding to a
622    block to achieve the required minimum size.
623    
624    To force the block size to be fixed, as is the case for some non-random
625    access devices (tape drives), set the {\bf Minimum block size} and the
626    {\bf Maximum block size} to the same value (zero included).  The default
627    is that both the minimum and maximum block size are zero and the default
628    block size is 64,512 bytes.  If you wish the block size to be fixed and
629    different from the default, specify the same value for both {\bf Minimum
630    block size} and {\bf Maximum block size}.
631    
632    For  example, suppose you want a fixed block size of 100K bytes, then you 
633    would specify:  
634
635 \footnotesize
636 \begin{verbatim}
637  
638     Minimum block size = 100K
639     Maximum block size = 100K
640     
641 \end{verbatim}
642 \normalsize
643
644    Please note that if you specify a fixed block size as shown above,  the tape
645    drive must either be in variable block size mode, or  if it is in fixed block
646    size mode, the block size (generally  defined by {\bf mt}) {\bf must} be
647    identical to the size specified  in Bacula -- otherwise when you attempt to
648    re-read your Volumes,  you will get an error.  
649    
650    If you want the  block size to be variable but with a 64K minimum and 200K
651    maximum (and  default as well), you would specify:  
652
653 \footnotesize
654 \begin{verbatim}
655  
656     Minimum block size = 64K
657     Maximum blocksize = 200K
658    
659 \end{verbatim}
660 \normalsize
661
662 \item [Maximum block size = {\it size-in-bytes}]
663    \index[sd]{Maximum block size}
664    \index[sd]{Directive!Maximum block size}
665    On most modern tape drives, you will not need to specify this directive.
666    If you do so, it will most likely be to use fixed block sizes (see
667    Minimum block size above).  The Storage daemon will aways attempt to
668    write blocks of the specified {\bf size-in-bytes} to the archive device.
669    As a consequence, this statement specifies both the default block size
670    and the maximum block size.  The size written never exceed the given
671    {\bf size-in-bytes}.  If adding data to a block would cause it to exceed
672    the given maximum size, the block will be written to the archive device,
673    and the new data will begin a new block.
674    
675    If no value is specified or zero is specified, the Storage daemon will
676    use a default block size of 64,512 bytes (126 * 512).
677
678 \item [Hardware End of Medium = {\it Yes|No}]
679    \index[sd]{Hardware End of Medium}
680    \index[sd]{Directive!Hardware End of Medium}
681    If {\bf No}, the archive device is not required to support end  of medium
682    ioctl request, and the storage daemon will use the forward  space file
683    function to find the end of the recorded data. If  {\bf Yes}, the archive
684    device must support the {\tt ioctl}  {\tt MTEOM} call, which will position the
685    tape to the end of the  recorded data. In addition, your SCSI driver must keep
686    track  of the file number on the tape and report it back correctly by  the
687    {\bf MTIOCGET} ioctl. Note, some SCSI drivers will correctly  forward space to
688    the end of the recorded data, but they do not  keep track of the file number.
689    On Linux machines, the SCSI driver  has a {\bf fast-eod} option, which if set
690    will cause the driver  to lose track of the file number. You should ensure
691    that this  option is always turned off using the {\bf mt} program.  
692    
693    Default setting for Hardware End of Medium is {\bf Yes}. This  function is
694    used before appending to a tape to ensure that no  previously written data is
695    lost. We recommend if you have a non-standard or unusual tape drive that you
696    use the {\bf btape} program  to test your drive to see whether or not it
697    supports this function.  All modern (after 1998) tape drives support this
698    feature.  
699    
700 \item [Fast Forward Space File = {\it Yes|No}]
701    \index[sd]{Fast Forward Space File}
702    \index[sd]{Directive!Fast Forward Space File}
703    If {\bf No}, the archive device is not required to support  keeping track of
704    the file number ({\bf MTIOCGET} ioctl) during  forward space file. If {\bf
705    Yes}, the archive device must support  the {\tt ioctl} {\tt MTFSF} call, which
706    virtually all drivers  support, but in addition, your SCSI driver must keep
707    track of the  file number on the tape and report it back correctly by the 
708    {\bf MTIOCGET} ioctl. Note, some SCSI drivers will correctly  forward space,
709    but they do not keep track of the file number or more  seriously, they do not
710    report end of meduim.  
711    
712    Default setting for Fast Forward Space File is {\bf Yes}.
713    
714 \item [Use MTIOCGET = {\it Yes|No}]
715    \index[sd]{Fast Forward Space File}
716    \index[sd]{Directive!Fast Forward Space File}
717    If {\bf No}, the operating system is not required to support keeping track of
718    the file number and reporting it in the ({\bf MTIOCGET} ioctl). The default
719    is {\bf Yes}. If you must set this to No, Bacula will do the proper file
720    position determination, but it is very unfortunate because it means that 
721    tape movement is very inefficient.
722    Fortunately, this operation system deficiency seems to be the case only
723    on a few *BSD systems.  Operating systems known to work correctly are
724    Solaris, Linux and FreeBSD.
725
726 \item [BSF at EOM = {\it Yes|No}]
727    \index[sd]{BSF at EOM}
728    \index[sd]{Directive!BSF at EOM}
729    If {\bf No}, the default, no special action is taken by  Bacula with the End
730    of Medium (end of tape) is reached because  the tape will be positioned after
731    the last EOF tape mark, and  Bacula can append to the tape as desired.
732    However, on some  systems, such as FreeBSD, when Bacula reads the End of
733    Medium  (end of tape), the tape will be positioned after the second  EOF tape
734    mark (two successive EOF marks indicated End of  Medium). If Bacula appends
735    from that point, all the appended  data will be lost. The solution for such
736    systems is to  specify {\bf BSF at EOM} which causes Bacula to backspace  over
737    the second EOF mark. Determination of whether or not  you need this directive
738    is done using the {\bf test} command  in the {\bf btape} program.
739
740 \item [TWO EOF = {\it Yes|No}]
741    \index[sd]{TWO EOF}
742    \index[sd]{Directive!TWO EOF}
743    If {\bf Yes}, Bacula will write two end of file marks when  terminating a tape
744 -- i.e. after the last job or at the end of  the medium. If {\bf No}, the
745 default, Bacula will only write  one end of file to terminate the tape. 
746
747 \item [Backward Space Record = {\it Yes|No}]
748    \index[sd]{Backward Space Record}
749    \index[sd]{Directive!Backward Space Record}
750    If {\it Yes}, the archive device supports the {\tt MTBSR  ioctl} to backspace
751    records. If {\it No}, this call is not  used and the device must be rewound
752    and advanced forward to the  desired position. Default is {\bf Yes} for non
753    random-access  devices. This function if enabled is used at the end of a 
754    Volume after writing the end of file and any ANSI/IBM labels to determine whether
755    or not the last block was written correctly. If you turn this function off,
756    the test will not be done. This causes no harm as the re-read process is
757    precautionary rather than required.
758
759 \item [Backward Space File = {\it Yes|No}]
760    \index[sd]{Backward Space File}
761    \index[sd]{Directive!Backward Space File}
762    If {\it Yes}, the archive device supports the {\bf MTBSF} and  {\bf MTBSF
763   ioctl}s to backspace over an end of file mark and to the  start of a file. If
764   {\it No}, these calls are not used and the  device must be rewound and
765   advanced forward to the desired position.  Default is {\bf Yes} for non
766   random-access devices. 
767
768 \item [Forward Space Record = {\it Yes|No}]
769    \index[sd]{Forward Space Record}
770    \index[sd]{Directive!Forward Space Record}
771    If {\it Yes}, the archive device must support the {\bf MTFSR  ioctl} to
772    forward space over records. If {\bf No}, data must  be read in order to
773    advance the position on the device. Default is  {\bf Yes} for non
774    random-access devices. 
775
776 \item [Forward Space File = {\it Yes|No}]
777    \index[sd]{Forward Space File}
778    \index[sd]{Directive!Forward Space File}
779    If {\bf Yes}, the archive device must support the {\tt MTFSF  ioctl} to
780    forward space by file marks. If {\it No}, data  must be read to advance the
781    position on the device. Default is  {\bf Yes} for non random-access devices. 
782
783 \item [Offline On Unmount = {\it Yes|No}]
784    \index[sd]{Offline On Unmount}
785    \index[sd]{Directive!Offline On Unmount}
786    The default for this directive is {\bf No}. If {\bf Yes} the  archive device
787    must support the {\tt MTOFFL ioctl} to rewind and  take the volume offline. In
788    this case, Bacula will issue the  offline (eject) request before closing the
789    device during the {\bf unmount}  command. If {\bf No} Bacula will not attempt
790    to offline the  device before unmounting it. After an offline is issued,  the
791    cassette will be ejected thus {\bf requiring operator intervention}  to
792    continue, and on some systems require an explicit load command  to be issued
793    ({\bf mt -f /dev/xxx load}) before the system will recognize  the tape. If you
794    are using an autochanger, some devices  require an offline to be issued prior
795    to changing the volume. However,  most devices do not and may get very
796    confused.  
797
798    If you are using a Linux 2.6 kernel or other OSes
799    such as FreeBSD or Solaris, the Offline On Unmount will leave the drive
800    with no tape, and Bacula will not be able to properly open the drive and
801    may fail the job.  For more information on this problem, please see the
802    \ilink{description of Offline On Unmount}{NoTapeInDrive} in the Tape
803    Testing chapter.
804
805
806 \item [Maximum Volume Size = {\it size}]
807    \index[sd]{Maximum Volume Size}
808    \index[sd]{Directive!Maximum Volume Size}
809    No more than {\bf size} bytes will be written onto a given volume on the
810    archive device.  This directive is used mainly in testing Bacula to
811    simulate a small Volume.  It can also be useful if you wish to limit the
812    size of a File Volume to say less than 2GB of data.  In some rare cases
813    of really antiquated tape drives that do not properly indicate when the
814    end of a tape is reached during writing (though I have read about such
815    drives, I have never personally encountered one).  Please note, this
816    directive is deprecated (being phased out) in favor of the {\bf Maximum
817    Volume Bytes} defined in the Director's configuration file.
818
819 \item [Maximum File Size = {\it size}]
820    \index[sd]{Maximum File Size}
821    \index[sd]{Directive!Maximum File Size}
822    No more than {\bf size} bytes will be written into a given logical file
823    on the volume.  Once this size is reached, an end of file mark is
824    written on the volume and subsequent data are written into the next
825    file.  Breaking long sequences of data blocks with file marks permits
826    quicker positioning to the start of a given stream of data and can
827    improve recovery from read errors on the volume.  The default is one
828    Gigabyte.
829
830 \item [Block Positioning = {\it yes|no}]
831    \index[sd]{Block Positioning}
832    \index[sd]{Directive!Block Positioning}
833    This directive is not normally used (and has not yet been  tested). It will
834    tell Bacula not to use block positioning when  it is reading tapes. This can
835    cause Bacula to be {\bf extremely}  slow when restoring files. You might use
836    this directive if you  wrote your tapes with Bacula in variable block mode
837    (the default),  but your drive was in fixed block mode. If it then works as  I
838    hope, Bacula will be able to re-read your tapes. 
839
840 \item [Maximum Network Buffer Size = {\it bytes}]
841    \index[sd]{Maximum Network Buffer Size}
842    \index[sd]{Directive!Maximum Network Buffer Size}
843    where {\it bytes} specifies the initial network buffer  size to use with the
844    File daemon.  This size will be adjusted down if it is too large until
845    it is accepted by the OS. Please use care in setting this value since if
846    it is too large, it will be trimmed by 512 bytes until the OS is happy,
847    which may require a large number of system calls.  The default value is
848    32,768 bytes.
849
850    The default size was chosen to be relatively large but not too big in
851    the case that you are transmitting data over Internet.  It is clear that
852    on a high speed local network, you can increase this number and improve
853    performance. For example, some users have found that if you use a value
854    of 65,536 bytes they get 5-10 times the throughput.  Larger values for
855    most users don't seem to improve performance. If you are interested
856    in improving your backup speeds, this is definitely a place to
857    experiment. You will probably also want to make the corresponding change
858    in each of your File daemons conf files.
859
860
861 \item [Maximum Spool Size = {\it bytes}]
862    \index[sd]{Maximum Spool Size}
863    \index[sd]{Directive!Maximum Spool Size}
864    where the bytes specify the maximum spool size for all jobs  that are running.
865    The default is no limit. 
866
867 \item [Maximum Job Spool Size = {\it bytes}]
868    \index[sd]{Maximum Job Spool Size}
869    \index[sd]{Directive!Maximum Job Spool Size}
870    where the bytes specify the maximum spool size for any one job  that is
871    running. The default is no limit. 
872    This directive is implemented only in version 1.37 and later.
873
874 \item [Spool Directory = {\it directory}]
875    \index[sd]{Spool Directory}
876    \index[sd]{Directive!Spool Directory}
877    specifies the name of the directory to be used to store  the spool files for
878    this device. This directory is also used to store  temporary part files when
879    writing to a device that requires mount (DVD).  The default is to use the
880    working directory. 
881
882 \item [Maximum Part Size = {\it bytes}]
883    \index[sd]{Maximum Part Size}
884    \index[sd]{Directive!Maximum Part Size}
885    This is the maximum size of a volume part file. The default is no limit.
886    This directive is implemented only in version 1.37 and later.
887
888    If the device requires  mount, it is transfered to the device when this size
889    is reached.  In this case, you must take care to have enough disk space left
890    in  the spool directory.  
891
892    Otherwise, it is left on the hard disk.  
893
894    It is ignored for tape and FIFO devices.  
895
896
897 \end{description}
898
899 \subsection*{Devices that require a mount (DVD)}
900 \index[general]{Devices that require a mount (DVD)}
901 \index[general]{DVD!Devices that require a mount}
902 \addcontentsline{toc}{subsection}{Devices that require a mount (DVD)}
903
904 All the directives in this section are implemented only in
905 Bacula version 1.37 and later and hence are available in version 1.38.6.
906
907 As of version 1.39.5, the directives
908 "Requires Mount", "Mount Point", "Mount Command", and "Unmount Command"
909 apply to removable filesystems such as USB in addition to DVD.
910
911 \begin{description}
912
913 \item [Requires Mount = {\it Yes|No}]
914    \index[sd]{Requires Mount}
915    \index[sd]{Directive!Requires Mount}
916    You must set this directive to {\bf yes} for DVD-writers,  and to {\bf no} for
917    all other devices (tapes/files).  This directive indicates if the device
918    requires to be mounted to be read,  and if it must be written in a special way.
919    If it set, {\bf Mount Point},  {\bf Mount Command}, {\bf Unmount Command} and
920    {\bf Write Part Command}  directives must also be defined. 
921
922 \item [Mount Point = {\it directory}]
923    \index[sd]{Mount Point}
924    \index[sd]{Directive!Mount Point}
925    Directory where the device can be mounted. 
926
927 \item [Mount Command = {\it name-string}]
928    \index[sd]{Mount Command}
929    \index[sd]{Directive!Mount Command}
930    Command that must be executed to mount the device. Before the command is 
931    executed, \%a is replaced with the Archive Device, and \%m with the Mount 
932    Point.
933
934    Most frequently, you will define it as follows:  
935
936 \footnotesize
937 \begin{verbatim}
938   Mount Command = "/bin/mount -t iso9660 -o ro %a %m"
939 \end{verbatim}
940 \normalsize
941
942 \item [Unmount Command = {\it name-string}]
943    \index[sd]{Unmount Command}
944    \index[sd]{Directive!Unmount Command}
945    Command that must be executed to unmount the device. Before the command  is
946    executed, \%a is replaced with the Archive Device, and \%m with the  Mount
947    Point.
948
949    Most frequently, you will define it as follows:  
950
951 \footnotesize
952 \begin{verbatim}
953   Unmount Command = "/bin/umount %m"
954 \end{verbatim}
955 \normalsize
956
957 \item [Write Part Command = {\it name-string}]
958    \index[sd]{Write Part Command}
959    \index[sd]{Directive!Write Part Command}
960    Command that must be executed to write a part to the device. Before the 
961    command is executed, \%a is replaced with the Archive Device, \%m with the 
962    Mount Point, \%e is replaced with 1 if we are writing the first part,
963    and with 0 otherwise, and \%v with the current part filename.
964
965    For a DVD, you will most frequently specify the Bacula supplied  {\bf
966    dvd-writepart} script as follows:  
967
968 \footnotesize
969 \begin{verbatim}
970   Write Part Command = "/path/dvd-writepart %e %a %v"
971 \end{verbatim}
972 \normalsize
973
974   Where {\bf /path} is the path to your scripts install directory, and
975   dvd-writepart is the Bacula supplied script file.  
976   This command will already be present, but commented out,
977   in the default bacula-sd.conf file. To use it, simply remove
978   the comment (\#) symbol.
979
980
981 \item [Free Space Command = {\it name-string}]
982    \index[sd]{Free Space Command}
983    \index[sd]{Directive!Free Space Command}
984    Command that must be executed to check how much free space is left on the 
985    device. Before the command is executed,\%a is replaced with the Archive
986    Device, \%m with the Mount Point, \%e is replaced with 1 if we are writing
987    the first part, and with 0 otherwise, and \%v with the current part filename.
988
989    For a DVD, you will most frequently specify the Bacula supplied  {\bf
990    dvd-freespace} script as follows:  
991
992 \footnotesize
993 \begin{verbatim}
994   Free Space Command = "/path/dvd-freespace %a"
995 \end{verbatim}
996 \normalsize
997
998   Where {\bf /path} is the path to your scripts install directory, and
999   dvd-freespace is the Bacula supplied script file.
1000   If you want to specify your own command, please look at the code of
1001   dvd-freespace to see what output Bacula expects from this command.
1002   This command will already be present, but commented out,
1003   in the default bacula-sd.conf file. To use it, simply remove
1004   the comment (\#) symbol.
1005
1006   If you do not set it, Bacula will expect there is always free space on the
1007   device. 
1008
1009 \end{description}
1010
1011 \label{AutochangerRes}
1012 \label{AutochangerResource1}
1013 \input{autochangerres}
1014
1015 \subsection*{Capabilities}
1016 \index[general]{Capabilities}
1017 \addcontentsline{toc}{subsection}{Capabilities}
1018
1019 \begin{description}
1020
1021 \item [Label media = {\it Yes|No}]
1022    \index[sd]{Label media}
1023    \index[sd]{Directive!Label media}
1024    If {\bf Yes}, permits this device to automatically label blank media
1025    without an explicit operator command.  It does so by using an internal
1026    algorithm as defined on the \ilink{Label Format}{Label} record in each
1027    Pool resource.  If this is {\bf No} as by default, Bacula will label
1028    tapes only by specific operator command ({\bf label} in the Console) or
1029    when the tape has been recycled.  The automatic labeling feature is most
1030    useful when writing to disk rather than tape volumes.
1031
1032 \item [Automatic mount = {\it Yes|No}]
1033    \index[sd]{Automatic mount}
1034    \index[sd]{Directive!Automatic mount}
1035    If {\bf Yes} (the default), permits the daemon to examine the device to
1036    determine if it contains a Bacula labeled volume.  This is done
1037    initially when the daemon is started, and then at the beginning of each
1038    job.  If the This directive is particularly important if you have set
1039    {\bf Always Open = no} because it permits Bacula to attempt to read the
1040    device before asking the system operator to mount a tape.  However,
1041    please note that the tape must be mounted before the job begins.
1042
1043 \end{description}
1044
1045 \subsection*{Messages Resource}
1046 \label{MessagesResource1}
1047 \index[general]{Resource!Messages}
1048 \index[general]{Messages Resource}
1049 \addcontentsline{toc}{subsection}{Messages Resource}
1050
1051 For a description of the Messages Resource, please see the 
1052 \ilink{Messages Resource}{_ChapterStart15} Chapter of this
1053 manual. 
1054
1055 \subsection*{Sample Storage Daemon Configuration File}
1056 \label{SampleConfiguration}
1057 \index[general]{File!Sample Storage Daemon Configuration}
1058 \index[general]{Sample Storage Daemon Configuration File}
1059 \addcontentsline{toc}{subsection}{Sample Storage Daemon Configuration File}
1060
1061 A example Storage Daemon configuration file might be the following: 
1062
1063 \footnotesize
1064 \begin{verbatim}
1065 #
1066 # Default Bacula Storage Daemon Configuration file
1067 #
1068 #  For Bacula release 1.37.2 (07 July 2005) -- gentoo 1.4.16
1069 #
1070 # You may need to change the name of your tape drive
1071 #   on the "Archive Device" directive in the Device
1072 #   resource.  If you change the Name and/or the
1073 #   "Media Type" in the Device resource, please ensure
1074 #   that bacula-dir.conf has corresponding changes.
1075 #
1076 Storage {                               # definition of myself
1077   Name = rufus-sd
1078   Address = rufus
1079   WorkingDirectory = "$HOME/bacula/bin/working"
1080   Pid Directory = "$HOME/bacula/bin/working"
1081   Maximum Concurrent Jobs = 20
1082 }
1083 #
1084 # List Directors who are permitted to contact Storage daemon
1085 #
1086 Director {
1087   Name = rufus-dir
1088   Password = "ZF9Ctf5PQoWCPkmR3s4atCB0usUPg+vWWyIo2VS5ti6k"
1089 }
1090 #
1091 # Restricted Director, used by tray-monitor to get the
1092 #   status of the storage daemon
1093 #
1094 Director {
1095   Name = rufus-mon
1096   Password = "9usxgc307dMbe7jbD16v0PXlhD64UVasIDD0DH2WAujcDsc6"
1097   Monitor = yes
1098 }
1099 #
1100 # Devices supported by this Storage daemon
1101 # To connect, the Director's bacula-dir.conf must have the
1102 #  same Name and MediaType.
1103 #
1104 Autochanger {
1105   Name = Autochanger
1106   Device = Drive-1
1107   Device = Drive-2
1108   Changer Command = "/home/kern/bacula/bin/mtx-changer %c %o %S %a %d"
1109   Changer Device = /dev/sg0
1110 }
1111
1112 Device {
1113   Name = Drive-1                      #
1114   Drive Index = 0 
1115   Media Type = DLT-8000
1116   Archive Device = /dev/nst0
1117   AutomaticMount = yes;               # when device opened, read it
1118   AlwaysOpen = yes;
1119   RemovableMedia = yes;
1120   RandomAccess = no;
1121   AutoChanger = yes
1122   Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
1123 }
1124
1125 Device {
1126   Name = Drive-2                      #
1127   Drive Index = 1
1128   Media Type = DLT-8000
1129   Archive Device = /dev/nst1
1130   AutomaticMount = yes;               # when device opened, read it
1131   AlwaysOpen = yes;
1132   RemovableMedia = yes;
1133   RandomAccess = no;
1134   AutoChanger = yes
1135   Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
1136 }
1137
1138 Device {
1139   Name = "HP DLT 80"
1140   Media Type = DLT8000
1141   Archive Device = /dev/nst0
1142   AutomaticMount = yes;                 # when device opened, read it
1143   AlwaysOpen = yes;
1144   RemovableMedia = yes;
1145 }
1146 #Device {
1147 #  Name = SDT-7000                     #
1148 #  Media Type = DDS-2
1149 #  Archive Device = /dev/nst0
1150 #  AutomaticMount = yes;               # when device opened, read it
1151 #  AlwaysOpen = yes;
1152 #  RemovableMedia = yes;
1153 #}
1154 #Device {
1155 #  Name = Floppy
1156 #  Media Type = Floppy
1157 #  Archive Device = /mnt/floppy
1158 #  RemovableMedia = yes;
1159 #  Random Access = Yes;
1160 #  AutomaticMount = yes;               # when device opened, read it
1161 #  AlwaysOpen = no;
1162 #}
1163 #Device {
1164 #  Name = FileStorage
1165 #  Media Type = File
1166 #  Archive Device = /tmp
1167 #  LabelMedia = yes;                   # lets Bacula label unlabeled media
1168 #  Random Access = Yes;
1169 #  AutomaticMount = yes;               # when device opened, read it
1170 #  RemovableMedia = no;
1171 #  AlwaysOpen = no;
1172 #}
1173 #Device {
1174 #  Name = "NEC ND-1300A"
1175 #  Media Type = DVD
1176 #  Archive Device = /dev/hda
1177 #  LabelMedia = yes;                   # lets Bacula label unlabeled media
1178 #  Random Access = Yes;
1179 #  AutomaticMount = yes;               # when device opened, read it
1180 #  RemovableMedia = yes;
1181 #  AlwaysOpen = no;
1182 #  MaximumPartSize = 800M;
1183 #  RequiresMount = yes;
1184 #  MountPoint = /mnt/cdrom;
1185 #  MountCommand = "/bin/mount -t iso9660 -o ro %a %m";
1186 #  UnmountCommand = "/bin/umount %m";
1187 #  SpoolDirectory = /tmp/backup;
1188 #  WritePartCommand = "/etc/bacula/dvd-writepart %e %a %v"
1189 #  FreeSpaceCommand = "/etc/bacula/dvd-freespace %a"
1190 #}
1191 #
1192 # A very old Exabyte with no end of media detection
1193 #
1194 #Device {
1195 #  Name = "Exabyte 8mm"
1196 #  Media Type = "8mm"
1197 #  Archive Device = /dev/nst0
1198 #  Hardware end of medium = No;
1199 #  AutomaticMount = yes;               # when device opened, read it
1200 #  AlwaysOpen = Yes;
1201 #  RemovableMedia = yes;
1202 #}
1203 #
1204 # Send all messages to the Director,
1205 # mount messages also are sent to the email address
1206 #
1207 Messages {
1208   Name = Standard
1209   director = rufus-dir = all
1210   operator = root = mount
1211 }
1212 \end{verbatim}
1213 \normalsize