]> git.sur5r.net Git - bacula/docs/blob - docs/manual-fr/storedconf.tex
Mises a jour.
[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 cha\^ine-nom}]
273    \index[sd]{Archive Device}
274    \index[sd]{Directive!Archive Device}
275    La {\bf cha\^ine-nom} (NDT : name-string dans la vo) sp\'ecifie le nom de fichier syst\`eme 
276    du p\'eriph\'erique de stockage g\'er\'e par ce daemon. Il s'agit en g\'en\'eral d'un nom 
277    de p\'eriph\'erique amovible, par exemple un lecteur de bande d\'esign\'e par "{\bf /dev/nst0}" 
278    ou "{\bf /dev/rmt/0mbn}". Dans le cas d'un graveur de DVD, ce sera par exemple 
279    {\bf /dev/hdc}. Ce peut \^etre aussi un un nom de r\'epertoire si vous sauvegardez 
280    sur disque. Dans ce cas, vous devez soumettre le chemin absolu vers ce 
281    r\'epertoire. Lorsque vous utilisez un lecteur de bandes, il est pr\'ef\'erable 
282    d'utiliser la variante "non-rewind" du fichier de p\'eriph\'erique. De plus, sur les 
283    syst\`emes tels que Sun, qui disposent de plusieurs m\'ethodes d'acc\`es aux cartouches, 
284    prenez soin de sp\'ecifier l'usage de la convention I/O Berkeley avec les p\'eriph\'eriques. 
285    le {\bf b} de la sp\'ecification {\bf /dev/rmt/0mbn} Solaris (Sun) est ce qui est 
286    requis dans ce cas. Bacula ne supporte pas le comportement SysV des lecteurs de bandes. 
287
288    Comme mentionn\'e plus haut,Archive Device est, en principe, le nom d'un lecteur de bandes, 
289    mais vous pouvez tout aussi bien sp\'ecifier le chemin absolu vers un r\'epertoire 
290    existant. Dans ce cas, Bacula utilisera un fichier pour stocker les donn\'ees dans 
291    le r\'epertoire sp\'ecifi\'e, le nom de fichier utilis\'e sera celui du volume tel que 
292    sp\'ecifi\'e dans le catalogue. Si vous souhaitez \'ecrire dans plusieurs r\'epertoires 
293    (dans le but de r\'epartir la charge sur plusieurs disques), vous devez d\'efinir deux ressources 
294    Device, chacune comportant une Archive Device avec un r\'epertoire diff\'erent.
295    
296    Une troisi\`eme possibilit\'e consiste \`a sp\'ecifier le nom d'un FIFO. Un FIFO est un 
297    fichier sp\'ecial qui connecte deux programmes via la m\'emoire du noyau. Si vous 
298    sp\'ecifiez un FIFO en guise d'Archive Device, vous devez avoir un programme qui 
299    lit ce que Bacula \'ecrit dans le FIFO. Lorsque le Storage Daemon d\'emarre le job, 
300    il attend que le programme lecteur commence \`a lire pendant un d\'elai maximal de
301    de {\bf MaximumOpenWait} secondes, au del\`a duquel le job est termin\'e. Par cons\'equent, 
302    il est pr\'ef\'erable de lancer le programme lecteur au d\'ebut du job, par exemple 
303    grâce \`a la directive {\bf RunBeforeJob}. Pour ce type de p\'eriph\'erique, vous ne devez 
304    jamais sp\'ecifier {\bf AlwaysOpen}, puisque vous voulez que le Storage Daemon 
305    ne l'ouvre que lorsqu'un job d\'emarre, aussi veuillez attribuer  explicitement 
306    la valeur {\bf No} \`a cette directive. Puisqu'un FIFO est un p\'eriph\'erique \`a sens 
307    unique, Bacula ne tente pas d'en lire le label, il se contente d'y \'ecrire. Pour 
308    cr\'eer un volume FIFO dans le catalogue, utilisez la commande {\bf add}  plut\^ot 
309    que la commande {\bf label} afin d'\'eviter de tenter d'\'ecrire un label.
310    
311    Lors d'une op\'eration de restauration, si l'Archive Device est un FIFO, Bacula 
312    tente de lire le FIFO, aussi vous devez avoir un programme externe qui \'ecrit dans 
313    le FIFO. Bacula attend que ce programme commence \`a \'ecrire pendant un d\'elai 
314    maximal de {\bf MaximumOpenWait} secondes apr\`es quoi il termine le job. Comme 
315    mentionn\'e ci-dessus, vous pouvez utiliser la directive {\bf RunBeforeJob} pour 
316    lancer ce programme auteur d\`es le d\'ebut du job.
317   
318    La directive Archive Device est requise. 
319
320 \item [Device Type = {\it Sp\'ecification-de-type}]
321    \index[sd]{Device Type}
322    \index[sd]{Directive!Device Type}
323    La sp\'ecification Device Type de d\'eclarer explicitement \`a Bacula quel type  
324    de p\'eriph\'erique vous d\'efinissez. La valeur de {\it Sp\'ecification-de-type} peut 
325    \^etre l'une des suivantes :
326    \begin{description}
327    \item [File]
328      Indique \`a Bacula que le p\'eriph\'erique est un fichier. Ce peut \^etre 
329      un fichier d\'efini sur un m\'edium fixe ou au contraire amovible (par exemple, un 
330      p\'eriph\'erique USB). Tous les fichiers doivent \^etre des p\'eriph\'eriques en acc\`es 
331      s\'electif (NDT : traduction Google sans doute \`a revoir de "random access")
332    \item[tape]
333      Indique \`a Bacula que le p\'eriph\'erique est un lecteur de bandes, donc \`a 
334      acc\`es s\'equentiel. Ces p\'eriph\'eriques sont control\'e par les appels 
335      ioctl().
336    \item[Fifo]
337       Indique \`a Bacula que le p\'eriph\'erique est un p\'eriph\'erique \`a acc\`es 
338       s\'equentiel "first-in-first-out" (premier entr\'e, premier sorti) en 
339       lecture seule ou en \'ecriture seule.
340    \item[DVD]
341       Indique \`a Bacula que le p\'eriph\'erique est un DVD. Les DVDs sont \`a acc\`es 
342       s\'equentiel en \'ecriture et \`a acc\`es s\'electif  (NDT : traduction Google sans 
343       doute \`a revoir de "random access") en lecture.
344    \end{description}
345    
346   La directive Device Type n'est pas requise, et si elle n'est pas sp\'ecifi\'ee, 
347   Bacula tentera de deviner cette information selon la sp\'ecification Archive 
348   Device fournie. Il existe plusieurs avantages \`a sp\'ecifier explicitement 
349   le type de p\'eriph\'erique. D'abord, sur certains syst\`emes, les p\'eriph\'eriques 
350   bloc et caract\`ere ont le m\^eme type, ce qui signifie que sur ces syst\`emes, 
351   Bacula est probablement incapable de deviner qu'un p\'eriph\'erique est un DVD. 
352   Ensuite, si vous sp\'ecifiez explicitement le type de p\'eriph\'erique, le point de 
353   montage n'a pas besoin d'\^etre d\'efini jusqu'\`a ce que le p\'eriph\'erique soit ouvert. 
354   C'est le cas de la plupart des p\'eriph\'eriques amovibles tels que les USB mont\'es 
355   par le daemon HAL. Au contraire, si le type de p\'eriph\'erique n'est pas 
356   sp\'ecifi\'e explicitement, le point de montage doit exister d\`es le 
357   d\'emarrage du Storage Daemon.
358
359   Cette directive est apparue avec la version 1.38.6 de Bacula.
360   
361 \item [Media Type = {\it name-string}]
362    \index[sd]{Media Type}
363    \index[sd]{Directive!Media Type}
364    La cha\^ine {\bf name-string} sp\'ecifi\'ee baptise le type de m\'edia support\'e par 
365    ce p\'eriph\'erique, par exemple, "DLT7000". Les noms de type de m\'edia sont 
366    arbitraires, vous pouvez utiliser le nom de votre choix, mais ils doivent 
367    \^etre connus du catalogue pour qu'il puisse garder trace de quel daemon 
368    peut lire quel type de m\'edia. En g\'en\'eral, chaque type de stockage devrait 
369    avoir un type de m\'edia unique associ\'e. Le m\^eme nom {\bf name-string} doit 
370    appara\^itre dans la d\'efinition de ressource Storage appropri\'ee du fichier 
371    de configuration du Director.
372    
373    M\^eme si les noms que vous assignez sont arbitraires, vous devriez les choisir 
374    avec circonspection, car le Media Type est utilis\'e pour d\'eterminer le 
375    p\'eriph\'erique de stockage \`a s\'electionner lors d'une restauration. Ainsi, vous 
376    devriez certainement utiliser le m\^eme Media Type pour tous les lecteurs 
377    dont les cartouches sont interchangeables. 
378   
379    Even though the names you assign are arbitrary (i.e.  you choose the name
380    you want), you should take care in specifying them because the Media Type
381    is used to determine which storage device Bacula will select during
382    restore.  Thus you should probably use the same Media Type specification
383    for all drives where the Media can be freely interchanged.  This is not
384    generally an issue if you have a single Storage daemon, but it is with
385    multiple Storage daemons, especially if they have incompatible media.
386    
387    For example, if you specify a Media Type of "DDS-4" then during the
388    restore, Bacula will be able to choose any Storage Daemon that handles
389    "DDS-4".  If you have an autochanger, you might want to name the Media Type
390    in a way that is unique to the autochanger, unless you wish to possibly use
391    the Volumes in other drives.  You should also ensure to have unique Media
392    Type names if the Media is not compatible between drives.  This
393    specification is required for all devices.
394
395    In addition, if you are using disk storage, each Device resource will
396    generally have a different mount point or directory. In order for
397    Bacula to select the correct Device resource, each one must have a
398    unique Media Type.
399
400 \label{Autochanger}
401 \item [Autochanger = {\it Yes|No}]
402    \index[sd]{Autochanger}
403    \index[sd]{Directive!Autochanger}
404    If {\bf Yes}, this device belongs to an automatic tape changer, and  you should also
405    specify a {\bf Changer Device} as well as  a {\bf Changer Command}.  If {\bf
406    No} (default), the volume must be manually changed.  You should also
407    have an identical directive to the  
408    \ilink{Storage resource}{Autochanger1}  in the Director's
409    configuration file so that  when labeling tapes you are prompted for the slot.
410
411 \item [Changer Device = {\it name-string}]
412    \index[sd]{Changer Device}
413    \index[sd]{Directive!Changer Device}
414    The specified {\bf name-string} must be the {\bf generic SCSI} device
415    name of the autochanger that corresponds to the normal read/write
416    {\bf Archive Device}  specified in the Device resource. This
417    gemeric SCSI device name should be specified if you have an autochanger 
418    or if you have a standard tape drive and want to use the
419    {\bf Alert Command} (see below). For example, on Linux systems, for 
420    an Archive Device name of {\bf /dev/nst0}, you would specify {\bf
421    /dev/sg0} for the Changer Device name. Depending on your exact
422    configuration, and the number of autochangers or the type of
423    autochanger, what you specify here can vary.  This directive is
424    optional.  See the \ilink{ Using Autochangers}{_ChapterStart18} chapter
425    of this manual for more details of using this and the following
426    autochanger directives.
427
428 \item [Changer Command = {\it name-string}]
429    \index[sd]{Changer Command}
430    \index[sd]{Directive!Changer Command}
431    The {\bf name-string} specifies an external program to be called  that will
432    automatically change volumes as required by {\bf Bacula}.  Most frequently,
433    you will specify the Bacula supplied {\bf mtx-changer}  script as follows:  
434
435 \footnotesize
436 \begin{verbatim}
437 Changer Command = "/path/mtx-changer %c %o %S %a %d"
438 \end{verbatim}
439 \normalsize
440
441    and you will install the {\bf mtx} on your system (found  in the {\bf depkgs}
442    release). An example of this command is in the default bacula-sd.conf file. 
443    For more details on the substitution characters that may be specified  to
444    configure your autochanger please see  the 
445    \ilink{Autochangers}{_ChapterStart18} chapter of this  manual.
446    For FreeBSD users, you might want to see one of the  several {\bf chio}
447    scripts in {\bf examples/autochangers}.  
448
449 \item [Alert Command = {\it name-string}]
450    \index[sd]{Alert Command}
451    The {\bf name-string} specifies an external program to be called  at the
452    \index[sd]{Directive!Changer Command}
453    completion of each Job after the device is released.  The purpose of this
454    command is to check for Tape Alerts, which  are present when something is
455    wrong with your tape drive  (at least for most modern tape drives).  The same
456    substitution characters that may be specified  in the Changer Command may also
457    be used in this string.  For more information, please see  the 
458    \ilink{Autochangers}{_ChapterStart18} chapter of this  manual. 
459    
460    
461    Note, it is not necessary to have an autochanger to use this  command. The
462    example below uses the {\bf tapeinfo} program  that comes with the {\bf mtx}
463    package, but it can be used  on any tape drive. However, you will need to
464    specify  a {\bf Changer Device} directive in your Device resource  (see above)
465    so that the generic SCSI device name can be  edited into the command (with the
466    \%c).  
467    
468    An example of the use of this command to print Tape Alerts  in the Job report
469    is:  
470
471 \footnotesize
472 \begin{verbatim}
473 Alert Command = "sh -c 'tapeinfo -f %c | grep TapeAlert'"
474       
475 \end{verbatim}
476 \normalsize
477
478 and an example output when there is a problem could be:  
479
480 \footnotesize
481 \begin{verbatim}
482 bacula-sd  Alert: TapeAlert[32]: Interface: Problem with SCSI interface
483                   between tape drive and initiator.
484       
485 \end{verbatim}
486 \normalsize
487
488 \item [Drive Index = {\it number}]
489    \index[sd]{Drive Index}
490    \index[sd]{Directive!Drive Index}
491    The {\bf Drive Index} that you specify is passed to the  {\bf mtx-changer}
492    script and is thus passed to the {\bf mtx}  program. By default, the Drive
493    Index is zero, so if you have only  one drive in your autochanger, everything
494    will work normally.  However, if you have multiple drives, you may specify two
495    Bacula  Device resources. The first will either set Drive Index to zero,  or
496    leave it unspecified, and the second Device Resource should  contain a Drive
497    Index set to 1. This will then permit you to  use two or more drives in your
498    autochanger. However, you must ensure  that Bacula does not request the same
499    Volume on both drives  at the same time. You may also need to modify the
500    mtx-changer  script to do locking so that two jobs don't attempt to use  the
501    autochanger at the same time. An example script can  be found in {\bf
502    examples/autochangers/locking-mtx-changer}.
503
504 \item [Autoselect = {\it Yes|No}]
505    \index[sd]{Autoselect}
506    \index[sd]{Directive!Autoselect}
507    If this directive is set to {\bf yes} (default), and the Device
508    belongs to an autochanger, then when the Autochanger is referenced
509    by the Director, this device can automatically be selected. If this
510    directive is set to {\bf no}, then the Device can only be referenced
511    by directly using the Device name in the Director. This is useful
512    for reserving a drive for something special such as a high priority
513    backup or restore operations.
514
515 \item [Maximum Changer Wait = {\it time}]
516    \index[sd]{Maximum Changer Wait}
517    \index[sd]{Directive!Maximum Changer Wait}
518    This directive specifies the maximum time in seconds for Bacula to wait
519    for an autochanger to change the volume.  If this time is exceeded,
520    Bacula will invalidate the Volume slot number stored in the catalog and
521    try again.  If no additional changer volumes exist, Bacula will ask the
522    operator to intervene.  The default is 5 minutes.      
523
524 \item [Maximum Rewind Wait = {\it time}]
525    \index[sd]{Maximum Rewind Wait}
526    \index[sd]{Directive!Maximum Rewind Wait}
527    This directive specifies the maximum time in seconds for Bacula to wait
528    for a rewind before timing out.  If this time is exceeded,
529    Bacula will cancel the job.  The default is 5 minutes.
530
531 \item [Maximum Open Wait = {\it time}]
532    \index[sd]{Maximum Open Wait}
533    \index[sd]{Directive!Maximum Open Wait}
534    This directive specifies the maximum time in seconds for Bacula to wait
535    for a open before timing out.  If this time is exceeded,
536    Bacula will cancel the job.  The default is 5 minutes.
537
538 \item [Always Open = {\it Yes|No}]
539    \index[sd]{Always Open}
540    \index[sd]{Directive!Always Open}
541    If {\bf Yes} (default), Bacula will always keep the device open unless
542    specifically {\bf unmounted} by the Console program.  This permits
543    Bacula to ensure that the tape drive is always available.  If you set
544    {\bf AlwaysOpen} to {\bf no} {\bf Bacula} will only open the drive when
545    necessary, and at the end of the Job if no other Jobs are using the
546    drive, it will be freed.  The next time Bacula wants to append to a tape
547    on a drive that was freed, Bacula must rewind the tape and position to
548    the end.  To avoid unnecessary tape positioning and to minimize
549    unnecessary operator intervention, it is highly recommended that {\bf
550    Always Open = yes}.  This also ensures that the drive is available when
551    Bacula needs it.
552    
553    If you have {\bf Always Open = yes} (recommended) and you want  to use the
554    drive for something else, simply use the {\bf unmount}  command in the Console
555    program to release the drive. However, don't  forget to remount the drive with
556    {\bf mount} when the drive is  available or the next Bacula job will block.  
557    
558    For File storage, this directive is ignored. For a FIFO storage  device, you
559    must set this to {\bf No}.  
560    
561    Please note that if you set this directive to {\bf No} Bacula  will release
562    the tape drive between each job, and thus the next job  will rewind the tape
563    and position it to the end of the data. This  can be a very time consuming
564    operation. 
565
566 \item [Volume Poll Interval = {\it time}]
567    \index[sd]{Volume Poll Interval}
568    \index[sd]{Directive!Volume Poll Interval}
569    If the time  specified on this directive is non-zero, after  asking the
570    operator to mount a new volume Bacula will  periodically poll (or read) the
571    drive at the specified  interval to see if a new volume has been mounted. If
572    the  time interval is zero (the default), no polling will occur.  This
573    directive can be useful if you want to avoid operator  intervention via the
574    console. Instead, the operator can  simply remove the old volume and insert
575    the requested one,  and Bacula on the next poll will recognize the new tape
576    and  continue. Please be aware that if you set this interval  too small, you
577    may excessively wear your tape drive if the  old tape remains in the drive,
578    since Bacula will read it on  each poll. This can be avoided by ejecting the
579    tape using  the {\bf Offline On Unmount} and the {\bf Close on Poll} 
580    directives. 
581    However, if you are using a Linux 2.6 kernel or other OSes
582    such as FreeBSD or Solaris, the Offline On Unmount will leave the drive
583    with no tape, and Bacula will not be able to properly open the drive and
584    may fail the job.  For more information on this problem, please see the
585    \ilink{description of Offline On Unmount}{NoTapeInDrive} in the Tape
586    Testing chapter.
587
588 \item [Close on Poll= {\it Yes|No}]
589    \index[sd]{Close on Poll}
590    \index[sd]{Directive!Close on Poll}
591    If {\bf Yes}, Bacula close the device (equivalent to  an unmount except no
592    mount is required) and reopen it at each  poll. Normally this is not too
593    useful unless you have the  {\bf Offline on Unmount} directive set, in which
594    case the  drive will be taken offline preventing wear on the tape  during any
595    future polling. Once the operator inserts a new  tape, Bacula will recognize
596    the drive on the next poll and  automatically continue with the backup. 
597    Please see above more more details.
598
599 \item [Maximum Open Wait = {\it time}]
600    \index[sd]{Maximum Open Wait}
601    \index[sd]{Directive!Maximum Open Wait}
602    This directive specifies the maximum amount of time in seconds that
603    Bacula will wait for a device that is busy.  The default is 5 minutes.
604    If the device cannot be obtained, the current Job will be terminated in
605    error.  Bacula will re-attempt to open the drive the next time a Job
606    starts that needs the the drive.
607
608 \item [Removable media = {\it Yes|No}]
609    \index[sd]{Removable media}
610    \index[sd]{Directive!Removable media}
611    If {\bf Yes}, this device supports removable media (for example, tapes
612    or CDs).  If {\bf No}, media cannot be removed (for example, an
613    intermediate backup area on a hard disk).
614
615 \item [Random access = {\it Yes|No}]
616    \index[sd]{Random access}
617    \index[sd]{Directive!Random access}
618    If {\bf Yes}, the archive device is assumed to be a random access medium
619    which supports the {\bf lseek} (or {\bf lseek64} if Largefile is enabled
620    during configuration) facility.
621
622 \item [Minimum block size = {\it size-in-bytes}]
623    \index[sd]{Minimum block size}
624    \index[sd]{Directive!Minimum block size}
625    On most modern tape drives, you will not need or wamt to specify this
626    directive, and if you do so, it will be to make Bacula use fixed block
627    sizes.  This statement applies only to non-random access devices (e.g.
628    tape drives).  Blocks written by the storage daemon to a non-random
629    archive device will never be smaller than the given {\bf size-in-bytes}.
630    The Storage daemon will attempt to efficiently fill blocks with data
631    received from active sessions but will, if necessary, add padding to a
632    block to achieve the required minimum size.
633    
634    To force the block size to be fixed, as is the case for some non-random
635    access devices (tape drives), set the {\bf Minimum block size} and the
636    {\bf Maximum block size} to the same value (zero included).  The default
637    is that both the minimum and maximum block size are zero and the default
638    block size is 64,512 bytes.  If you wish the block size to be fixed and
639    different from the default, specify the same value for both {\bf Minimum
640    block size} and {\bf Maximum block size}.
641    
642    For  example, suppose you want a fixed block size of 100K bytes, then you 
643    would specify:  
644
645 \footnotesize
646 \begin{verbatim}
647  
648     Minimum block size = 100K
649     Maximum block size = 100K
650     
651 \end{verbatim}
652 \normalsize
653
654    Please note that if you specify a fixed block size as shown above,  the tape
655    drive must either be in variable block size mode, or  if it is in fixed block
656    size mode, the block size (generally  defined by {\bf mt}) {\bf must} be
657    identical to the size specified  in Bacula -- otherwise when you attempt to
658    re-read your Volumes,  you will get an error.  
659    
660    If you want the  block size to be variable but with a 64K minimum and 200K
661    maximum (and  default as well), you would specify:  
662
663 \footnotesize
664 \begin{verbatim}
665  
666     Minimum block size = 64K
667     Maximum blocksize = 200K
668    
669 \end{verbatim}
670 \normalsize
671
672 \item [Maximum block size = {\it size-in-bytes}]
673    \index[sd]{Maximum block size}
674    \index[sd]{Directive!Maximum block size}
675    On most modern tape drives, you will not need to specify this directive.
676    If you do so, it will most likely be to use fixed block sizes (see
677    Minimum block size above).  The Storage daemon will aways attempt to
678    write blocks of the specified {\bf size-in-bytes} to the archive device.
679    As a consequence, this statement specifies both the default block size
680    and the maximum block size.  The size written never exceed the given
681    {\bf size-in-bytes}.  If adding data to a block would cause it to exceed
682    the given maximum size, the block will be written to the archive device,
683    and the new data will begin a new block.
684    
685    If no value is specified or zero is specified, the Storage daemon will
686    use a default block size of 64,512 bytes (126 * 512).
687
688 \item [Hardware End of Medium = {\it Yes|No}]
689    \index[sd]{Hardware End of Medium}
690    \index[sd]{Directive!Hardware End of Medium}
691    If {\bf No}, the archive device is not required to support end  of medium
692    ioctl request, and the storage daemon will use the forward  space file
693    function to find the end of the recorded data. If  {\bf Yes}, the archive
694    device must support the {\tt ioctl}  {\tt MTEOM} call, which will position the
695    tape to the end of the  recorded data. In addition, your SCSI driver must keep
696    track  of the file number on the tape and report it back correctly by  the
697    {\bf MTIOCGET} ioctl. Note, some SCSI drivers will correctly  forward space to
698    the end of the recorded data, but they do not  keep track of the file number.
699    On Linux machines, the SCSI driver  has a {\bf fast-eod} option, which if set
700    will cause the driver  to lose track of the file number. You should ensure
701    that this  option is always turned off using the {\bf mt} program.  
702    
703    Default setting for Hardware End of Medium is {\bf Yes}. This  function is
704    used before appending to a tape to ensure that no  previously written data is
705    lost. We recommend if you have a non-standard or unusual tape drive that you
706    use the {\bf btape} program  to test your drive to see whether or not it
707    supports this function.  All modern (after 1998) tape drives support this
708    feature.  
709    
710 \item [Fast Forward Space File = {\it Yes|No}]
711    \index[sd]{Fast Forward Space File}
712    \index[sd]{Directive!Fast Forward Space File}
713    If {\bf No}, the archive device is not required to support  keeping track of
714    the file number ({\bf MTIOCGET} ioctl) during  forward space file. If {\bf
715    Yes}, the archive device must support  the {\tt ioctl} {\tt MTFSF} call, which
716    virtually all drivers  support, but in addition, your SCSI driver must keep
717    track of the  file number on the tape and report it back correctly by the 
718    {\bf MTIOCGET} ioctl. Note, some SCSI drivers will correctly  forward space,
719    but they do not keep track of the file number or more  seriously, they do not
720    report end of meduim.  
721    
722    Default setting for Fast Forward Space File is {\bf Yes}.
723    
724 \item [Use MTIOCGET = {\it Yes|No}]
725    \index[sd]{Fast Forward Space File}
726    \index[sd]{Directive!Fast Forward Space File}
727    If {\bf No}, the operating system is not required to support keeping track of
728    the file number and reporting it in the ({\bf MTIOCGET} ioctl). The default
729    is {\bf Yes}. If you must set this to No, Bacula will do the proper file
730    position determination, but it is very unfortunate because it means that 
731    tape movement is very inefficient.
732    Fortunately, this operation system deficiency seems to be the case only
733    on a few *BSD systems.  Operating systems known to work correctly are
734    Solaris, Linux and FreeBSD.
735
736 \item [BSF at EOM = {\it Yes|No}]
737    \index[sd]{BSF at EOM}
738    \index[sd]{Directive!BSF at EOM}
739    If {\bf No}, the default, no special action is taken by  Bacula with the End
740    of Medium (end of tape) is reached because  the tape will be positioned after
741    the last EOF tape mark, and  Bacula can append to the tape as desired.
742    However, on some  systems, such as FreeBSD, when Bacula reads the End of
743    Medium  (end of tape), the tape will be positioned after the second  EOF tape
744    mark (two successive EOF marks indicated End of  Medium). If Bacula appends
745    from that point, all the appended  data will be lost. The solution for such
746    systems is to  specify {\bf BSF at EOM} which causes Bacula to backspace  over
747    the second EOF mark. Determination of whether or not  you need this directive
748    is done using the {\bf test} command  in the {\bf btape} program.
749
750 \item [TWO EOF = {\it Yes|No}]
751    \index[sd]{TWO EOF}
752    \index[sd]{Directive!TWO EOF}
753    If {\bf Yes}, Bacula will write two end of file marks when  terminating a tape
754 -- i.e. after the last job or at the end of  the medium. If {\bf No}, the
755 default, Bacula will only write  one end of file to terminate the tape. 
756
757 \item [Backward Space Record = {\it Yes|No}]
758    \index[sd]{Backward Space Record}
759    \index[sd]{Directive!Backward Space Record}
760    If {\it Yes}, the archive device supports the {\tt MTBSR  ioctl} to backspace
761    records. If {\it No}, this call is not  used and the device must be rewound
762    and advanced forward to the  desired position. Default is {\bf Yes} for non
763    random-access  devices. This function if enabled is used at the end of a 
764    Volume after writing the end of file and any ANSI/IBM labels to determine whether
765    or not the last block was written correctly. If you turn this function off,
766    the test will not be done. This causes no harm as the re-read process is
767    precautionary rather than required.
768
769 \item [Backward Space File = {\it Yes|No}]
770    \index[sd]{Backward Space File}
771    \index[sd]{Directive!Backward Space File}
772    If {\it Yes}, the archive device supports the {\bf MTBSF} and  {\bf MTBSF
773   ioctl}s to backspace over an end of file mark and to the  start of a file. If
774   {\it No}, these calls are not used and the  device must be rewound and
775   advanced forward to the desired position.  Default is {\bf Yes} for non
776   random-access devices. 
777
778 \item [Forward Space Record = {\it Yes|No}]
779    \index[sd]{Forward Space Record}
780    \index[sd]{Directive!Forward Space Record}
781    If {\it Yes}, the archive device must support the {\bf MTFSR  ioctl} to
782    forward space over records. If {\bf No}, data must  be read in order to
783    advance the position on the device. Default is  {\bf Yes} for non
784    random-access devices. 
785
786 \item [Forward Space File = {\it Yes|No}]
787    \index[sd]{Forward Space File}
788    \index[sd]{Directive!Forward Space File}
789    If {\bf Yes}, the archive device must support the {\tt MTFSF  ioctl} to
790    forward space by file marks. If {\it No}, data  must be read to advance the
791    position on the device. Default is  {\bf Yes} for non random-access devices. 
792
793 \item [Offline On Unmount = {\it Yes|No}]
794    \index[sd]{Offline On Unmount}
795    \index[sd]{Directive!Offline On Unmount}
796    The default for this directive is {\bf No}. If {\bf Yes} the  archive device
797    must support the {\tt MTOFFL ioctl} to rewind and  take the volume offline. In
798    this case, Bacula will issue the  offline (eject) request before closing the
799    device during the {\bf unmount}  command. If {\bf No} Bacula will not attempt
800    to offline the  device before unmounting it. After an offline is issued,  the
801    cassette will be ejected thus {\bf requiring operator intervention}  to
802    continue, and on some systems require an explicit load command  to be issued
803    ({\bf mt -f /dev/xxx load}) before the system will recognize  the tape. If you
804    are using an autochanger, some devices  require an offline to be issued prior
805    to changing the volume. However,  most devices do not and may get very
806    confused.  
807
808    If you are using a Linux 2.6 kernel or other OSes
809    such as FreeBSD or Solaris, the Offline On Unmount will leave the drive
810    with no tape, and Bacula will not be able to properly open the drive and
811    may fail the job.  For more information on this problem, please see the
812    \ilink{description of Offline On Unmount}{NoTapeInDrive} in the Tape
813    Testing chapter.
814
815
816 \item [Maximum Volume Size = {\it size}]
817    \index[sd]{Maximum Volume Size}
818    \index[sd]{Directive!Maximum Volume Size}
819    No more than {\bf size} bytes will be written onto a given volume on the
820    archive device.  This directive is used mainly in testing Bacula to
821    simulate a small Volume.  It can also be useful if you wish to limit the
822    size of a File Volume to say less than 2GB of data.  In some rare cases
823    of really antiquated tape drives that do not properly indicate when the
824    end of a tape is reached during writing (though I have read about such
825    drives, I have never personally encountered one).  Please note, this
826    directive is deprecated (being phased out) in favor of the {\bf Maximum
827    Volume Bytes} defined in the Director's configuration file.
828
829 \item [Maximum File Size = {\it size}]
830    \index[sd]{Maximum File Size}
831    \index[sd]{Directive!Maximum File Size}
832    No more than {\bf size} bytes will be written into a given logical file
833    on the volume.  Once this size is reached, an end of file mark is
834    written on the volume and subsequent data are written into the next
835    file.  Breaking long sequences of data blocks with file marks permits
836    quicker positioning to the start of a given stream of data and can
837    improve recovery from read errors on the volume.  The default is one
838    Gigabyte.
839
840 \item [Block Positioning = {\it yes|no}]
841    \index[sd]{Block Positioning}
842    \index[sd]{Directive!Block Positioning}
843    This directive is not normally used (and has not yet been  tested). It will
844    tell Bacula not to use block positioning when  it is reading tapes. This can
845    cause Bacula to be {\bf extremely}  slow when restoring files. You might use
846    this directive if you  wrote your tapes with Bacula in variable block mode
847    (the default),  but your drive was in fixed block mode. If it then works as  I
848    hope, Bacula will be able to re-read your tapes. 
849
850 \item [Maximum Network Buffer Size = {\it bytes}]
851    \index[sd]{Maximum Network Buffer Size}
852    \index[sd]{Directive!Maximum Network Buffer Size}
853    where {\it bytes} specifies the initial network buffer  size to use with the
854    File daemon.  This size will be adjusted down if it is too large until
855    it is accepted by the OS. Please use care in setting this value since if
856    it is too large, it will be trimmed by 512 bytes until the OS is happy,
857    which may require a large number of system calls.  The default value is
858    32,768 bytes.
859
860    The default size was chosen to be relatively large but not too big in
861    the case that you are transmitting data over Internet.  It is clear that
862    on a high speed local network, you can increase this number and improve
863    performance. For example, some users have found that if you use a value
864    of 65,536 bytes they get 5-10 times the throughput.  Larger values for
865    most users don't seem to improve performance. If you are interested
866    in improving your backup speeds, this is definitely a place to
867    experiment. You will probably also want to make the corresponding change
868    in each of your File daemons conf files.
869
870
871 \item [Maximum Spool Size = {\it bytes}]
872    \index[sd]{Maximum Spool Size}
873    \index[sd]{Directive!Maximum Spool Size}
874    where the bytes specify the maximum spool size for all jobs  that are running.
875    The default is no limit. 
876
877 \item [Maximum Job Spool Size = {\it bytes}]
878    \index[sd]{Maximum Job Spool Size}
879    \index[sd]{Directive!Maximum Job Spool Size}
880    where the bytes specify the maximum spool size for any one job  that is
881    running. The default is no limit. 
882    This directive is implemented only in version 1.37 and later.
883
884 \item [Spool Directory = {\it directory}]
885    \index[sd]{Spool Directory}
886    \index[sd]{Directive!Spool Directory}
887    specifies the name of the directory to be used to store  the spool files for
888    this device. This directory is also used to store  temporary part files when
889    writing to a device that requires mount (DVD).  The default is to use the
890    working directory. 
891
892 \item [Maximum Part Size = {\it bytes}]
893    \index[sd]{Maximum Part Size}
894    \index[sd]{Directive!Maximum Part Size}
895    This is the maximum size of a volume part file. The default is no limit.
896    This directive is implemented only in version 1.37 and later.
897
898    If the device requires  mount, it is transfered to the device when this size
899    is reached.  In this case, you must take care to have enough disk space left
900    in  the spool directory.  
901
902    Otherwise, it is left on the hard disk.  
903
904    It is ignored for tape and FIFO devices.  
905
906
907 \end{description}
908
909 \subsection*{Devices that require a mount (DVD)}
910 \index[general]{Devices that require a mount (DVD)}
911 \index[general]{DVD!Devices that require a mount}
912 \addcontentsline{toc}{subsection}{Devices that require a mount (DVD)}
913
914 All the directives in this section are implemented only in
915 Bacula version 1.37 and later and hence are available in version 1.38.6.
916
917 As of version 1.39.5, the directives
918 "Requires Mount", "Mount Point", "Mount Command", and "Unmount Command"
919 apply to removable filesystems such as USB in addition to DVD.
920
921 \begin{description}
922
923 \item [Requires Mount = {\it Yes|No}]
924    \index[sd]{Requires Mount}
925    \index[sd]{Directive!Requires Mount}
926    You must set this directive to {\bf yes} for DVD-writers,  and to {\bf no} for
927    all other devices (tapes/files).  This directive indicates if the device
928    requires to be mounted to be read,  and if it must be written in a special way.
929    If it set, {\bf Mount Point},  {\bf Mount Command}, {\bf Unmount Command} and
930    {\bf Write Part Command}  directives must also be defined. 
931
932 \item [Mount Point = {\it directory}]
933    \index[sd]{Mount Point}
934    \index[sd]{Directive!Mount Point}
935    Directory where the device can be mounted. 
936
937 \item [Mount Command = {\it name-string}]
938    \index[sd]{Mount Command}
939    \index[sd]{Directive!Mount Command}
940    Command that must be executed to mount the device. Before the command is 
941    executed, \%a is replaced with the Archive Device, and \%m with the Mount 
942    Point.
943
944    Most frequently, you will define it as follows:  
945
946 \footnotesize
947 \begin{verbatim}
948   Mount Command = "/bin/mount -t iso9660 -o ro %a %m"
949 \end{verbatim}
950 \normalsize
951
952 \item [Unmount Command = {\it name-string}]
953    \index[sd]{Unmount Command}
954    \index[sd]{Directive!Unmount Command}
955    Command that must be executed to unmount the device. Before the command  is
956    executed, \%a is replaced with the Archive Device, and \%m with the  Mount
957    Point.
958
959    Most frequently, you will define it as follows:  
960
961 \footnotesize
962 \begin{verbatim}
963   Unmount Command = "/bin/umount %m"
964 \end{verbatim}
965 \normalsize
966
967 \item [Write Part Command = {\it name-string}]
968    \index[sd]{Write Part Command}
969    \index[sd]{Directive!Write Part Command}
970    Command that must be executed to write a part to the device. Before the 
971    command is executed, \%a is replaced with the Archive Device, \%m with the 
972    Mount Point, \%e is replaced with 1 if we are writing the first part,
973    and with 0 otherwise, and \%v with the current part filename.
974
975    For a DVD, you will most frequently specify the Bacula supplied  {\bf
976    dvd-writepart} script as follows:  
977
978 \footnotesize
979 \begin{verbatim}
980   Write Part Command = "/path/dvd-writepart %e %a %v"
981 \end{verbatim}
982 \normalsize
983
984   Where {\bf /path} is the path to your scripts install directory, and
985   dvd-writepart is the Bacula supplied script file.  
986   This command will already be present, but commented out,
987   in the default bacula-sd.conf file. To use it, simply remove
988   the comment (\#) symbol.
989
990
991 \item [Free Space Command = {\it name-string}]
992    \index[sd]{Free Space Command}
993    \index[sd]{Directive!Free Space Command}
994    Command that must be executed to check how much free space is left on the 
995    device. Before the command is executed,\%a is replaced with the Archive
996    Device, \%m with the Mount Point, \%e is replaced with 1 if we are writing
997    the first part, and with 0 otherwise, and \%v with the current part filename.
998
999    For a DVD, you will most frequently specify the Bacula supplied  {\bf
1000    dvd-freespace} script as follows:  
1001
1002 \footnotesize
1003 \begin{verbatim}
1004   Free Space Command = "/path/dvd-freespace %a"
1005 \end{verbatim}
1006 \normalsize
1007
1008   Where {\bf /path} is the path to your scripts install directory, and
1009   dvd-freespace is the Bacula supplied script file.
1010   If you want to specify your own command, please look at the code of
1011   dvd-freespace to see what output Bacula expects from this command.
1012   This command will already be present, but commented out,
1013   in the default bacula-sd.conf file. To use it, simply remove
1014   the comment (\#) symbol.
1015
1016   If you do not set it, Bacula will expect there is always free space on the
1017   device. 
1018
1019 \end{description}
1020
1021 \label{AutochangerRes}
1022 \label{AutochangerResource1}
1023 \input{autochangerres}
1024
1025 \subsection*{Capabilities}
1026 \index[general]{Capabilities}
1027 \addcontentsline{toc}{subsection}{Capabilities}
1028
1029 \begin{description}
1030
1031 \item [Label media = {\it Yes|No}]
1032    \index[sd]{Label media}
1033    \index[sd]{Directive!Label media}
1034    If {\bf Yes}, permits this device to automatically label blank media
1035    without an explicit operator command.  It does so by using an internal
1036    algorithm as defined on the \ilink{Label Format}{Label} record in each
1037    Pool resource.  If this is {\bf No} as by default, Bacula will label
1038    tapes only by specific operator command ({\bf label} in the Console) or
1039    when the tape has been recycled.  The automatic labeling feature is most
1040    useful when writing to disk rather than tape volumes.
1041
1042 \item [Automatic mount = {\it Yes|No}]
1043    \index[sd]{Automatic mount}
1044    \index[sd]{Directive!Automatic mount}
1045    If {\bf Yes} (the default), permits the daemon to examine the device to
1046    determine if it contains a Bacula labeled volume.  This is done
1047    initially when the daemon is started, and then at the beginning of each
1048    job.  If the This directive is particularly important if you have set
1049    {\bf Always Open = no} because it permits Bacula to attempt to read the
1050    device before asking the system operator to mount a tape.  However,
1051    please note that the tape must be mounted before the job begins.
1052
1053 \end{description}
1054
1055 \subsection*{Messages Resource}
1056 \label{MessagesResource1}
1057 \index[general]{Resource!Messages}
1058 \index[general]{Messages Resource}
1059 \addcontentsline{toc}{subsection}{Messages Resource}
1060
1061 For a description of the Messages Resource, please see the 
1062 \ilink{Messages Resource}{_ChapterStart15} Chapter of this
1063 manual. 
1064
1065 \subsection*{Sample Storage Daemon Configuration File}
1066 \label{SampleConfiguration}
1067 \index[general]{File!Sample Storage Daemon Configuration}
1068 \index[general]{Sample Storage Daemon Configuration File}
1069 \addcontentsline{toc}{subsection}{Sample Storage Daemon Configuration File}
1070
1071 A example Storage Daemon configuration file might be the following: 
1072
1073 \footnotesize
1074 \begin{verbatim}
1075 #
1076 # Default Bacula Storage Daemon Configuration file
1077 #
1078 #  For Bacula release 1.37.2 (07 July 2005) -- gentoo 1.4.16
1079 #
1080 # You may need to change the name of your tape drive
1081 #   on the "Archive Device" directive in the Device
1082 #   resource.  If you change the Name and/or the
1083 #   "Media Type" in the Device resource, please ensure
1084 #   that bacula-dir.conf has corresponding changes.
1085 #
1086 Storage {                               # definition of myself
1087   Name = rufus-sd
1088   Address = rufus
1089   WorkingDirectory = "$HOME/bacula/bin/working"
1090   Pid Directory = "$HOME/bacula/bin/working"
1091   Maximum Concurrent Jobs = 20
1092 }
1093 #
1094 # List Directors who are permitted to contact Storage daemon
1095 #
1096 Director {
1097   Name = rufus-dir
1098   Password = "ZF9Ctf5PQoWCPkmR3s4atCB0usUPg+vWWyIo2VS5ti6k"
1099 }
1100 #
1101 # Restricted Director, used by tray-monitor to get the
1102 #   status of the storage daemon
1103 #
1104 Director {
1105   Name = rufus-mon
1106   Password = "9usxgc307dMbe7jbD16v0PXlhD64UVasIDD0DH2WAujcDsc6"
1107   Monitor = yes
1108 }
1109 #
1110 # Devices supported by this Storage daemon
1111 # To connect, the Director's bacula-dir.conf must have the
1112 #  same Name and MediaType.
1113 #
1114 Autochanger {
1115   Name = Autochanger
1116   Device = Drive-1
1117   Device = Drive-2
1118   Changer Command = "/home/kern/bacula/bin/mtx-changer %c %o %S %a %d"
1119   Changer Device = /dev/sg0
1120 }
1121
1122 Device {
1123   Name = Drive-1                      #
1124   Drive Index = 0 
1125   Media Type = DLT-8000
1126   Archive Device = /dev/nst0
1127   AutomaticMount = yes;               # when device opened, read it
1128   AlwaysOpen = yes;
1129   RemovableMedia = yes;
1130   RandomAccess = no;
1131   AutoChanger = yes
1132   Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
1133 }
1134
1135 Device {
1136   Name = Drive-2                      #
1137   Drive Index = 1
1138   Media Type = DLT-8000
1139   Archive Device = /dev/nst1
1140   AutomaticMount = yes;               # when device opened, read it
1141   AlwaysOpen = yes;
1142   RemovableMedia = yes;
1143   RandomAccess = no;
1144   AutoChanger = yes
1145   Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
1146 }
1147
1148 Device {
1149   Name = "HP DLT 80"
1150   Media Type = DLT8000
1151   Archive Device = /dev/nst0
1152   AutomaticMount = yes;                 # when device opened, read it
1153   AlwaysOpen = yes;
1154   RemovableMedia = yes;
1155 }
1156 #Device {
1157 #  Name = SDT-7000                     #
1158 #  Media Type = DDS-2
1159 #  Archive Device = /dev/nst0
1160 #  AutomaticMount = yes;               # when device opened, read it
1161 #  AlwaysOpen = yes;
1162 #  RemovableMedia = yes;
1163 #}
1164 #Device {
1165 #  Name = Floppy
1166 #  Media Type = Floppy
1167 #  Archive Device = /mnt/floppy
1168 #  RemovableMedia = yes;
1169 #  Random Access = Yes;
1170 #  AutomaticMount = yes;               # when device opened, read it
1171 #  AlwaysOpen = no;
1172 #}
1173 #Device {
1174 #  Name = FileStorage
1175 #  Media Type = File
1176 #  Archive Device = /tmp
1177 #  LabelMedia = yes;                   # lets Bacula label unlabeled media
1178 #  Random Access = Yes;
1179 #  AutomaticMount = yes;               # when device opened, read it
1180 #  RemovableMedia = no;
1181 #  AlwaysOpen = no;
1182 #}
1183 #Device {
1184 #  Name = "NEC ND-1300A"
1185 #  Media Type = DVD
1186 #  Archive Device = /dev/hda
1187 #  LabelMedia = yes;                   # lets Bacula label unlabeled media
1188 #  Random Access = Yes;
1189 #  AutomaticMount = yes;               # when device opened, read it
1190 #  RemovableMedia = yes;
1191 #  AlwaysOpen = no;
1192 #  MaximumPartSize = 800M;
1193 #  RequiresMount = yes;
1194 #  MountPoint = /mnt/cdrom;
1195 #  MountCommand = "/bin/mount -t iso9660 -o ro %a %m";
1196 #  UnmountCommand = "/bin/umount %m";
1197 #  SpoolDirectory = /tmp/backup;
1198 #  WritePartCommand = "/etc/bacula/dvd-writepart %e %a %v"
1199 #  FreeSpaceCommand = "/etc/bacula/dvd-freespace %a"
1200 #}
1201 #
1202 # A very old Exabyte with no end of media detection
1203 #
1204 #Device {
1205 #  Name = "Exabyte 8mm"
1206 #  Media Type = "8mm"
1207 #  Archive Device = /dev/nst0
1208 #  Hardware end of medium = No;
1209 #  AutomaticMount = yes;               # when device opened, read it
1210 #  AlwaysOpen = Yes;
1211 #  RemovableMedia = yes;
1212 #}
1213 #
1214 # Send all messages to the Director,
1215 # mount messages also are sent to the email address
1216 #
1217 Messages {
1218   Name = Standard
1219   director = rufus-dir = all
1220   operator = root = mount
1221 }
1222 \end{verbatim}
1223 \normalsize