]> git.sur5r.net Git - bacula/docs/blob - docs/manual-fr/dirdconf.tex
4a7935f9563d683cc0d36d95a206ad1525cf663e
[bacula/docs] / docs / manual-fr / dirdconf.tex
1 %%
2 %%
3
4 \section*{Configurer le Director}
5 \label{_ChapterStart40}
6 \index[general]{Director!Configurer le }
7 \index[general]{Configurer le Director }
8 \addcontentsline{toc}{section}{Configurer le Director}
9
10 Parmi tous les fichiers de configuration requis pour ex\'ecuter {\bf Bacula},
11 celui du Director est le plus compliqu\'e, et c'est celui que vous modifierez
12 le plus souvent, en ajoutant des clients ou en modifiant les FileSets. 
13
14 Pour une discussion g\'en\'erale concernant les fichiers et ressources ainsi
15 que les types de donn\'ees reconnus par {\bf Bacula}, veuillez consulter le
16 chapitre 
17 \ilink{Configuration}{_ChapterStart16} de ce manuel. 
18
19 \subsection*{Les types de ressources du Director}
20 \index[general]{Les types de ressources du Director }
21 \index[general]{Director!Les types de ressources du }
22 \addcontentsline{toc}{subsection}{Les types de ressources du Director}
23
24 Les types de ressources du Director sont : 
25
26 Job, JobDefs, Client, Storage, Catalog, Schedule, FileSet, Pool, Director, et
27 Messages. Nous les pr\'esentons ici dans l'ordre le plus logique (relativement
28 au fichier de configuration du Director) : 
29
30 \begin{itemize}
31 \item 
32    \ilink{Director}{DirectorResource4} -- Pour d\'efinir le nom du
33    Director et son  mot de passe pour l'authentification du programme Console. Il
34 ne doit y avoir qu'une seule  d\'efinition de ressource Director dans le
35 fichier de configuration.  Si vouc avez soit {\bf /dev/random} soit {\bf bc}
36 sur votre machine, Bacula g\'en\`erera  un mot de passe al\'eatoire lors du
37 processus de configuration, sinon, il sera laiss\'e blanc. 
38 \item 
39    \ilink{Job}{JobResource} -- Pour d\'efinir les Jobs de types
40    sauvegarde et restauration,  et pour lier les ressources Client, FileSet et
41 Sc hedules \`a utiliser conjointement pour chaque Job. 
42 \item 
43    \ilink{JobDefs}{JobDefsResource} -- Ressource optionnelle pour
44    fournir des valeurs par d\'efaut  pour les ressources Job. 
45 \item 
46    \ilink{Schedule}{ScheduleResource} -- Pour d\'efinir le moment
47    o\`u un Job doit \^etre lanc\'e  automatiquement par le {\it scheduler}
48 interne de Bacula. 
49 \item 
50    \ilink{FileSet}{FileSetResource} -- Pour d\'efinir l'ensemble des
51    fichiers \`a sauvegarder  pour chaque client. 
52 \item 
53    \ilink{Client}{ClientResource2} -- Pour d\'efinir quel Client est
54    \`a sauvegarder. 
55 \item 
56    \ilink{Storage}{StorageResource2} -- Pour d\'efinir sur quel
57    p\'eriph\'erique physique les  volumes seront mont\'es.  
58 \item 
59    \ilink{Pool}{PoolResource} -- Pour d\'efinir quel pool de volumes
60    peut \^etre  utilis\'e pour un Job donn\'e 
61 \item 
62    \ilink{Catalog}{CatalogResource} -- Pour d\'efinir la base de
63    donn\'ees o\`u conserver les listes  des fichiers sauvegard\'es et des volumes
64 o\`u ils ont \'et\'e sauvegard\'es.  
65 \item 
66    \ilink{Messages}{_ChapterStart15} -- Pour d\'efinir les
67    destinataires (ou les fichiers de logs) des messages d'erreur et 
68 d'information.  
69 \end{itemize}
70  
71 \section*{La ressource Director}
72 \label{DirectorResource4}
73 \index[general]{Director!La ressource }
74 \index[general]{La ressource Director }
75 \addcontentsline{toc}{section}{La ressource Director}
76
77 La ressource Director d\'efinit les attributs du Director ex\'ecut\'e sur le
78 r\'eseau. Dans l'impl\'ementation actuelle, il n'y a qu'une ressource
79 Director, mais la r\'ealisation finale contiendra plusieurs Directors pour
80 maintenir la redondance de la base des indexes et m\'edia. 
81
82 \begin{description}
83
84 \item [Director]
85    \index[dir]{Director }
86    D\'ebut de la ressource Director. Une ressource Director et une seule doit
87 \^etre d\'efinie. 
88  
89 \ item [Name = \lt{}nom\gt{}]
90    \index[dir]{Name  }
91    Le nom du Director utilis\'e par l'administrateur syst\`eme. Cette directive
92 est requise  
93   
94 \item [Description = \lt{ }texte\gt{}]
95    \index[dir]{Description  }
96    Le champ texte contient une description du Director qui sera affich\'ee  dans
97 l'interface graphique. Cette directive est optionnelle.  
98  
99 \ item [Password = \lt{}UA-password\gt{}]
100    \index[dir]{Password  }
101    Sp\'ecifie le mot de passe qui doit \^etre fourni par la Console Bacula par
102 d\'efaut  pour \^etre autoris\'ee. Le m\^eme mot de passe doit appara{\^\i}tre
103 dans la ressource {\bf Director} du fichier de  configuration de la console.
104 Pour plus de s\'ecurit\'e, le mot de passe ne transite jamais sur le r\'eseau,
105 l'authentification se fait via un \'echange de type {\it challenge-response}
106 d'un {\it hash code} cr\'e\'e avec le mot  de passe. Cette directive est
107 requise. Si vous disposez de {\bf /dev/random} ou {\bf bc} sur votre machine,
108 Bacula  g\'en\`erera un mot de passe al\'eatoire lors du processus
109 d'installation, sinon il sera laiss\'e blanc et vous devrez en d\'efinir  un
110 manuellement.  
111  
112 \ item [Messages = \lt{}Nom-de-ressource-Messages\gt{}]
113    \index[console]{Messages  }
114    La ressource {\bf messages} sp\'ecifie o\`u doivent \^etre d\'elivr\'es les messages du Director 
115  qui ne sont pas associ\'es \`a un job sp\'ecifique. La plupart des messages sont relatifs
116  \`a un job et seront dirig\'es vers la ressource {\bf messages} sp\'ecifi\'ee par le job. 
117  Cependant, il quelques messages peuvent \^etre g\'en\'er\'es lorsque aucun job n'est actif. 
118  Cette directive est requise.
119
120 \item [Working Directory = \lt{}R\'epertoire\gt{}]
121    \index[console]{Working Directory  }
122 Cette directive sp\'ecifie un r\'epertoire o\`u le Director peut d\'eposer ses fichiers 
123 d'\'etats. Ce r\'epertoire ne devrait \^etre utilis\'e que par Bacula, mais il peut \^etre 
124 partag\'e par d'autres {\it daemons} Bacula. Les substitutions shell standard sont 
125 effectu\'ees \`a la lecture du fichier de configuration, de sorte que des valeurs 
126 telles que {\bf \$HOME} seront correctement substitu\'ees. Cette directive est 
127 requise.
128  
129 \item [Pid Directory = \lt{}R\'epertoire\gt{}]
130    \index[fd]{Pid Directory  }
131     Cette directive sp\'ecifie un r\'epertoire o\`u le Director peut d\'eposer son fichier
132 d'Id de processus. Ce fichier est utilis\'e pour stopper Bacula et pr\'evenir l'ex\'ecution 
133 simultan\'ee de plusieurs copies de Bacula. Les substitutions shell standard sont
134 effectu\'ees \`a la lecture du fichier de configuration, de sorte que des valeurs
135 telles que {\bf \$HOME} seront correctement substitu\'ees.
136
137 Typiquement, sur les syst\`emes Linux, vous utiliserez ici {\bf /var/run}. Si vous 
138 n'installez pas Bacula dans les r\'epertoires syst\`eme, vous pouvez utiliser le 
139 r\'epertoire de travail {\bf Working Directory} d\'efini plus haut.
140 Cette directive est requise.
141  
142 \item [QueryFile = \lt{}Chemin\gt{}]
143    \index[dir]{QueryFile  }
144     Cette directive sp\'ecifie un r\'epertoire et un fichier dans lequel le 
145 Director peut trouver les requ\^etes SQL pr\'e\'etablies pour la commande 
146 {\bf Query} de la Console. Les substitutions shell standard sont
147 effectu\'ees \`a la lecture du fichier de configuration, de sorte que des valeurs
148 telles que {\bf \$HOME} seront correctement substitu\'ees. 
149 Cette directive est requise.
150
151 \label{DirMaxConJobs}
152
153 \item [Maximum Concurrent Jobs = \lt{}nombre\gt{}]
154    \index[fd]{Maximum Concurrent Jobs  }
155    O\`u \lt{}nombre\gt{} est le nombre maximal de jobs qui peuvent \^etre ex\'ecut\'es 
156 simultan\'ement par le Director. La valeur par d\'efaut est 1, mais vous pouvez utiliser 
157 une valeur plus grande.
158 Notez que le format des volumes devient beaucoup plus compliqu\'e avec plusieurs jobs 
159 ex\'ecut\'es simultan\'ement. De ce fait, les restaurations peuvent prendre beaucoup plus 
160 de temps si Bacula doit faire le tri parmi les blocs entrem\'el\'es de ces jobs. Ceci 
161 peut \^etre \'evit\'e en s'arrangeant pour que chacun des jobs ex\'ecut\'es simultan\'ement 
162 \'ecrive sur un volume distinct. Une autre possibilit\'e consiste \`a utiliser le 
163 {\it data spooling} : les donn\'ees seront d'abord ``spool\'ees'' sur disque 
164 simultan\'ement, ensuite les fichiers ``spool'' seront \'ecrits s\'equentiellement 
165 sur le volume.   
166
167 Dans certains cas, des directives telles que {\bf Maximum Volume Jobs} ne sont pas 
168 correctement synchronis\'ees avec le nombre de jobs simultan\'es, et des probl\`emes 
169 de synchronisation subtils peuvent survenir, aussi des tests minutieux sont recommand\'es.
170
171 Actuellement, il n'y a aucun param\`etre de configuration pour r\'egler ou limiter 
172 le nombre de connections par console. Un maximum de cinq connection simultan\'ees 
173 est autoris\'e.
174
175 Pour plus de d\'etails concernant l'ex\'ecution simultan\'ee de plusieurs jobs, consultez la 
176 partie \ilink{Ex\'ecution simultan\'ee de plusieurs jobs}{ConcurrentJobs} du chapitre Astuces de ce manuel.
177
178
179 \item [FD Connect Timeout = \lt{}dur'/ee\gt{}]
180    \index[console]{FD Connect Timeout  }
181    O\`u {\bf dur\'ee} est le d'/elai durant lequel le Director tente de contacter 
182 le File Daemon pour d'/emarrer un job. Une fois ce d'/elai '/ecoul'/e, le Director supprimera le job.
183 La valeur par d'/efaut est 30 minutes.
184    
185 \item [SD Connect Timeout = \lt{}dur'/ee\gt{}]
186    \index[console]{SD Connect Timeout  }
187    O\`u {\bf dur\'ee} est le d'/elai durant lequel le Director tente de contacter 
188 le Storage Daemon pour d'/emarrer un job. Une fois ce d'/elai '/ecoul'/e, le Director supprimera le job.
189 La valeur par d'/efaut est 30 minutes.
190
191 \item [DirAddresses = \lt{}Sp'/ecification-adresses-IP\gt{}]
192    \index[console]{DirAddresses  }
193    Sp'/eifie les ports et adresses sur lesquels le Director sera en attente de 
194 connections de Consoles Bacula. La meilleure explication est sans doute un exemple :
195
196 \footnotesize
197 \begin{verbatim}
198  DirAddresses  = { ip = {
199         addr = 1.2.3.4; port = 1205; }
200     ipv4 = {
201         addr = 1.2.3.4; port = http; }
202     ipv6 = {
203         addr = 1.2.3.4;
204         port = 1205;
205     }
206     ip = {
207         addr = 1.2.3.4
208         port = 1205
209     }
210     ip = {
211         addr = 1.2.3.4
212     }
213     ip = {
214         addr = 201:220:222::2
215     }
216     ip = {
217         addr = bluedot.thun.net
218     }
219  }
220 \end{verbatim}
221 \normalsize
222
223 o\`u ``ip'', ``ip4'', ``ip6'', ``addr'', et ``port'' sont les mots clef. Notez que 
224 les adresses peuvent /^etre sp'/ecifi'/ees sous forme de quadruplets point'/es, ou 
225 suivant la notation /`a doubles points IPv6, ou encore sous forme de nom symbolique 
226 (seulement pour la sp'/ecification ip). D'autre part, le port peut /^etre sp'/ecifi'/e 
227 par un nombre, ou par une valeur mn'/emonique du fichier /etc/services. Si un port 
228 n'est pas pr'/ecis'/e, celui par d'/efaut sera utilis'/e. Si une section ip est sp'/ecifi'/e, 
229 la r'/esolution peut /^etre fait soit par IPv4, soit par IPv6. Si ip4 est sp'/ecifi'/e, 
230 seules les r'/esolutions IPv4 seront permises. Il en va de m/^eme avec ip6.
231
232 \item [DIRport = \lt{}num'/ero-de-port\gt{}]
233    \index[console]{DIRport  }
234    Sp'/ecifie le port (un entier positif) sur lequel le Director est /`a l''/ecoute 
235 de connections de Consoles Bacula. Ce m/^eme num'/ero de port doit /^etre sp'/ecifi'/e 
236 dans la ressource Director du fichier de configuration de la console. La 
237 valeur par d'/efaut est 9101, aussi, il n'est en principe pas n'/ecessaire 
238 de renseigner cette directive. Elle n'est pas requise si vous sp'/ecifiez des 
239 DirAdresses.
240
241 \item [DirAddress = \lt{}Adresse-IP\gt{}]
242    \index[console]{DirAddress  }
243    Cette directive est optionnelle. Lorsqu'elle est sp'/ecifi'/ee, le Director n'accepte 
244 de connections Console que de l'adresse sp'/ecifi'/ee {\bf Adresse-IP}, qui peut /^etre 
245 soit un nom de domaine, soit une adresse IP au format quadruplet point'/e ou cha/^ine quot'/ee.  
246 Si cette directive n'est pas sp'/ecifi'/ee, le Director acceptera des connections de Console 
247 de toute adresse valide. Notez que contrairement /`a la sp'/ecification DirAdresses d'/ecrite 
248 plus haut, cette directive ne permet de sp'/ecifier qu'une seule adresse. Cette directive 
249 n'est pas requise si vous utilisez la directive DirAdresses.
250
251 \end{description}
252
253 Voici un exemple d'une ressource Director valide :
254
255 \footnotesize
256 \begin{verbatim}
257 Director {
258   Name = HeadMan
259   WorkingDirectory = "$HOME/bacula/bin/working"
260   Password = UA_password
261   PidDirectory = "$HOME/bacula/bin/working"
262   QueryFile = "$HOME/bacula/bin/query.sql"
263   Messages = Standard
264 }
265 \end{verbatim}
266 \normalsize
267
268 \section*{La ressource Job}
269 \label{JobResource}
270 \index[general]{Resource!Job }
271 \index[general]{Job Resource }
272 \addcontentsline{toc}{section}{Job Resource}
273
274 La ressource Job d\'efinit un Job (sauvegarde, restauration,...) que Bacula doit 
275 ex\'ecuter. Chaque d\'efinition de ressource Job contient le nom d'un client, la 
276 liste des \'el\'ements \`a sauvegarder (FileSet), la planification (Schedule) pour 
277 ce Job, le lieu o\`u sauvegarder ces donn\'ees (Storage Device) et quel groupe de 
278 media utiliser (Pool). En effet, chaque ressource Job doit r\'epondre aux questions : 
279 "Quoi ?", "O\`u ?", "Quand ?" et "Comment ?" soit, respectivement Fileset, Storage, 
280 Schedule, Type et Niveau (Sauvegarde/Restauration - Full/Differentielle/Incr\'ementale).
281
282 Un seul type ({\bf Backup}, {\bf Restore}, ...) peut \^etre sp\'ecifi\'e pour un Job donn\'e. 
283 Si vous voulez sauvegarder plusieurs FileSets sur le m\^eme client, vous devez d\'efinir un 
284 Job pour chacun d'entre eux.
285
286 \begin{description}
287
288 \item [Job]
289    \index[console]{Job }
290    D\'ebut de la ressource Job. Il faut d\'efinir au moins une ressource Job.
291
292 \item [Name = \lt{}name\gt{}]
293    \index[console]{Name  }
294    Le nom du Job. Ce nom peut \^etre utilis\'e avec la commande {\bf Run} du 
295    programme Console pour lancer un Job. Si le nom contient des espaces, 
296    il doit \^etre plac\'e entre quotes. C'est g\'en\'eralement une bonne id\'ee de 
297    nommer vos Jobs du nom du Client qu'ils sauvegardent, afin de les 
298    identifier ais\'ement.
299
300    Lors de l'ex\'ecution d'un Job, son nom unique est compos\'e du nom que vous avez 
301    sp\'ecifi\'e ici suffix\'e avec la date et l'heure de sa planification.
302    Cette directive est requise.
303
304 \item [Type = \lt{}job-type\gt{}]
305    \index[console]{Type  }
306    La directive {\bf Type} sp\'ecifie le type de Job, qui peut \^etre l'un des 
307    suivants : {\bf Backup},  {\bf Restore}, {\bf Verify}, ou {\bf Admin}. 
308    Cette directive est requise. Pour chaque type de Job, il existe des 
309    niveaux, qui seront d\'ecrits dans les prochains paragraphes.
310
311 \item [Backup]
312    \index[console]{Backup }
313    D\'efinit une sauvegarde. En principe, vous aurez au moins un job de type Backup 
314    par client sauvegard\'e. A moins que vous ne d\'esactiviez le catalogue, la 
315    plupart des donn\'ees et statistiques concernant les fichiers sauvegard\'ees 
316    seront \'ecrites dans le catalogue.
317
318 \item [Restore]
319    \index[console]{Restore }
320   D\'efinit une restauration. En principe, vous ne cr\'eerez qu'un seul job de ce 
321   type, que vous utiliserez comme un prototype  que vous modifierez \`a l'aide 
322   de la console lorsque vous devrez restaurer. Bien que certaines informations 
323   basiques soient conserv\'ees dans le catalogue lors de restaurations, leur 
324   quantit\'e est infime en regard des informations stock\'ees pour une sauvegarde -- 
325   par exemple, aucune entr\'ee de nom de fichier n'est g\'en\'er\'ee, puisqu'aucun fichier 
326   n'est sauvegard\'e.
327
328 \item [Verify]
329    \index[console]{Verify }
330    D\'efinit un Job de type Verify. Le Jobs de type {\bf verify}  permettent de 
331    comparer le catalogue au syst\`eme de fichiers ou \`a ce qui a \'et\'e sauvegard\'e. 
332    Vous pouvez l'utiliser pour vous assurer qu'une cartouche de donn\'ees est 
333    lisible, mais aussi comme un syst\`eme de d\'etection d'intrusion \`a la fa\ccon de 
334    Tripwire.
335
336 \item [Admin]
337    \index[fd]{Admin }
338    D\'efinit un Job de type Admin. Un  {\bf Admin} peut s'utiliser pour "\'elaguer" 
339    p\'eriodiquement le catalogue, si vous ne souhaitez pas que ceci soit fait \`a la fin 
340    de chaque sauvegarde. Bien que les Jobs de type admin soient enregistr\'es dans le 
341    catalogue, la quantit\'e de donn\'ees g\'en\'er\'ee est infime.
342    
343 \end{description}
344
345 \label{Level}
346
347 \item {\bf Level = \lt{}job-level\gt{}}
348    \index[fd]{Level  }
349    La directive Level sp\'ecifie le niveau d'ex\'ecutiondu job  par d\'efaut. 
350    Chaque type de job a son propre jeu de niveaux qui peuvent \^etre sp\'ecifi\'es. 
351    Le niveau d'ex\'ecution est en g\'en\'eral surcharg\'e par une valeur diff\'erente 
352    sp\'ecifi\'ee dans la ressource {\bf Schedule}. Cette directive n'est pas 
353    requise mais doit \^etre sp\'ecifi\'ee soit ici, soit en tant que surcharge 
354    dans la ressource {\bf Schedule}.
355    
356 Pour un job de type {\bf Backup} le niveau doit \^etre l'un des suivants : 
357
358 \begin{description}
359
360 \item [Full]
361    \index[fd]{Full }
362    Tous les fichiers du FileSet, qu'ils aient \'et\'e modifi\'es ou non.
363
364 \item [Incremental]
365    \index[fd]{Incremental }
366    Tous les fichiers modifi\'es depuis la derni\`ere sauvegarde valide du FileSet 
367    sp\'ecifi\'e. Si le Director ne peut trouver une sauvegarde Full ant\'erieure, 
368    le niveau du job sera \'elev\'e en une sauvegarde Full. Lorsque le Director 
369    recherche une Full valide dans le catalogue, il recherche un job avec 
370    les caract\'eristiques suivantes :
371
372 \begin{itemize}
373 \item le m\^eme nom de job ; 
374 \item le m\^eme nom de client ;  
375 \item le m\^eme FileSet (toute modification de la d\'efinition du FileSet telle 
376       que l'ajout ou la suppression de fichiers dans les sections Include ou 
377       Exclude constitue un changement de FileSet).
378 \item le niveau requis (Full, Differential ou Incremental)
379 \item le job s'est termin\'e normalement, c'est \`a dire un qu'il ne s'est pas termin\'e 
380       en \'echec, et n'a pas \'et\'e effac\'e.
381 \end{itemize}
382
383 Si toutes les conditions ci-dessus ne sont pas r\'ealis\'ees, le Director 
384 augmentera la sauvegarde incr\'ementale en une sauvegarde Full. Dans le cas 
385 contraire, la sauvegarde incr\'ementale sera effectu\'ee normalement.
386
387 Le File Daemon (Client) d\'etermine les fichiers \`a sauvegarder pour une 
388 incr\'ementale par comparaison de l'heure de d\'emarrage du Job pr\'ec\'edent 
389 (Full, Diff\'erentiel ou Incr\'emental) avec les dates de derni\`ere modification 
390 de chaque fichier (st\_mtime) et de ses attributs (st\_ctime). Si le fichier 
391 ou ses attributs ont chang\'es depuis cette date de d\'emarrage, alors le fichier 
392 sera sauvegard\'e.
393
394 Veuillez noter que certains logiciels anti-virus peuvent modifier la date 
395 st\_time lors de leurs op\'erations de scan. Ainsi, si l'antivirus modifie 
396 la date d'acc\`es (st\_atime), qui n'est pas utilis\'ee par Bacula, il 
397 provoquera une modification du st\_ctime et conduira Bacula \`a sauvegarder 
398 les fichiers concern\'es lors des incr\'ementales et diff\'erentielles. Dans le 
399 cas de l'antivirus Sophos, vous pouvez \'eviter cet inconv\'enient en utilisant 
400 l'option {\bf \verb{--{no-reset-atime}. Pour les autres logiciels, voyez 
401 leurs manuels.
402
403 Lorsque Bacula effectue une sauvegarde incr\'ementale, tous les fichiers modifi\'es 
404 pr\'esents sur le syst\`eme sont sauvegard\'es. Cependant, tout fichier supprim\'e depuis 
405 la derni\`ere Full demeure dans le catalogue, ce qui signifie que si vous effectuez 
406 une restauration \`a partir de sauvegardes incr\'ementales (et de la Full associ\'ee), 
407 les fichiers supprim\'es depuis la derni\`ere Full seront aussi restaur\'es. Ces fichiers 
408 n'apparaîtront plus dans le catalogue apr\`es avoir fait une nouvelle sauvegarde 
409 Full. Le processus pour supprimer ces fichiers du catalogue lors d'une 
410 incr\'ementale ralentirait fortement les sauvegardes incr\'ementales. Il n'est 
411 actuellement pas impl\'ement\'e dans Bacula.
412
413 \item [Differential]
414    \index[fd]{Differential }
415    Tous les fichiers modifi\'es depuis la derni\`ere sauvegarde Full valide du FileSet
416    sp\'ecifi\'e. Si le Director ne peut trouver une sauvegarde Full ant\'erieure,
417    le niveau du job sera \'elev\'e en une sauvegarde Full. Lorsque le Director
418    recherche une Full valide dans le catalogue, il recherche un job avec 
419    les caract\'eristiques suivantes :
420
421 \begin{itemize}
422 \item le m\^eme nom de job ;
423 \item le m\^eme nom de client ;
424 \item le m\^eme FileSet (toute modification de la d\'efinition du FileSet telle
425       que l'ajout ou la suppression de fichiers dans les sections Include ou
426       Exclude constitue un changement de FileSet).
427 \item le Job \'etait une sauvegarde FULL
428 \item le Job s'est termin\'e normalement, c'est \`a dire qu'il ne s'est pas termin\'e
429       en \'echec, et n'a pas \'et\'e effac\'e.
430 \end{itemize}
431
432 Si toutes les conditions ci-dessus ne sont pas r\'ealis\'ees, le Director
433 augmentera la sauvegarde diff\'erentielle en une sauvegarde Full. Dans le cas
434 contraire, la sauvegarde diff\'erentielle sera effectu\'ee normalement.
435
436 Le File Daemon (Client) d\'etermine les fichiers \`a sauvegarder pour une
437 diff\'erentielle par comparaison de l'heure de d\'emarrage de la derni\`ere 
438 sauvegarde Full avec les dates de derni\`ere modification
439 de chaque fichier (st\_mtime) et de ses attributs (st\_ctime). Si le fichier
440 ou ses attributs ont chang\'es depuis cette date de d\'emarrage, alors le fichier
441 sera sauvegard\'e. La date de d\'emarrage utilis\'ee est affich\'e apr\`es le {\bf Since} 
442 du rapport de Job. Dans de rares cas, certains fichiers sont sauvegard\'es deux fois 
443 \`a cause de l'utilisation de la date de d\'emarrage de la sauvegarde pr\'ec\'edente, 
444 mais ceci assure qu'aucun changement n'est perdu. Comme pour les incr\'ementales, 
445 vous devriez vous assurer que les horloges de votre serveur Bacula et de vos clients 
446 sont synchronis\'ees, ou aussi proches que possible, pour \'eviter le risque d'omission 
447 d'un fichier. Notez qu'\`a partir de la version 1.33, Bacula effectue automatiquement 
448 ces ajustements de sorte que les horloges utilis\'ees par Bacula soient synchrones.
449
450 Veuillez noter que certains logiciels anti-virus peuvent modifier la date
451 st\_time lors de leurs op\'erations de scan. Ainsi, si l'antivirus modifie
452 la date d'acc\`es (st\_atime), qui n'est pas utilis\'ee par Bacula, il
453 provoquera une modification du st\_ctime et conduira Bacula \`a sauvegarder
454 les fichiers concern\'es lors des incr\'ementales et diff\'erentielles. Dans le
455 cas de l'antivirus Sophos, vous pouvez \'eviter cet inconv\'enient en utilisant
456 l'option {\bf \verb{--{no-reset-atime}. Pour les autres logiciels, voyez
457 leurs manuels.
458
459 Lorsque Bacula effectue une sauvegarde diff\'erentielle, tous les fichiers modifi\'es
460 pr\'esents sur le syst\`eme sont sauvegard\'es. Cependant, tout fichier supprim\'e depuis
461 la derni\`ere Full demeure dans le catalogue, ce qui signifie que si vous effectuez
462 une restauration \`a partir de sauvegardes diff\'erentielles (et de la Full associ\'ee),
463 les fichiers supprim\'es depuis la derni\`ere Full seront aussi restaur\'es. Ces fichiers
464 n'apparaîtront plus dans le catalogue apr\`es avoir fait une nouvelle sauvegarde
465 Full. Le processus pour supprimer ces fichiers du catalogue lors d'une
466 incr\'ementale ralentirait fortement les sauvegardes diff\'erentielles. Il n'est
467 actuellement pas impl\'ement\'e dans Bacula.
468
469 \end{description}
470
471 Pour un Job de type {\bf Restore}, aucun niveau ne doit \^etre sp\'ecifi\'e.  
472
473 Pour un Job de type {\bf Verify}, le niveau peut \^etre l'un des suivants :   
474
475 \begin{description}
476
477 \item [InitCatalog]
478    \index[fd]{InitCatalog }
479    Examine le {\bf FileSet} sp\'ecifi\'e et stocke les attributs de fichiers dans le 
480    catalogue. Vous pouvez vous interroger sur l'int\'er\^et d'un Job qui ne 
481    sauvegarde aucun fichier. La r\'eponse est de pouvoir utiliser Bacula comme 
482    vous utiliseriez Tripwire, en d'autres termes, ce type de Jobs vous permet 
483    de sauvegarder l'\'etat d'un ensemble de fichiers d\'efini par un {\bf FileSet} 
484    afin de pouvoir ult\'erieurement contr\^oler si rien n'a \'et\'e modifi\'e, supprim\'e ou 
485    ajout\'e. Ceci peut \^etre utilis\'e pour d\'etecter une intrusion. Typiquement, 
486    vous sp\'ecifiez un {\bf FileSet} qui contient l'ensemble des fichiers qui ne 
487    devraient pas changer (par exemple /sbin, /boot, /lib, /bin,  ...). Ensuite, 
488    vous ex\'ecutez le Job verify de niveau {\bf InitCatalog} apr\`es l'installation 
489    de votre syst\`eme, puis apr\`es chaque modification (mise \`a jour). Ensuite, 
490    lorsque vous souhaitez contr\^oler l'\'etat de votre syst\`eme de fichiers, 
491    vous utilisez un Job {\bf Verify}, {\bf level = Catalog} afin de comparer 
492    le r\'esultat de votre {\bf InitCatalog} avec l'\'etat actuel de votre syst\`eme 
493    de fichiers.
494
495 \item [Catalog]
496    \index[fd]{Catalog }
497    Compare l'\'etat actuel des fichiers et l'\'etat pr\'ec\'edemment sauvegard\'e 
498    lors d'un {\bf InitCatalog}. Toutes les anomalies sont rapport\'ees. 
499    Les objets du rapport sont d\'etermin\'es par les options {\bf verify} 
500    sp\'ecifi\'ees dans la directive {\bf Include} du {\bf FileSet} sp\'ecifi\'e 
501    (voyez la ressource {\bf FileSet} ci-dessous pour plus de d\'etails). 
502    Typiquement, cette commande sera ex\'ecut\'ee quotidiennement pour 
503    contr\^oler toute modification de votre syst\`eme de fichier.
504    
505 Attention ! Si vous ex\'ecutez deux jobs Verify Catalog simultan\'ement sur le m\^eme client, 
506 les r\'esultats seront probablement erronn\'es. En effet, Verify Catalog modifie 
507 le catalogue lors de son ex\'ecution afin de d\'etecter les nouveaux fichiers.
508
509 \item [VolumeToCatalog]
510    \index[fd]{VolumeToCatalog }
511    Ce niveau permet de lire les attributs de fichiers \'ecrits sur le Volume 
512    lors du dernier Job. Les attributs de fichiers sont compar\'es aux valeurs 
513    sauvegard\'ees dans le catalogue et toute diff\'erence est rapport\'ee. Ceci 
514    est similaire au niveau {\bf Catalog}, sauf que ce sont les 
515    attributs des fichiers du volume plut\^ot que ceux des fichiers du disque 
516    qui sont compar\'es aux attributs sauvegard\'es dans le catalogue. Bien que 
517    les attributs et signatures (MD5 ou SHA1) soient compar\'es, les donn\'ees 
518    r\'eelles ne le sont pas (elles ne figurent pas dans le catalogue).
519
520 Attention ! Si vous ex\'ecutez deux jobs Verify VolumeToCatalog simultan\'ement sur le m\^eme client,
521 les r\'esultats seront probablement erronn\'es. En effet, Verify VolumeToCatalog modifie
522 le catalogue lors de son ex\'ecution afin de d\'etecter les nouveaux fichiers.
523
524 \item [DiskToCatalog]
525    \index[fd]{DiskToCatalog }
526    Ce niveau permet de lire les fichiers tels qu'ils sont actuellement sur le 
527    disque et de comparer leurs attributs actuels avec ceux stock\'es dans le 
528    catalogue lors de la derni\`ere sauvegarde pour le Job sp\'ecifi\'e par la 
529    directive {\bf VerifyJob}. Ce niveau diff\`ere du niveau {\bf Catalog} 
530    d\'ecrit plus haut en ce qu'il ne se r\'ef\`ere pas \`a un Job Verify ant\'erieur, 
531    mais \`a la derni\`ere sauvegarde. Lorsque vous utilisez ce niveau , vous devez 
532    renseigner les option Verify de la section Include. Ces options d\'eterminent 
533    quels attributs seront compar\'es.
534
535 Cette commande peut se r\'ev\'eler tr\`es utile si vous avez des probl\`emes de disque 
536 car elle comparera l'\'etat actuel de votre disque avec la derni\`ere sauvegarde 
537 valide, qui peut remonter \`a plusieurs jobs.
538
539 Notez que l'impl\'ementation actuelle (1.32c) n'identifie pas les fichiers qui 
540 ont \'et\'e supprim\'es.
541 \end{description}
542
543 \item {\bf Verify Job = \lt{}Job-Resource-Name\gt{}}
544    \index[fd]{Verify Job  }
545    Si vous ex\'ecutez un job verify sans cette directive, le dernier job 
546    ex\'ecut\'e sera compar\'e avec le catalogue, ce qui signifie que votre commande 
547    verify doit succ\'eder imm\'ediatement \`a une sauvegarde. Si vous sp\'ecifiez 
548    un {\bf Verify Job}, Bacula trouvera le dernier job ex\'ecut\'e avec ce nom. 
549    Ceci vous permet d'ex\'ecuter toutes vos sauvegardes, puis d'ex\'ecuter les jobs 
550    Verify sur les sauvegardes de votre choix (le plus souvent, un {\bf VolumeToCatalog} 
551    de sorte que la cartouche qui vient juste d'\^etre \'ecrite est relue).
552    
553 \item {\bf JobDefs = \lt{}JobDefs-Resource-Name\gt{}}
554    \index[fd]{JobDefs  }
555    Si un nom de JobDef est sp\'ecifi\'e dans la d\'efinition d'un Job, toutes les valeurs 
556    d\'efinies dans la ressource JobDef concern\'ee seront utilis\'ees en tant que valeurs 
557    par d\'efaut pour le Job. Toute valeur explicitement sp\'ecifi\'ee dans la 
558    d\'efinition du Job outrepasse la valeur par d\'efaut d\'efinie par le JobDef.
559    L'utilisation de cette directive permet d'\'ecrire des ressources Job plus 
560    compactes, o\`u la majeure partie des directives sont d\'efinies dans un ou 
561    plusieurs JobDefs. C'est particuli\`erement pratique si vous avez de nombreux 
562    Jobs similaires avec des variations mineures telles que diff\'erents clients.
563    Un exemple basique de l'utilisation d'un Jobdef est fourni dans le fichier 
564    bacula-dir.conf par d\'efaut.
565
566 \item {\bf Bootstrap = \lt{}bootstrap-file\gt{}}
567    \index[dir]{Bootstrap  }
568    La directive Bootstrap sp\'ecifie un fichier bootstrap qui, s'il est fourni, 
569    sera utilis\'e lors des restaurations et ignor\'e par tout les autres Jobs. 
570    Le fichier {\bf bootstrap} contient la liste des cartouches n\'ecessaires 
571    pour la restauration ainsi que les index des fichiers \`a restaurer 
572    (localisation sur la cartouche). Cette directive 
573    est optionnelle, et n'est utilis\'ee que pour les restaurations. De plus, 
574    elle peut \^etre modifi\'ee lorsqu'une restauration est lanc\'ee depuis la console.
575    
576 Si vous utilisez la commande {\bf Restore} dans la console pour lancer une 
577 restauration, le fichier {\bf bootstrap} sera cr\'e\'e automatiquement \`a partir des 
578 fichiers que vous avez s\'electionn\'es pour la restauration.
579
580 Pour plus de d\'etails concernant les fichiers {\bf bootstrap}, veuillez 
581 consulter le chapitre \ilink{Restaurer des fichiers avec le fichier Bootstrap}{_ChapterStart43} 
582 de ce manuel.
583
584 \item {\bf \label{writebootstrap} Write Bootstrap =  \lt{}bootstrap-file-specification\gt{}}
585 \index[fd]{a name }
586
587    La directive {\bf writebootstrap} sp\'ecifie le de fichier Bootstrap o\`u Bacula 
588    \'ecrira lors de chaque sauvegarde. Ainsi, cette directive s'applique 
589    exclusivement aux jobs de type sauvegarde. Si la sauvegarde est une Full, 
590    Bacula \'ecrase le contenu du fichier sp\'ecifi\'e. Sinon, Bacula ajoute les 
591    nouveaux enregistrements Bootstrap \`a la fin du fichier..
592
593 En utilisant cette fonction, vous aurez constamment un fichier bootstrap 
594 capable de recouvrer l'\'etat le plus r\'ecent de votre syst\`eme. Le fichier 
595 bootstrap devrait \^etre \'ecrit sur un disque mont\'e sur une autre machine, de 
596 sorte que vous puissiez en disposer imm\'ediatement en cas de d\'efaillance 
597 de votre disque dur. Une alternative consiste \`a copier le fichier sur une autre 
598 machine apr\`es chaque mise \`a jour.
599
600 Si la {\bf sp\'ecification de fichier bootstrap} d\'ebute par une barre verticale (|), 
601 Bacula consid\`ere la sp\'ecification comme un nom de programme vers lequel les 
602 les enregistrement bootstrap seront redirig\'es. Ce peut \^etre, par exemple, un 
603 script qui vous envoie par e-mail les enregistrements bootstrap.
604
605 Pour plus de d\'etails sur l'utilisation de fichiers bootstrap, veuillez 
606 consulter le chapitre intitul\'e \ilink{Le Fichier Bootstrap}{_ChapterStart43} 
607 de ce manuel.
608
609 \item {\bf Client = \lt{}client-resource-name\gt{}}
610    \index[fd]{Client  }
611    The Client directive  specifies the Client (File daemon) that will be used in
612 the  current Job. Only a single Client may be specified in any one Job.  The
613 Client runs on the machine to be backed up,  and sends the requested files to
614 the Storage daemon for backup,  or receives them when restoring. For
615 additional details, see the  
616 \ilink{Client Resource section}{ClientResource2} of this chapter.
617 This directive is required. 
618
619 \item {\bf FileSet = \lt{}FileSet-resource-name\gt{}}
620    \index[fd]{FileSet  }
621    The FileSet directive  specifies the FileSet that will be used in the  current
622 Job. The FileSet specifies which directories (or files)  are to be backed up,
623 and what options to use (e.g. compression, ...).  Only a single FileSet
624 resource may be specified in any one Job.  For additional details, see the  
625 \ilink{FileSet Resource section}{FileSetResource} of this
626 chapter. This directive is required. 
627
628 \item {\bf Messages = \lt{}messages-resource-name\gt{}}
629    \index[dir]{Messages  }
630    The Messages directive  defines what Messages resource should be used for this
631 job, and thus  how and where the various messages are to be delivered. For
632 example,  you can direct some messages to a log file, and others can be  sent
633 by email. For additional details, see the  
634 \ilink{Messages Resource}{_ChapterStart15} Chapter of this 
635 manual. This directive is required. 
636
637 \item {\bf Pool = \lt{}pool-resource-name\gt{}}
638    \index[dir]{Pool  }
639    The Pool directive defines  the pool of Volumes where your data can be backed
640 up. Many Bacula  installations will use only the {\bf Default} pool. However,
641 if  you want to specify a different set of Volumes for different  Clients or
642 different Jobs, you will probably want to use Pools.  For additional details,
643 see the 
644 \ilink{Pool Resource section}{PoolResource} of this chapter. This
645 resource is required. 
646
647 \item {\bf Full Backup Pool = \lt{}pool-resource-name\gt{}  }
648    \index[dir]{Full Backup Pool  }
649    The {\it Full Backup Pool} specifies a Pool to be used for  Full backups. It
650 will override any Pool specification during a  Full backup. This resource is
651 optional. 
652
653 \item {\bf Differential Backup Pool = \lt{}pool-resource-name\gt{}  }
654    \index[dir]{Differential Backup Pool  }
655    The {\it Differential Backup Pool} specifies a Pool to be used for 
656 Differential backups. It will override any Pool specification during a 
657 Differentia backup. This resource is optional. 
658
659 \item {\bf Incremental Backup Pool = \lt{}pool-resource-name\gt{}  }
660    \index[dir]{Incremental Backup Pool  }
661    The {\it Incremental Backup Pool} specifies a Pool to be used for  Incremental
662 backups. It will override any Pool specification during a  Incremental backup.
663 This resource is optional. 
664
665 \item {\bf Schedule = \lt{}schedule-name\gt{}}
666    \index[dir]{Schedule  }
667    The Schedule directive defines  what schedule is to be used for the Job. The
668 schedule determines  when the Job will be automatically started and what Job
669 level (i.e.  Full, Incremental, ...) is to be run. This directive is optional,
670 and  if left out, the Job can only be started manually. For additional 
671 details, see the 
672 \ilink{Schedule Resource Chapter}{ScheduleResource} of this
673 manual.  If a Schedule resource is specified, the job will be run according to
674 the schedule specified. If no Schedule resource is specified for the  Job,
675 the job must be manually started using the Console program.  Although you may
676 specify only a single Schedule resource for any one  job, the Schedule
677 resource may contain multiple {\bf Run} directives,  which allow you to run
678 the Job at many different times, and each  {\bf run} directive permits
679 overriding the default Job Level Pool,  Storage, and Messages resources. This
680 gives considerable flexibility  in what can be done with a single Job. 
681
682 \item {\bf Storage = \lt{}storage-resource-name\gt{}}
683    \index[dir]{Storage  }
684    The Storage directive  defines the name of the storage services where you want
685 to backup  the FileSet data. For additional details, see the 
686 \ilink{Storage Resource Chapter}{StorageResource2} of this manual.
687  This directive is required.  
688
689 \item {\bf Max Start Delay = \lt{}time\gt{}}
690    \index[sd]{Max Start Delay  }
691    The time specifies  maximum delay between the scheduled time and the actual
692 start  time for the Job. For example, a job can be scheduled to run  at
693 1:00am, but because other jobs are running, it may wait  to run. If the delay
694 is set to 3600 (one hour) and the job  has not begun to run by 2:00am, the job
695 will be canceled.  This can be useful, for example, to prevent jobs from
696 running  during day time hours. The default is 0 which indicates  no limit. 
697
698 \item {\bf Max Run Time = \lt{}time\gt{}}
699    \index[sd]{Max Run Time  }
700    The time specifies  maximum allowed time that a job may run, counted from the
701 when  the job starts ({\bf not} necessarily the same as when the job  was
702 scheduled). This directive is implemented only in version 1.33  and later. 
703
704 \item {\bf Max Wait Time = \lt{}time\gt{}}
705    \index[sd]{Max Wait Time  }
706    The time specifies  maximum allowed time that a job may block waiting for a
707 resource  (such as waiting for a tape to be mounted, or waiting for the
708 storage  or file daemons to perform their duties), counted from the when  the
709 job starts ({\bf not} necessarily the same as when the job  was scheduled).
710 This directive is implemented only in version 1.33  and later. Note, the
711 implementation is not yet complete, so  this directive does not yet work
712 correctly. 
713
714 \item {\bf Prune Jobs = \lt{}yes|no\gt{}}
715    \index[fd]{Prune Jobs  }
716    Normally, pruning of Jobs  from the Catalog is specified on a Client by Client
717 basis in the  Client resource with the {\bf AutoPrune} directive. If this 
718 directive is specified (not normally) and the value is {\bf yes}, it  will
719 override the value specified in the Client resource.  The default is {\bf no}.
720
721
722 \item {\bf Prune Files = \lt{}yes|no\gt{}}
723    \index[fd]{Prune Files  }
724    Normally, pruning of Files  from the Catalog is specified on a Client by
725 Client basis in the  Client resource with the {\bf AutoPrune} directive. If
726 this  directive is specified (not normally) and the value is {\bf yes}, it 
727 will override the value specified in the Client resource.  The default is {\bf
728 no}. 
729
730 \item {\bf Prune Volumes = \lt{}yes|no\gt{}}
731    \index[fd]{Prune Volumes  }
732    Normally, pruning of Volumes  from the Catalog is specified on a Client by
733 Client basis in the  Client resource with the {\bf AutoPrune} directive. If
734 this  directive is specified (not normally) and the value is {\bf yes}, it 
735 will override the value specified in the Client resource.  The default is {\bf
736 no}. 
737
738 \item {\bf Run Before Job = \lt{}command\gt{}}
739    \index[fd]{Run Before Job  }
740    The specified {\bf command}  is run as an external program prior to running
741 the current Job. Any  output sent by the job to standard output will be
742 included in the  Bacula job report. The command string must be a valid program
743 name  or name of a shell script. This directive is not required, but if it is 
744 defined, and if the exit code of the program run is non-zero, the  current
745 Bacula job will be canceled. In addition, the command string  is parsed then
746 feed to the execvp() function, which means that the  path will be searched to
747 execute your specified command, but there  is no shell interpretation, as a
748 consequence, if you  complicated commands or want any shell features such as
749 redirection  or piping, you must call a shell script and do it inside  that
750 script.  
751
752 Before submitting the specified command to the operating system,  Bacula
753 performs character substitution of the following  characters:  
754
755 \footnotesize
756 \begin{verbatim}
757     %% = %
758     %c = Client's name
759     %d = Director's name
760     %i = JobId
761     %e = Job Exit Status
762     %j = Unique Job name
763     %l = Job Level
764     %n = Job name
765     %t = Job type
766     %v = Volume name
767     
768 \end{verbatim}
769 \normalsize
770
771 As of version 1.30, Bacula checks the exit status of the RunBeforeJob 
772 program. If it is non-zero, the job will be error terminated.  Lutz Kittler
773 has pointed out that this can be a simple way to modify  your schedules during
774 a holiday. For example, suppose that you normally  do Full backups on Fridays,
775 but Thursday and Friday are holidays. To avoid  having to change tapes between
776 Thursday and Friday when no one is in the  office, you can create a
777 RunBeforeJob that returns a non-zero status on  Thursday and zero on all other
778 days. That way, the Thursday job will not  run, and on Friday the tape you
779 insert on Wednesday before leaving will  be used.  
780
781 \item {\bf Run After Job = \lt{}command\gt{}}
782    \index[fd]{Run After Job  }
783    The specified {\bf command}  is run as an external program after the current
784 job terminates.  This directive is not required. The  command string must be a
785 valid program name or name of a shell script.  If the exit code of the program
786 run is non-zero, the current  Bacula job will terminate in error.  Before
787 submitting the specified command to the operating system,  Bacula performs
788 character substitution as described above  for the {\bf Run Before Job}
789 directive.  
790
791 An example of the use of this command is given in the  
792 \ilink{Tips Chapter}{JobNotification} of this manual.  As of version
793 1.30, Bacula checks the exit status of the RunAfter  program. If it is
794 non-zero, the job will be terminated in error.  
795
796 \item {\bf Client Run Before Job = \lt{}command\gt{}}
797    \index[fd]{Client Run Before Job  }
798    This command  is the same as {\bf Run Before Job} except that it is  run on
799 the client machine. The same restrictions apply to  Unix systems as noted
800 above for the {\bf Run Before Job}. In  addition, for a Windows client on
801 version 1.33 and above, please  take careful note that you must ensure a
802 correct path to your  script, and the script or program can be a .com, .exe or
803 a .bat  file. However, if you specify a path, you must also specify  the full
804 extension. Unix like commands will not work unless you  have installed and
805 properly configured Cygwin in addition to  and separately from Bacula.  
806
807 {\bf Special Windows Considerations}
808 The command can be anything that cmd.exe or command.com will  recognize as a
809 executable file. Specifiying the executable's  extention is optional, unless
810 there is an ambiguity. (i.e.  ls.bat, ls.exe)  
811
812 The System \%Path\% will be searched for the command. (under  the envrionment
813 variable dialog you have have both System  Environment and User Environment,
814 we believe that only the  System environment will be available to bacual-fd,
815 if it is  running as a service.)  
816
817 System environment varaible can be called out using the \%var\%  syntax and
818 used as either part of the command name or  arguments.  
819
820 When specifiying a full path to an executable if the path or  executable name
821 contains whitespace or special characters they  will need to be quoted.
822 Arguments containing whitespace or  special characters will also have to be
823 quoted. 
824
825 \footnotesize
826 \begin{verbatim}
827 ClientRunBeforeJob = "\"C:/Program Files/Software
828      Vendor/Executable\" /arg1 /arg2 \"foo bar\""
829 \end{verbatim}
830 \normalsize
831
832 The special characters \&()[]\{\}\^{}=;!'+,`\~{} will need to be quoted  if
833 part of a filename or argument.  
834
835 If someone is logged in a blank ``command'' window running the  commands will
836 be present during the execution of the command.  
837
838 Some Suggestions from Phil Stracchino for running on Win32 machines  with the
839 native Win32 File daemon: 
840
841 \begin{enumerate}
842 \item You might want the ClientRunBeforeJob directive to specify a .bat file
843    which  runs the actual client-side commands, rather than trying to run (for 
844    example) regedit /e directly.  
845 \item The batch file should explicitly 'exit 0' on successful completion.  
846 \item The path to the batch file should be specified in Unix form:  
847
848    ClientRunBeforeJob = ``c:/bacula/bin/systemstate.bat''  
849
850 rather than DOS/Windows form:  
851
852 ClientRunBeforeJob =
853 ``c:\textbackslash{}bacula\textbackslash{}bin\textbackslash{}systemstate.bat''
854 INCORRECT 
855 \end{enumerate}
856
857 \item {\bf Client Run After Job = \lt{}command\gt{}}
858    \index[fd]{Client Run After Job  }
859    This command  is the same as {\bf Run After Job} except that it is  run on the
860 client machine. Note, please see the notes above  in {\bf Client Run Before
861 Job} concerning Windows clients. 
862
863 \item {\bf Rerun Failed Levels = \lt{}yes|no\gt{}}
864    \index[fd]{Rerun Failed Levels  }
865    If this directive  is set to {\bf yes} (default no), and Bacula detects that a
866 previous job at a higher level (i.e. Full or Differential)  has failed, the
867 current job level will be upgraded to the  higher level. This is particularly
868 useful for Laptops where  they may often be unreachable, and if a prior Full
869 save has  failed, you wish the very next backup to be a Full save  rather than
870 whatever level it is started as. 
871
872 \item {\bf Spool Data = \lt{}yes|no\gt{}}
873    \index[fd]{Spool Data  }
874    If this directive is set  to {\bf yes} (default no), the Storage daemon will
875 be requested  to spool the data for this Job to disk rather than write it 
876 directly to tape. Once all the data arrives or the spool file  maximum sizes
877 are reached, the data will be despooled and written  to tape. When this
878 directive is set to yes, the Spool Attributes  is also automatically set to
879 yes. Spooling data prevents tape  shoe-shine (start and stop) during
880 Incremental saves. This option  should not be used if you are writing to a
881 disk file. 
882
883 \item {\bf Spool Attributes = \lt{}yes|no\gt{}}
884    \index[fd]{Spool Attributes  }
885    The default is set to  {\bf no}, which means that the File attributes are sent
886 by the  Storage daemon to the Director as they are stored on tape. However, 
887 if you want to avoid the possibility that database updates will  slow down
888 writing to the tape, you may want to set the value to  {\bf yes}, in which
889 case the Storage daemon will buffer the  File attributes and Storage
890 coordinates to a temporary file  in the Working Directory, then when writing
891 the Job data to the tape is  completed, the attributes and storage coordinates
892 will be  sent to the Director. The default is {\bf no}. 
893
894 \item {\bf Where = \lt{}directory\gt{}}
895    \index[dir]{Where  }
896    This directive applies only  to a Restore job and specifies a prefix to the
897 directory name  of all files being restored. This permits files to be restored
898 in a different location from which they were saved. If {\bf Where}  is not
899 specified or is set to backslash ({\bf /}), the files  will be restored to
900 their original location. By default, we  have set {\bf Where} in the example
901 configuration files to be  {\bf /tmp/bacula-restores}. This is to prevent
902 accidental overwriting  of your files. 
903
904 \item {\bf Replace = \lt{}replace-option\gt{}}
905    \index[dir]{Replace  }
906    This directive applies only  to a Restore job and specifies what happens when
907 Bacula wants to  restore a file or directory that already exists. You have the
908  following options for {\bf replace-option}:  
909
910 \begin{description}
911
912 \item [always]
913    \index[dir]{always }
914    when the file to be restored already exists,  it is deleted then replaced by
915 the copy backed up.  
916
917 \item [ifnewer]
918    \index[fd]{ifnewer }
919    if the backed up file (on tape) is newer than the  existing file, the existing
920 file is deleted and replaced by  the back up.  
921
922 \item [ifolder]
923    \index[fd]{ifolder }
924    if the backed up file (on tape) is older than the  existing file, the existing
925 file is deleted and replaced by  the back up.  
926
927 \item [never]
928    \index[fd]{never }
929    if the backed up file already exists, Bacula skips  restoring this file.  
930 \end{description}
931
932 \item {\bf Prefix Links=\lt{}yes|no\gt{}}
933    \index[fd]{Prefix Links }
934    If a {\bf Where} path prefix is  specified for a recovery job, apply it to
935 absolute links as  well. The default is {\bf No}. When set to {\bf Yes} then
936 while  restoring files to an alternate directory, any absolute soft links 
937 will also be modified to point to the new alternate directory.  Normally this
938 is what is desired -- i.e. everything is self  consistent. However, if you
939 wish to later move the files to  their original locations, all files linked
940 with absolute names  will be broken. 
941
942 \item {\bf Maximum Concurrent Jobs = \lt{}number\gt{}}
943    \index[dir]{Maximum Concurrent Jobs  }
944    where \lt{}number\gt{}  is the maximum number of Jobs from the current Job
945 resource that  can run concurrently. Note, this directive limits only Jobs 
946 with the same name as the resource in which it appears. Any  other
947 restrictions on the maximum concurrent jobs such as in  the Director, Client,
948 or Storage resources will also apply in addition to  the limit specified here.
949 The  default is set to 1, but you may set it to a larger number.  We strongly
950 recommend that you read the WARNING documented under  
951 \ilink{ Maximum Concurrent Jobs}{DirMaxConJobs} in the Director's
952 resource.  
953
954 \item {\bf Reschedule On Error = \lt{}yes|no\gt{}}
955    \index[dir]{Reschedule On Error  }
956    If this directive is enabled,  and the job terminates in error, the job will
957 be rescheduled as determined  by the {\bf Reschedule Interval} and {\bf
958 Reschedule Times} directives.  If you cancel the job, it will not be
959 rescheduled. The default is  {\bf no} (i.e. the job will not be rescheduled). 
960
961
962 This specification can be useful for portables, laptops, or other  machines
963 that are not always connected to the network or switched on.  
964
965 \item {\bf Reschedule Interval = \lt{}time-specification\gt{}}
966    \index[dir]{Reschedule Interval  }
967    If you have  specified {\bf Reschedule On Error = yes} and the job terminates
968 in  error, it will be rescheduled after the interval of time specified  by
969 {\bf time-specification}. See 
970 \ilink{ the time specification formats}{Time} in the Configure
971 chapter for  details of time specifications. If no interval is specified, the 
972 job will not be rescheduled on error. 
973
974 \item {\bf Reschedule Times = \lt{}count\gt{}}
975    \index[dir]{Reschedule Times  }
976    This directive specifies the  maximum number of times to reschedule the job.
977 If it is set to zero  (the default) the job will be rescheduled an indefinite
978 number of times.  
979 \label{Priority}
980
981 \item {\bf Priority = \lt{}number\gt{}}
982    \index[dir]{Priority  }
983    This directive permits you  to control the order in which your jobs run by
984 specifying a positive  non-zero number. The higher the number, the lower the
985 job priority.  Assuming you are not running concurrent jobs, all queued jobs
986 of  priority 1 will run before queued jobs of priority 2 and so on, 
987 regardless of the original scheduling order.  
988
989 The priority only affects waiting jobs that are queued to run, not jobs  that
990 are already running. If one or more jobs of priority 2 are already  running,
991 and a new job is scheduled with priority 1, the currently  running priority 2
992 jobs must complete before the priority 1 job is run.  
993
994 The default priority is 10.  
995
996 If you want to run concurrent jobs, which is not recommended, you should  keep
997 these points in mind:  
998
999 \begin{itemize}
1000 \item To run concurrent jobs,  you must set Maximum Concurrent Jobs = 2 in 5
1001    or 6 distinct places:  in bacula-dir.conf in the Director, the Job, the
1002    Client, the Storage  resources; in bacula-fd in the FileDaemon (or Client)
1003 resource,  and in bacula-sd.conf in the Storage resource. If any one  is
1004 missing, it will throttle the jobs to one at a time.  
1005 \item Bacula concurrently runs jobs of only one priority at a time. It will 
1006    not simultaneously run a priority 1 and a priority 2 job.  
1007 \item If Bacula is running a priority 2 job and a new priority 1  job is
1008    scheduled, it will wait until the running priority 2 job  terminates even if
1009    the Maximum Concurrent Jobs settings  would otherwise allow two jobs to run
1010 simultaneously.  
1011 \item Suppose that bacula is running a priority 2 job and new priority 1  job
1012    is scheduled and queued waiting for the running priority  2 job to terminate.
1013    If you then start a second priority 2 job,  the waiting priority 1 job  will
1014 prevent the new priority 2 job from running concurrently  with the running
1015 priority 2 job.  That is: as long as there is a higher priority job waiting to
1016 run, no new lower priority jobs will start even if  the Maximum Concurrent
1017 Jobs settings would normally allow  them to run. This ensures that higher
1018 priority jobs will  be run as soon as possible. 
1019 \end{itemize}
1020
1021 If you have several jobs of different priority, it is best  not to start them
1022 at exactly the same time, because Bacula  must examine them one at a time. If
1023 by chance Bacula treats  a lower priority first, then it will run before your
1024 high  priority jobs. To avoid this, start any higher priority  a few seconds
1025 before lower ones. This insures that Bacula  will examine the jobs in the
1026 correct order, and that your  priority scheme will be respected.  
1027 \label{WritePartAfterJob}
1028
1029 \item {\bf Write Part After Job = \lt{}yes|no\gt{}}
1030    \index[sd]{Write Part After Job  }
1031    If this directive is  set to {\bf yes} (default {\bf no}), a new part file
1032 will be created  after the job is finished.  
1033
1034 It should be set to {\bf yes} when writing to devices that require mount  (for
1035 example DVD), so you are sure that the current part, containing this job's
1036 data,  is written to the device, and that no data is left in the temporary
1037 file on the hard disk.  However, on some media, like DVD+R and DVD-R, a lot of
1038 space (about 10Mb) is lost  everytime a part is written. So, if you run
1039 several jobs each after another, you could  set this directive to {\bf no} for
1040 all jobs, except the last one, to avoid wasting too much  space, but to ensure
1041 that the data is written to the medium when all jobs are finished.  
1042
1043 It is ignored with tape and FIFO devices.  
1044 \end{description}
1045
1046 The following is an example of a valid Job resource definition: 
1047
1048 \footnotesize
1049 \begin{verbatim}
1050 Job {
1051   Name = "Minou"
1052   Type = Backup
1053   Level = Incremental                 # default
1054   Client = Minou
1055   FileSet="Minou Full Set"
1056   Storage = DLTDrive
1057   Pool = Default
1058   Schedule = "MinouWeeklyCycle"
1059   Messages = Standard
1060 }
1061 \end{verbatim}
1062 \normalsize
1063
1064 \section*{The JobDefs Resource}
1065 \label{JobDefsResource}
1066 \index[general]{JobDefs Resource }
1067 \index[general]{Resource!JobDefs }
1068 \addcontentsline{toc}{section}{JobDefs Resource}
1069
1070 The JobDefs resource permits all the same directives that can appear in a Job
1071 resource. However, a JobDefs resource does not create a Job, rather it can be
1072 referenced within a Job to provide defaults for that Job. This permits you to
1073 concisely define several nearly identical Jobs, each one referencing a JobDefs
1074 resource which contains the defaults. Only the changes from the defaults need
1075 be mentioned in each Job. 
1076
1077 \section*{The Schedule Resource}
1078 \label{ScheduleResource}
1079 \index[general]{Resource!Schedule }
1080 \index[general]{Schedule Resource }
1081 \addcontentsline{toc}{section}{Schedule Resource}
1082
1083 The Schedule resource provides a means of automatically scheduling a Job as
1084 well as the ability to override the default Level, Pool, Storage and Messages
1085 resources. If a Schedule resource is not referenced in a Job, the Job may only
1086 be run manually. In general, you specify an action to be taken and when. 
1087
1088 \begin{description}
1089
1090 \item [Schedule]
1091    \index[sd]{Schedule }
1092    Start of the Schedule directives. No {\bf Schedule}  resource is required, but
1093 you will need at least one if you want  Jobs to be automatically started. 
1094
1095 \item [Name = \lt{}name\gt{}]
1096    \index[sd]{Name  }
1097    The name of the schedule being defined.  The Name directive is required. 
1098
1099 \item [Run = \lt{}Job-overrides\gt{} \lt{}Date-time-specification\gt{}  ]
1100    \index[sd]{Run  }
1101    The Run directive defines when a Job is to be run,  and what overrides if any
1102 to apply. You may specify multiple  {\bf run} directives within a {\bf
1103 Schedule} resource. If you  do, they will all be applied (i.e. multiple
1104 schedules). If you  have two {\bf Run} directives that start at the same time,
1105 two  Jobs will start at the same time (well, within one second of  each
1106 other).  
1107
1108 The {\bf Job-overrides} permit overriding the Level, the  Storage, the
1109 Messages, and the Pool specifications  provided in the Job resource. In
1110 addition, the  FullPool, the IncrementalPool, and the  DifferentialPool
1111 specifications permit overriding the  Pool specification according to what
1112 backup Job Level is  in effect.  
1113
1114 By the use of overrides, you  may customize a particular Job. For example, you
1115 may specify a  Messages override for your Incremental backups that  outputs
1116 messages to a log file, but for your weekly or monthly  Full backups, you may
1117 send the output by email by using  a different Messages override.  
1118
1119 {\bf Job-overrides} are specified as:  {\bf keyword=value} where the keyword
1120 is Level, Storage,  Messages, Pool, FullPool, DifferentialPool, or
1121 IncrementalPool, and  the {\bf value} is as defined on the respective
1122 directive formats for  the Job resource. You may specify multiple {\bf
1123 Job-overrides} on  one {\bf Run} directive by separating them with one or more
1124 spaces or  by separating them with a trailing comma.  For example:  
1125
1126 \begin{description}
1127
1128 \item [Level=Full]
1129    \index[sd]{Level }
1130    is all files in the FileSet whether or not  they have changed.  
1131
1132 \item [Level=Incremental]
1133    \index[sd]{Level }
1134    is all files that have changed since  the last backup.  
1135
1136 \item [Pool=Weekly]
1137    \index[sd]{Pool }
1138    specifies to use the Pool named {\bf Weekly}.  
1139
1140 \item [Storage=DLT\_Drive]
1141    \index[sd]{Storage }
1142    specifies to use {\bf DLT\_Drive} for  the storage device.  
1143
1144 \item [Messages=Verbose]
1145    \index[sd]{Messages }
1146    specifies to use the {\bf Verbose}  message resource for the Job.  
1147
1148 \item [FullPool=Full]
1149    \index[sd]{FullPool }
1150    specifies to use the Pool named {\bf Full}  if the job is a full backup, or is
1151 upgraded from another type  to a full backup.  
1152
1153 \item [DifferentialPool=Differential]
1154    \index[sd]{DifferentialPool }
1155    specifies to use the Pool  named {\bf Differential} if the job is a
1156 differential  backup.  
1157
1158 \item [IncrementalPool=Incremental]
1159    \index[sd]{IncrementalPool }
1160    specifies to use the Pool  named {\bf Incremental} if the job is an
1161 incremental  backup.  
1162
1163 \item [SpoolData=yes|no]
1164    \index[sd]{SpoolData }
1165    tells Bacula to request the Storage  daemon to spool data to a disk file
1166 before putting it on  tape.  
1167
1168 \item [WritePartAfterJob=yes|no]
1169    \index[sd]{WritePartAfterJob }
1170    tells Bacula to request the Storage  daemon to write the current part file to
1171 the device when the job  is finished (see 
1172 \ilink{Write Part After Job directive in the Job
1173 resource}{WritePartAfterJob}).  
1174 \end{description}
1175
1176 {\bf Date-time-specification} determines when the  Job is to be run. The
1177 specification is a repetition, and as  a default Bacula is set to run a job at
1178 the beginning of the  hour of every hour of every day of every week of every
1179 month  of every year. This is not normally what you want, so you  must specify
1180 or limit when you want the job to run. Any  specification given is assumed to
1181 be repetitive in nature and  will serve to override or limit the default
1182 repetition. This  is done by specifing masks or times for the hour, day of the
1183 month, day of the week, week of the month, week of the year,  and month when
1184 you want the job to run. By specifying one or  more of the above, you can
1185 define a schedule to repeat at  almost any frequency you want.  
1186
1187 Basically, you must supply a {\bf month}, {\bf day}, {\bf hour}, and  {\bf
1188 minute} the Job is to be run. Of these four items to be specified,  {\bf day}
1189 is special in that you may either specify a day of the month  such as 1, 2,
1190 ... 31, or you may specify a day of the week such  as Monday, Tuesday, ...
1191 Sunday. Finally, you may also specify a  week qualifier to restrict the
1192 schedule to the first, second, third,  fourth, or fifth week of the month.  
1193
1194 For example, if you specify only a day of the week, such as {\bf Tuesday}  the
1195 Job will be run every hour of every Tuesday of every Month. That  is the {\bf
1196 month} and {\bf hour} remain set to the defaults of  every month and all
1197 hours.  
1198
1199 Note, by default with no other specification, your job will run  at the
1200 beginning of every hour. If you wish your job to run more than  once in any
1201 given hour, you will need to specify multiple {\bf run}  specifications each
1202 with a different minute.  
1203
1204 The date/time to run the Job can be specified in the following way  in
1205 pseudo-BNF:  
1206
1207 \footnotesize
1208 \begin{verbatim}
1209 <void-keyword>    = on
1210 <at-keyword>      = at
1211 <week-keyword>    = 1st | 2nd | 3rd | 4th | 5th | first |
1212                     second | third | forth | fifth
1213 <wday-keyword>    = sun | mon | tue | wed | thu | fri | sat |
1214                     sunday | monday | tuesday | wednesday |
1215                     thursday | friday
1216 <week-of-year-keyword> = w00 | w01 | ... w52 | w53
1217 <month-keyword>   = jan | feb | mar | apr | may | jun | jul |
1218                     aug | sep | oct | nov | dec | january |
1219                     february | ... | december
1220 <daily-keyword>   = daily
1221 <weekly-keyword>  = weekly
1222 <monthly-keyword> = monthly
1223 <hourly-keyword>  = hourly
1224 <digit>           = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0
1225 <number>          = <digit> | <digit><number>
1226 <12hour>          = 0 | 1 | 2 | ... 12
1227 <hour>            = 0 | 1 | 2 | ... 23
1228 <minute>          = 0 | 1 | 2 | ... 59
1229 <day>             = 1 | 2 | ... 31
1230 <time>            = <hour>:<minute> |
1231                     <12hour>:<minute>am |
1232                     <12hour>:<minute>pm
1233 <time-spec>       = <at-keyword> <time> |
1234                     <hourly-keyword>
1235 <date-keyword>    = <void-keyword>  <weekly-keyword>
1236 <day-range>       = <day>-<day>
1237 <month-range>     = <month-keyword>-<month-keyword>
1238 <wday-range>      = <wday-keyword>-<wday-keyword>
1239 <range>           = <day-range> | <month-range> |
1240                           <wday-range>
1241 <date>            = <date-keyword> | <day> | <range>
1242 <date-spec>       = <date> | <date-spec>
1243 <day-spec>        = <day> | <wday-keyword> |
1244                     <day-range> | <wday-range> |
1245                     <daily-keyword>
1246 <day-spec>        = <day> | <wday-keyword> |
1247                     <week-keyword> <wday-keyword>
1248 <month-spec>      = <month-keyword> | <month-range> |
1249                     <monthly-keyword>
1250 <date-time-spec>  = <month-spec> <day-spec> <time-spec>
1251 \end{verbatim}
1252 \normalsize
1253
1254 \end{description}
1255
1256 Note, the Week of Year specification wnn follows the ISO standard definition
1257 of the week of the year, where Week 1 is the week in which the first Thursday
1258 of the year occurs, or alternatively, the week which contains the 4th of
1259 January. Weeks are numbered w01 to w53. w00 for Bacula is the week that
1260 precedes the first ISO week (i.e. has the first few days of the year if any
1261 occur before Thursday). w00 is not defined by the ISO specification. A week
1262 starts with Monday and ends with Sunday. 
1263
1264 An example schedule resource that is named {\bf WeeklyCycle} and runs a job
1265 with level full each Sunday at 1:05am and an incremental job Monday through
1266 Saturday at 1:05am is: 
1267
1268 \footnotesize
1269 \begin{verbatim}
1270 Schedule {
1271   Name = "WeeklyCycle"
1272   Run = Level=Full sun at 1:05
1273   Run = Level=Incremental mon-sat at 1:05
1274 }
1275 \end{verbatim}
1276 \normalsize
1277
1278 An example of a possible monthly cycle is as follows: 
1279
1280 \footnotesize
1281 \begin{verbatim}
1282 Schedule {
1283   Name = "MonthlyCycle"
1284   Run = Level=Full Pool=Monthly 1st sun at 1:05
1285   Run = Level=Differential 2nd-5th sun at 1:05
1286   Run = Level=Incremental Pool=Daily mon-sat at 1:05
1287 }
1288 \end{verbatim}
1289 \normalsize
1290
1291 The first of every month: 
1292
1293 \footnotesize
1294 \begin{verbatim}
1295 Schedule {
1296   Name = "First"
1297   Run = Level=Full on 1 at 1:05
1298   Run = Level=Incremental on 2-31 at 1:05
1299 }
1300 \end{verbatim}
1301 \normalsize
1302
1303 Every 10 minutes: 
1304
1305 \footnotesize
1306 \begin{verbatim}
1307 Schedule {
1308   Name = "TenMinutes"
1309   Run = Level=Full hourly at 0:05
1310   Run = Level=Full hourly at 0:15
1311   Run = Level=Full hourly at 0:25
1312   Run = Level=Full hourly at 0:35
1313   Run = Level=Full hourly at 0:45
1314   Run = Level=Full hourly at 0:55
1315 }
1316 \end{verbatim}
1317 \normalsize
1318
1319 \subsection*{Technical Notes on Schedules}
1320 \index[general]{Schedules!Technical Notes on }
1321 \index[general]{Technical Notes on Schedules }
1322 \addcontentsline{toc}{subsection}{Technical Notes on Schedules}
1323
1324 Internally Bacula keeps a schedule as a bit mask. There are six masks and a
1325 minute field to each schedule. The masks are hour, day of the month (mday),
1326 month, day of the week (wday), week of the month (wom), and week of the year
1327 (woy). The schedule is initialized to have the bits of each of these masks
1328 set, which means that at the beginning of every hour, the job will run. When
1329 you specify a month for the first time, the mask will be cleared and the bit
1330 corresponding to your selected month will be selected. If you specify a second
1331 month, the bit corresponding to it will also be added to the mask. Thus when
1332 Bacula checks the masks to see if the bits are set corresponding to the
1333 current time, your job will run only in the two months you have set. Likewise,
1334 if you set a time (hour), the hour mask will be cleared, and the hour you
1335 specify will be set in the bit mask and the minutes will be stored in the
1336 minute field. 
1337
1338 For any schedule you have defined, you can see how these bits are set by doing
1339 a {\bf show schedules} command in the Console program. Please note that the
1340 bit mask is zero based, and Sunday is the first day of the week (bit zero). 
1341
1342 \section*{The FileSet Resource}
1343 \label{FileSetResource}
1344 \index[general]{Resource!FileSet }
1345 \index[general]{FileSet Resource }
1346 \addcontentsline{toc}{section}{FileSet Resource}
1347
1348 The FileSet resource defines what files are to be included in a backup job. At
1349 least one {\bf FileSet} resource is required for each backup Job. It consists
1350 of a list of files or directories to be included, a list of files or
1351 directories to be excluded and the various backup options such as compression,
1352 encryption, and signatures that are to be applied to each file. 
1353
1354 Any change to the list of the included files will cause Bacula to
1355 automatically create a new FileSet (defined by the name and an MD5 checksum of
1356 the Include contents). Each time a new FileSet is created, Bacula will ensure
1357 that the first backup is always a Full save. 
1358
1359 \begin{description}
1360
1361 \item [FileSet]
1362    \index[dir]{FileSet }
1363    Start of the FileSet resource. At least one {\bf FileSet}  resource must be
1364 defined. 
1365
1366 \item [Name = \lt{}name\gt{}]
1367    \index[dir]{Name  }
1368    The name of the FileSet resource.  This directive is required. 
1369
1370 \item [Ignore FileSet Changes = \lt{}yes|no\gt{}
1371    ]
1372    \index[dir]{Ignore FileSet Changes  }
1373 If this directive is set to {\bf yes}, any changes you make to the  FileSet
1374 Include or Exclude lists will be ignored and not cause Bacula  to immediately
1375 perform a Full backup. The default is {\bf no}, in which  case, if you change
1376 the Include or Exclude, Bacula will force a Full  backup to ensure that
1377 everything is properly backed up. It is not recommended  to set this directive
1378 to yes. This directive is available in Bacula  version 1.35.4 or later. 
1379
1380 \item [{Include \ \{ [ Options \{\lt{}file-options\gt{}\} ...]
1381    \lt{}file-list\gt{} \} 
1382    }]
1383 \index[dir]{Include \  \{ [ Options \{\lt{}file-options\gt{}\} ...]
1384 \lt{}file-list\gt{} \}  }
1385
1386 \item [Options \ \{ \lt{}file-options\gt{} \} 
1387    ]
1388    \index[dir]{Options \  \{ \lt{}file-options\gt{} \}  }
1389
1390 \item [Exclude \ \{ \lt{}file-list\gt{} \}]
1391    \index[dir]{Exclude \  \{ \lt{}file-list\gt{} \} }
1392
1393 The Include resource must contain a list of directories and/or files to be
1394 processed in the backup job. Normally, all files found in all subdirectories
1395 of any directory in the Include File list will be backed up. The Include
1396 resource may also oner more Options resources that specify options such as
1397 compression to be applied to all or any subset of the files found for backup. 
1398
1399 There can be any number of {\bf Include} resources within the FileSet, each
1400 having its own list of directories or files to be backed up and the backup
1401 options defined by one or more Options resources. The {\bf file-list} consists
1402 of one file or directory name per line. Directory names should be specified
1403 without a trailing slash. 
1404
1405 You should always specify a full path for every directory and file that you
1406 list in the FileSet. In addition, on Windows machines, you should {\bf always}
1407 prefix the directory or filename with the drive specification (e.g. {\bf
1408 c:/xxx}) using Unix directory name separators (forward slash). 
1409
1410 Bacula's default for processing directories is to recursively descend in the
1411 directory saving all files and subdirectories. Bacula will not by default
1412 cross filesystems (or mount points in Unix parlance). This means that if you
1413 specify the root partition (e.g. {\bf /}), Bacula will save only the root
1414 partition and not any of the other mounted filesystems. Similarly on Windows
1415 systems, you must explicitly specify each of the drives you want saved (e.g.
1416 {\bf c:/} and {\bf d:/} ...). In addition, at least for Windows systems, you
1417 will most likely want to enclose each specification within double quotes
1418 particularly if the directory (or file) name contains spaces. The {\bf df}
1419 command on Unix systems will show you which mount points you must specify to
1420 save everything. See below for an example. 
1421
1422 Take special care not to include a directory twice or Bacula will backup the
1423 same files two times wasting a lot of space on your archive device. Including
1424 a directory twice is very easy to do. For example: 
1425
1426 \footnotesize
1427 \begin{verbatim}
1428   Include {
1429     File = /
1430     File = /usr
1431     Options { compression=GZIP }
1432   }
1433 \end{verbatim}
1434 \normalsize
1435
1436 on a Unix system where /usr is a subdirectory (rather than a mounted
1437 filesystem) will cause /usr to be backed up twice. In this case, on Bacula
1438 versions prior to 1.32f-5-09Mar04 due to a bug, you will not be able to
1439 restore hard linked files that were backed up twice. 
1440
1441 If you have used Bacula prior to version 1.34.3, you will note three things in
1442 the new FileSet syntax: 
1443
1444 \begin{enumerate}
1445 \item There is no equal sign (=) after the include and before  the opening
1446    brace (\{). 
1447 \item Each directory (or filename) to be backed up is preceded by a {\bf File
1448    =}.  Previously they were simply listed on separate lines. 
1449 \item The options that previously appeared on the Include line now  must be
1450    specified within their own Options resource. 
1451    \end{enumerate}
1452
1453 The Options resource is optional, but when specified, it will contain a list
1454 of {\bf keyword=value} options to be applied to the file-list. Multiple
1455 Options resources may be specified one after another. As the files are found
1456 in the specified directories, the Options will applied to the filenames to
1457 determine if and how the file should be backed up. The Options resources are
1458 applied in the order they are specified in the FileSet until the first one
1459 that matches. An Options resource that does not contain a {\bf wild} directive
1460 (wild-card specification, see below) is assumed to match any filename. This is
1461 important to understand, because once Bacula determine that the Options
1462 matches the file under consideration, that file will be saved without looking
1463 at any other Options resources that may be present. This means that any wild
1464 cards must appear before an Option resource without wild cards. 
1465
1466 If for some reason, Bacula applies all the Options resources to a file under
1467 consideration for backup, but there are no matches (generally because of wild
1468 cards that don't match), Bacula as a default will then backup the file. This
1469 is quite logical if you consider the case of no Options, where you want
1470 everything to be backed up. However, one additional point is that in the case
1471 that no match was found, Bacula will use the options found in the last Options
1472 resource. As a consequence, if you want a particular set of ``default''
1473 options, you should put them in an Options resource after any other Options. 
1474
1475 The directives within an Options resource may be one of the following: 
1476
1477 \begin{description}
1478
1479 \item [compression=GZIP]
1480    \index[fd]{compression }
1481    All files saved will be software  compressed using the GNU ZIP compression
1482 format. The  compression is done on a file by file basis by the File daemon. 
1483 If there is a problem reading the tape in a  single record of a file, it will
1484 at most affect that file and none  of the other files on the tape. Normally
1485 this option is {\bf not} needed  if you have a modern tape drive as the drive
1486 will do its own  compression. In fact, if you specify software compression at
1487 the  same time you have hardware compression turned on, your files  may
1488 actually take more space on the volume.  
1489
1490 Software compression is very important if you are writing  your Volumes to a
1491 file, and it can also be helpful if you have a  fast computer but a slow
1492 network.  
1493
1494 Specifying {\bf GZIP} uses the default compression level six  (i.e. {\bf GZIP}
1495 is identical to {\bf GZIP6}). If you  want a different compression level (1
1496 through 9), you can specify  it by appending the level number with no
1497 intervening spaces  to {\bf GZIP}. Thus {\bf compression=GZIP1} would give
1498 minimum  compression but the fastest algorithm, and {\bf compression=GZIP9} 
1499 would give the highest level of compression, but requires more  computation.
1500 According to the GZIP documentation, compression levels  greater than 6
1501 generally give very little extra compression and are  rather CPU intensive. 
1502
1503 \item [signature=SHA1]
1504    \index[fd]{signature }
1505    An SHA1 signature will be computed for all  The SHA1 algorithm is purported to
1506 be some  what slower than the MD5 algorithm, but at the same time is 
1507 significantly better from a cryptographic point of view (i.e.  much fewer
1508 collisions, much lower probability of being hacked.)  It adds four more bytes
1509 than the MD5 signature.  We strongly recommend that either this option  or MD5
1510 be specified as a default for all files. Note, only  one of the two options
1511 MD5 or SHA1 can be computed for any  file. 
1512
1513 \item [signature=MD5]
1514    \index[fd]{signature }
1515    An MD5 signature will be computed for all  files saved. Adding this option
1516 generates about 5\% extra overhead  for each file saved. In addition to the
1517 additional CPU time,  the MD5 signature adds 16 more bytes per file to your
1518 catalog.  We strongly recommend that this option or the SHA1 option  be
1519 specified as a default for all files. 
1520
1521 \item [verify=\lt{}options\gt{}]
1522    \index[fd]{verify }
1523    The options letters specified are used  when running a {\bf Verify
1524 Level=Catalog} as well as the  {\bf DiskToCatalog} level job. The options
1525 letters may be any  combination of the following:  
1526
1527 \begin{description}
1528
1529 \item [i]
1530    compare the inodes  
1531
1532 \item [p]
1533    compare the permission bits  
1534
1535 \item [n]
1536    compare the number of links  
1537
1538 \item [u]
1539    compare the user id  
1540
1541 \item [g]
1542    compare the group id  
1543
1544 \item [s]
1545    compare the size  
1546
1547 \item [a]
1548    compare the access time  
1549
1550 \item [m]
1551    compare the modification time (st\_mtime)  
1552
1553 \item [c]
1554    compare the change time (st\_ctime)  
1555
1556 \item [s]
1557    report file size decreases  
1558
1559 \item [5]
1560    compare the MD5 signature  
1561
1562 \item [1]
1563    compare the SHA1 signature  
1564    \end{description}
1565
1566 A useful set of general options on the {\bf Level=Catalog}  or {\bf
1567 Level=DiskToCatalog}  verify is {\bf pins5} i.e. compare permission bits,
1568 inodes, number  of links, size, and MD5 changes. 
1569
1570 \item {\bf onefs=yes|no}
1571    \index[fd]{onefs }
1572    If set to {\bf yes} (the default), {\bf Bacula}  will remain on a single file
1573 system. That is it will not backup  file systems that are mounted on a
1574 subdirectory.  If you wish to backup multiple filesystems, you can  explicitly
1575 list each file system you want saved.  Otherwise, if you set the onefs option
1576 to {\bf no}, Bacula will backup  all mounted file systems (i.e. traverse mount
1577 points) that  are found within the {\bf FileSet}. Thus if  you have NFS or
1578 Samba file systems mounted on a directory listed  in your FileSet, they will
1579 also be backed up. Normally, it is  preferable to set {\bf onefs=yes} and to
1580 explicitly name  each filesystem you want backed up. Explicitly naming  the
1581 filesystems you want backed up avoids the possibility  of getting into a
1582 infinite loop recursing filesystems.  See the example below for more details. 
1583 \label{portable}
1584
1585 \item {\bf portable=yes|no}
1586    \index[dir]{portable }
1587    If set to {\bf yes} (default is  {\bf no}), the Bacula File daemon will backup
1588 Win32 files  in a portable format, but not all Win32 file attributes  will be
1589 saved and restored. By default, this option is set to  {\bf no}, which means
1590 that on Win32 systems, the data will  be backed up using Windows API calls and
1591 on WinNT/2K/XP,  all the security and ownership attributes will be properly
1592 backed up  (and restored). However this format is not portable to other 
1593 systems -- e.g. Unix, Win95/98/Me. When backing up Unix systems, this  option
1594 is ignored, and unless you have a specific need to  have portable backups, we
1595 recommend accept the default  ({\bf no}) so that the maximum information
1596 concerning  your files is saved. 
1597
1598 \item {\bf recurse=yes|no}
1599    \index[fd]{recurse }
1600    If set to {\bf yes} (the default),  Bacula will recurse (or descend) into all
1601 subdirectories  found unless the directory is explicitly excluded  using an
1602 {\bf exclude} definition.  If you set {\bf recurse=no}, Bacula will save the 
1603 subdirectory entries, but not descend into the  subdirectories, and thus will
1604 not save the files or  directories contained in the subdirectories. Normally,
1605 you  will want the default ({\bf yes}). 
1606
1607 \item {\bf sparse=yes|no}
1608    \index[dir]{sparse }
1609    Enable special code that checks for sparse files  such as created by ndbm. The
1610 default is {\bf no}, so no checks  are made for sparse files. You may specify
1611 {\bf sparse=yes} even  on files that are not sparse file. No harm will be
1612 done, but there  will be a small additional overhead to check for buffers of 
1613 all zero, and a small additional amount of space on the output  archive will
1614 be used to save the seek address of each non-zero  record read.  
1615
1616 {\bf Restrictions:} Bacula reads files in 32K buffers.  If the whole buffer is
1617 zero, it will be treated as a sparse  block and not written to tape. However,
1618 if any part of the buffer  is non-zero, the whole buffer will be written to
1619 tape, possibly  including some disk sectors (generally 4098 bytes) that are
1620 all  zero. As a consequence, Bacula's detection of sparse blocks is in  32K
1621 increments rather than the system block size. If anyone  considers this to be
1622 a real problem, please send in a request  for change with the reason. The
1623 sparse code was first  implemented in version 1.27.  
1624
1625 If you are not familiar with sparse files, an example is  say a file where you
1626 wrote 512 bytes at address zero, then  512 bytes at address 1 million. The
1627 operating system will  allocate only two blocks, and the empty space or hole 
1628 will have nothing allocated. However, when you read the  sparse file and read
1629 the addresses where nothing was written,  the OS will return all zeros as if
1630 the space were allocated,  and if you backup such a file, a lot of space will
1631 be used  to write zeros to the volume. Worse yet, when you restore  the file,
1632 all the previously empty space will now be allocated  using much more disk
1633 space. By turning on the {\bf sparse}  option, Bacula will specifically look
1634 for empty space in  the file, and any empty space will not be written to the
1635 Volume,  nor will it be restored. The price to pay for this is that  Bacula
1636 must search each block it reads before writing it.  On a slow system, this may
1637 be important. If you suspect  you have sparse files, you should benchmark the
1638 difference  or set sparse for only those files that are really sparse. 
1639 \label{readfifo}
1640
1641 \item {\bf readfifo=yes|no}
1642    \index[fd]{readfifo }
1643    If enabled, tells the Client to  read the data on a backup and write the data
1644 on a restore  to any FIFO (pipe) that is explicitly mentioned  in the FileSet.
1645 In this case, you must have a program already  running that writes into the
1646 FIFO for a backup or reads  from the FIFO on a restore. This can be
1647 accomplished with  the {\bf RunBeforeJob} directive. If this is not the case, 
1648 Bacula will hang indefinitely on reading/writing the FIFO.  When this is not
1649 enabled (default), the Client simply  saves the directory entry for the FIFO. 
1650
1651 \item {\bf mtimeonly=yes|no}
1652    \index[dir]{mtimeonly }
1653    If enabled, tells the Client that  the selection of files during Incremental
1654 and Differential  backups should based only on the st\_mtime value in the
1655 stat()  packet. The default is {\bf no} which means that the  selection of
1656 files to be backed up will be based on both the  st\_mtime and the st\_ctime
1657 values. In general, it is not  recommended to use this option. 
1658
1659 \item {\bf keepatime=yes|no}
1660    \index[dir]{keepatime }
1661    The default is {\bf no}. When  enabled, Bacula will reset the st\_atime
1662 (access time) field  of files that it backs up to their value prior to the 
1663 backup. This option is not generally recommended as there  are very few
1664 programs that use st\_atime, and the backup  overhead is increased because of
1665 the additional system  call necessary to reset the times. (I'm not sure this 
1666 works on Win32). 
1667
1668 \item {\bf wild=\lt{}string\gt{}}
1669    \index[dir]{wild }
1670    Specifies a wild-card string  to be applied to the Files. Note, if {\bf
1671 Exclude} is  not enabled, the wild-card will select which files are to  be
1672 included. If {\bf Exclude=yes} is specified, the wild-card  will select which
1673 files are to be excluded. Multiple wild-card  directives may be specified, and
1674 they will be applied in turn  until the first one that matches. 
1675
1676 \item {\bf regex=\lt{}string\gt{}}
1677    \index[dir]{regex }
1678    Specifies a POSIX extended  regular expression to be applied to the Files.
1679 This  directive is available in version 1.35 and later. If  {\bf Exclude} is
1680 not enabled, the regex will select which  files are to be included. If {\bf
1681 Exclude=yes} is  specified, the regex will select which files are to be 
1682 excluded. Multiple regex directives may be specified  within an Options
1683 resource, and  they will be applied in turn until the first one that  matches.
1684
1685
1686 \item {\bf exclude=yes|no}
1687    \index[dir]{exclude }
1688    The default is {\bf no}. When  enabled, any files matched within the Options
1689 will be  excluded from the backup. 
1690 \label{ACLSupport}
1691
1692 \item {\bf aclsupport=yes|no}
1693    \index[dir]{aclsupport }
1694    The default is {\bf no}.  If this option is set to yes, and you have the POSIX
1695 {\bf libacl} installed on your system, Bacula will backup the  file and
1696 directory UNIX Access Control Lists (ACL) as defined  in IEEE Std 1003.1e
1697 draft 17 and ``POSIX.1e''  (abandoned). This feature is available on UNIX only
1698 and  depends on the ACL library. Bacula is automatically compiled  with ACL
1699 support if the {\bf libacl} library is installed on  your system (shown in
1700 config.out). While restoring the files  Bacula will try to restore the ACLs,
1701 if there is no ACL  support available on the system, Bacula restores the files
1702 and  directories but not the ACL information. Please note, if you  backup an
1703 EXT3 or XFS filesystem with ACLs, then you restore  them to a different
1704 filesystem (perhaps reiserfs) that does  not have ACLs, the ACLs will be
1705 ignored. 
1706 \end{description}
1707
1708 {\bf \lt{}file-list\gt{}} is a list of directory and/or filename names
1709 specified with a {\bf File =} directive. To include names containing spaces,
1710 enclose the name between double-quotes. 
1711
1712 There are a number of special cases when specifying directories and files in a
1713 {\bf file-list}. They are: 
1714
1715 \begin{itemize}
1716 \item Any name preceded by an at-sign (@) is assumed to be the  name of a
1717    file, which contains a list of files each preceded by a  ``File =''. The named
1718    file is read once when  the configuration file is parsed during the Director
1719 startup.  Note, that the file is read on the Director's machine  and not on
1720 the Client's. In fact, the @filename can  appear anywhere within the conf file
1721 where a token  would be read, and the contents of the named file will be 
1722 logically inserted in the place of the @filename. What  must be in the file
1723 depends on the location the @filename  is specified in the conf file.  
1724 \item Any name beginning with a vertical bar (|) is  assumed to be the name of
1725    a program. This program will be executed  on the Director's machine at the
1726    time the Job starts (not  when the Director reads the configuration file), and
1727 any output  from that program will be assumed to be a list of files or 
1728 directories, one per line, to be included. This allows you to  have a job that
1729 for example includes all the local partitions even  if you change the
1730 partitioning by adding a disk. In general, you will  need to prefix your
1731 command or commands with a {\bf sh -c} so that  they are invoked by a shell.
1732 This will not be the case if you are  invoking a script as in the second
1733 example below. Also, you must  take care to escape (precede with a
1734 \textbackslash{}) wild-cards, shell character, and to  ensure that any spaces
1735 in your command are escaped as well.  If you use a single quotes (') within a
1736 double quote  (``), Bacula will treat everything between the single  quotes as
1737 one field so it will not be necessary to escape  the spaces. In general,
1738 getting all the quotes and escapes  correct is a real pain as you can see by
1739 the next example.  As a consequence, it is often easier to put everything in a
1740 file and simply use the file name within Bacula. In that  case the {\bf sh
1741 -c} will not be necessary providing the  first line of the file is {\bf
1742 \#!/bin/sh}. 
1743
1744 As an  example: 
1745
1746 \footnotesize
1747 \begin{verbatim}
1748  
1749 Include {
1750    Options { signature = SHA1 }
1751    File = "|sh -c 'df -l | grep \"^/dev/hd[ab]\" | grep -v \".*/tmp\" \
1752       | awk \"{print \\$6}\"'"
1753 }
1754 \end{verbatim}
1755 \normalsize
1756
1757 will produce a list of all the local partitions on a RedHat Linux  system.
1758 Note, the above line was split, but should normally  be written on one line. 
1759 Quoting is a real problem because you must quote for Bacula  which consists of
1760 preceding every \textbackslash{} and every '' with a \textbackslash{}, and 
1761 you must also quote for the shell command. In the end, it is probably  easier
1762 just to execute a small file with: 
1763
1764 \footnotesize
1765 \begin{verbatim}
1766 Include {
1767   Options {
1768     signature=MD5
1769   }
1770   File = "|my_partitions"
1771 }
1772 \end{verbatim}
1773 \normalsize
1774
1775 where my\_partitions has: 
1776
1777 \footnotesize
1778 \begin{verbatim}
1779 #!/bin/sh
1780 df -l | grep "^/dev/hd[ab]" | grep -v ".*/tmp" \
1781       | awk "{print \$6}"
1782 \end{verbatim}
1783 \normalsize
1784
1785 If the vertical bar (|) in front of my\_partitions  is preceded by a backslash
1786 as in \textbackslash{}|,  the program will be executed on the Client's machine
1787 instead  of on the Director's machine -- (this is implemented but  not
1788 thoroughly tested, and is reported to work on Windows). Please  note that if
1789 the filename is given within quotes, you will need to  use two slashes. An
1790 example, provided by John Donagher, that backs  up all the local UFS
1791 partitions on a remote system is: 
1792
1793 \footnotesize
1794 \begin{verbatim}
1795 FileSet {
1796   Name = "All local partitions"
1797   Include {
1798     Options { signature=SHA1; onefs=yes; }
1799     File = "\\|bash -c \"df -klF ufs | tail +2 | awk '{print \$6}'\""
1800   }
1801 }
1802 \end{verbatim}
1803 \normalsize
1804
1805 Note, it requires two backslash characters after the double quote (one
1806 preserves  the next one). If you are a Linux user, just change the {\bf ufs}
1807 to  {\bf ext3} (or your preferred filesystem type) and you will be in 
1808 business.  
1809 \item Any file-list item preceded by a less-than sign (\lt{})  will be taken
1810    to be a file. This file will be read on the  Director's machine at the time
1811    the Job starts, and the  data will be assumed to be a list of directories or
1812 files,  one per line, to be included. The names should not be  quoted even if
1813 they contain spaces. This feature allows you to  modify the external file and
1814 change what will be saved  without stopping and restarting Bacula as would be 
1815 necessary if using the @ modifier noted above. 
1816
1817 If you  precede the less-than sign (\lt{}) with a backslash as in 
1818 \textbackslash{}\lt{}, the file-list will be read on the Client machine 
1819 instead of on the Director's machine. Please note that if  the filename is
1820 given within quotes, you will need to use  two slashes.  
1821 \item If you explicitly specify a block device such as {\bf /dev/hda1},  then
1822    Bacula (starting with version 1.28) will assume that this  is a raw partition
1823    to be backed up. In this case, you are strongly  urged to specify a {\bf
1824 sparse=yes} include option, otherwise, you  will save the whole partition
1825 rather than just the actual data that  the partition contains. For example: 
1826
1827 \footnotesize
1828 \begin{verbatim}
1829 Include {
1830   Options { signature=MD5; sparse=yes }
1831   File = /dev/hd6
1832 }
1833 \end{verbatim}
1834 \normalsize
1835
1836 will backup the data in device /dev/hd6.  
1837
1838 Ludovic Strappazon has pointed out that this feature can be  used to backup a
1839 full Microsoft Windows disk. Simply boot into  the system using a Linux Rescue
1840 disk, then load a statically  linked Bacula as described in the 
1841 \ilink{ Disaster Recovery Using Bacula}{_ChapterStart38} chapter of
1842 this manual. Then  save the whole disk partition. In the case of a disaster,
1843 you  can then restore the desired partition by again booting with  the rescue
1844 disk and doing a restore of the partition. 
1845 \item If you explicitly specify a FIFO device name (created with mkfifo),  and
1846    you add the option {\bf readfifo=yes} as an option, Bacula  will read the FIFO
1847    and back its data up to the Volume. For  example: 
1848
1849 \footnotesize
1850 \begin{verbatim}
1851 Include {
1852   Options {
1853     signature=SHA1
1854     readfifo=yes
1855   }
1856   File = /home/abc/fifo
1857 }
1858 \end{verbatim}
1859 \normalsize
1860
1861 if {\bf /home/abc/fifo} is a fifo device, Bacula will  open the fifo, read it,
1862 and store all data thus obtained  on the Volume. Please note, you must have a
1863 process on  the system that is writing into the fifo, or Bacula will  hang,
1864 and after one minute of waiting, Bacula will give up  and go on to the next
1865 file. The data read can be anything  since Bacula treats it as a stream.  
1866
1867 This feature can be an excellent way to do a  ``hot'' backup of a very large
1868 database. You can  use the {\bf RunBeforeJob} to create the fifo and to  start
1869 a program that dynamically reads your database and  writes it to the fifo.
1870 Bacula will then write it to the  Volume.  
1871
1872 During the restore operation, the inverse is true,  after Bacula creates the
1873 fifo if there was any data stored  with it (no need to explicitly list it or
1874 add any  options), that data will be written back to the fifo. As  a
1875 consequence, if any such FIFOs exist in the fileset to  be restored, you must
1876 ensure that there is a reader  program or Bacula will block, and after one
1877 minute, Bacula  will time out the write to the fifo and move on to the  next
1878 file. 
1879 \end{itemize}
1880
1881 \end{description}
1882
1883 The following is an example of a valid FileSet resource definition. Note, the
1884 first Include pulls in the contents of the file {\bf /etc/backup.list} when
1885 Bacula is started (i.e. the @). 
1886
1887 \footnotesize
1888 \begin{verbatim}
1889 FileSet {
1890   Name = "Full Set"
1891   Include {
1892     Options {
1893       Compression=GZIP
1894       signature=SHA1
1895       Sparse = yes
1896     }
1897     File = @/etc/backup.list
1898   }
1899   Include {
1900      Options {
1901         wild = *.o
1902         Exclude = yes
1903      }
1904      File = /root/myfile
1905      File = /usr/lib/another_file
1906   }
1907 }
1908 \end{verbatim}
1909 \normalsize
1910
1911 Note, in the above example, all the files contained in /etc/backup.list will
1912 be compressed with GZIP compression, an SHA1 signature will be computed on the
1913 file's contents (its data), and sparse file handling will apply. 
1914
1915 The two directories /root/myfile and /usr/lib/another\_file will also be saved
1916 without any options, but all files in those directories with the extension
1917 {\bf .o} will be excluded. 
1918
1919 Suppose you want to save everything except {\bf /tmp} on your system. Doing a
1920 {\bf df} command, you get the following output: 
1921
1922 \footnotesize
1923 \begin{verbatim}
1924 [kern@rufus k]$ df
1925 Filesystem      1k-blocks      Used Available Use% Mounted on
1926 /dev/hda5         5044156    439232   4348692  10% /
1927 /dev/hda1           62193      4935     54047   9% /boot
1928 /dev/hda9        20161172   5524660  13612372  29% /home
1929 /dev/hda2           62217      6843     52161  12% /rescue
1930 /dev/hda8         5044156     42548   4745376   1% /tmp
1931 /dev/hda6         5044156   2613132   2174792  55% /usr
1932 none               127708         0    127708   0% /dev/shm
1933 //minimatou/c$   14099200   9895424   4203776  71% /mnt/mmatou
1934 lmatou:/          1554264    215884   1258056  15% /mnt/matou
1935 lmatou:/home      2478140   1589952    760072  68% /mnt/matou/home
1936 lmatou:/usr       1981000   1199960    678628  64% /mnt/matou/usr
1937 lpmatou:/          995116    484112    459596  52% /mnt/pmatou
1938 lpmatou:/home    19222656   2787880  15458228  16% /mnt/pmatou/home
1939 lpmatou:/usr      2478140   2038764    311260  87% /mnt/pmatou/usr
1940 deuter:/          4806936     97684   4465064   3% /mnt/deuter
1941 deuter:/home      4806904    280100   4282620   7% /mnt/deuter/home
1942 deuter:/files    44133352  27652876  14238608  67% /mnt/deuter/files
1943 \end{verbatim}
1944 \normalsize
1945
1946 If you specify only {\bf /} in your Include list, Bacula will only save the
1947 Filesystem {\bf /dev/hda5}. To save all file systems except {\bf /tmp} with
1948 out including any of the Samba or NFS mounted systems, and explicitly
1949 excluding a /tmp, /proc, .journal, and .autofsck, which you will not want to
1950 be saved and restored, you can use the following: 
1951
1952 \footnotesize
1953 \begin{verbatim}
1954 FileSet {
1955   Name = Include_example
1956   Include {
1957     Options {
1958        wild = /proc
1959        wild = /tmp
1960        wild = \.journal
1961        wild = \.autofsck
1962        exclude = yes
1963     }
1964     File = /
1965     File = /boot
1966     File = /home
1967     File = /rescue
1968     File = /usr
1969   }
1970 }
1971 \end{verbatim}
1972 \normalsize
1973
1974 Since /tmp is on its own filesystem and it was not explicitly named in the
1975 Include list, it is not really needed in the exclude list. It is better to
1976 list it in the Exclude list for clarity, and in case the disks are changed so
1977 that it is no longer in its own partition. 
1978
1979 Please be aware that allowing Bacula to traverse or change file systems can be
1980 {\bf very} dangerous. For example, with the following: 
1981
1982 \footnotesize
1983 \begin{verbatim}
1984 FileSet {
1985   Name = "Bad example"
1986   Include {
1987     Options { onefs=no }
1988     File = /mnt/matou
1989   }
1990 }
1991 \end{verbatim}
1992 \normalsize
1993
1994 you will be backing up an NFS mounted partition ({\bf /mnt/matou}), and since
1995 {\bf onefs} is set to {\bf no}, Bacula will traverse file systems. Now if {\bf
1996 /mnt/matou} has the current machine's file systems mounted, as is often the
1997 case, you will get yourself into a recursive loop and the backup will never
1998 end. 
1999
2000 The following FileSet definition will backup a raw partition: 
2001
2002 \footnotesize
2003 \begin{verbatim}
2004 FileSet {
2005   Name = "RawPartition"
2006   Include {
2007     Options { sparse=yes }
2008     File = /dev/hda2
2009   }
2010 }
2011 \end{verbatim}
2012 \normalsize
2013
2014 While backing up and restoring a raw partition, you should ensure that no
2015 other process including the system is writing to that partition. As a
2016 precaution, you are strongly urged to ensure that the raw partition is not
2017 mounted or is mounted read-only. If necessary, this can be done using the {\bf
2018 RunBeforeJob} directive. 
2019 \label{win32}
2020
2021 \subsection*{Windows Considerations for FileSets}
2022 \index[general]{FileSets!Windows Considerations for }
2023 \index[general]{Windows Considerations for FileSets }
2024 \addcontentsline{toc}{subsection}{Windows Considerations for FileSets}
2025
2026 If you are entering Windows file names, the directory path may be preceded by
2027 the drive and a colon (as in c:). However, the path separators must be
2028 specified in Unix convention (i.e. forward slash (/)). If you wish to include
2029 a quote in a file name, precede the quote with a backslash
2030 (\textbackslash{}\textbackslash{}). For example you might use the following
2031 for a Windows machine to backup the ``My Documents'' directory: 
2032
2033 \footnotesize
2034 \begin{verbatim}
2035 FileSet {
2036   Name = "Windows Set"
2037   Include {
2038     Options {
2039        wild = *.obj
2040        wild = *.exe
2041        exclude = yes
2042      }
2043      File = "c:/My Documents"
2044   }
2045 }
2046 \end{verbatim}
2047 \normalsize
2048
2049 For exclude lists to work correctly on Windows, you must observe the following
2050 rules: 
2051
2052 \begin{itemize}
2053 \item Filenames are case sensitive, so you must use the correct case.  
2054 \item To exclude a directory, you must not have a trailing slash on the 
2055    directory name.  
2056 \item If you have spaces in your filename, you must enclose the entire name 
2057    in double-quote characters (``). Trying to use a backslash before  the space
2058    will not work.  
2059 \item If you are using the old Exclude syntax (noted below), you may  not
2060    specify a drive letter in the exclude. The new syntax noted  above should work
2061    fine including driver letters. 
2062 \end{itemize}
2063
2064 Thanks to Thiago Lima for summarizing the above items for us. If you are
2065 having difficulties getting includes or excludes to work, you might want to
2066 try using the {\bf estimate job=xxx listing} command documented in the 
2067 \ilink{Console chapter}{estimate} of this manual. 
2068
2069 On Win32 systems, if you move a directory or file or rename a file into the
2070 set of files being backed up, and a Full backup has already been made, Bacula
2071 will not know there are new files to be saved during an Incremental or
2072 Differential backup (blame Microsoft, not me). To avoid this problem, please
2073 {\bf copy} any new directory or files into the backup area. If you do not have
2074 enough disk to copy the directory or files, move them, but then initiate a
2075 Full backup. 
2076
2077 \subsubsection*{Excluding Files and Directories}
2078 \index[general]{Directories!Excluding Files and }
2079 \index[general]{Excluding Files and Directories }
2080 \addcontentsline{toc}{subsubsection}{Excluding Files and Directories}
2081
2082 You may also include full filenames or directory names in addition to using
2083 wild-cards and {\bf Exclude=yes} in the Options resource as specified above by
2084 simply including the files to be excluded in an Exclude resource within the
2085 FileSet. For example: 
2086
2087 \footnotesize
2088 \begin{verbatim}
2089 FileSet {
2090   Name = Exclusion_example
2091   Include {
2092     Options {
2093       Signature = SHA1
2094     }
2095     File = /
2096     File = /boot
2097     File = /home
2098     File = /rescue
2099     File = /usr
2100   }
2101   Exclude {
2102     File = /proc
2103     File = /tmp
2104     File = .journal
2105     File = .autofsck
2106   }
2107 }
2108 \end{verbatim}
2109 \normalsize
2110
2111 \subsection*{A Windows Example FileSet}
2112 \index[general]{FileSet!Windows Example }
2113 \index[general]{Windows Example FileSet }
2114 \addcontentsline{toc}{subsection}{Windows Example FileSet}
2115
2116 The following example was contributed by Phil Stracchino: 
2117
2118 \footnotesize
2119 \begin{verbatim}
2120 This is my Windows 2000 fileset:
2121 FileSet {
2122   Name = "Windows 2000 Full Set"
2123   Include {
2124     Options {
2125        signature=MD5
2126     }
2127     File = c:/
2128   }
2129   Exclude {
2130 # Most of these files are excluded not because we don't want
2131 #  them, but because Win2K won't allow them to be backed up
2132 #  except via proprietary Win32 API calls.
2133     File = "/Documents and Settings/*/Application Data/*/Profiles/
2134            */*/Cache/*"
2135     File = "/Documents and Settings/*/Local Settings/Application Data/
2136            Microsoft/Windows/[Uu][Ss][Rr][Cc][Ll][Aa][Ss][Ss].*"
2137     File = "/Documents and Settings/*/[Nn][Tt][Uu][Ss][Ee][Rr].*"
2138     File = "/Documents and Settings/*/Cookies/*"
2139     File = "/Documents and Settings/*/Local Settings/History/*"
2140     File = "/Documents and Settings/*/Local Settings/
2141            Temporary Internet Files/*"
2142     File = "/Documents and Settings/*/Local Settings/Temp/*"
2143     File = "/WINNT/CSC"
2144     File = "/WINNT/security/logs/scepol.log"
2145     File = "/WINNT/system32/config/*"
2146     File = "/WINNT/msdownld.tmp/*"
2147     File = "/WINNT/Internet Logs/*"
2148     File = "/WINNT/$Nt*Uninstall*"
2149     File = "/WINNT/Temp/*"
2150     File = "/temp/*"
2151     File = "/tmp/*"
2152     File = "/pagefile.sys"
2153   }
2154 }
2155 \end{verbatim}
2156 \normalsize
2157
2158 Note, the three line of the above Exclude were split to fit on the document
2159 page, they should be written on a single line in real use. 
2160
2161 \subsection*{The Old FileSet Resource}
2162 \index[general]{Resource!Old FileSet }
2163 \index[general]{Old FileSet Resource }
2164 \addcontentsline{toc}{subsection}{Old FileSet Resource}
2165
2166 The old pre-version 1.34.3 FileSet Resource has been deprecated but will still
2167 work. You are encouraged to convert to using the new form since the old code
2168 will be removed in version 1.37. 
2169
2170 \subsection*{Testing Your FileSet}
2171 \index[general]{FileSet!Testing Your }
2172 \index[general]{Testing Your FileSet }
2173 \addcontentsline{toc}{subsection}{Testing Your FileSet}
2174
2175 If you wish to get an idea of what your FileSet will really backup or if your
2176 exclusion rules will work correctly, you can test it by using the {\bf
2177 estimate} command in the Console program. See the 
2178 \ilink{estimate command}{estimate} in the Console chapter of this
2179 manual. 
2180
2181 \subsection*{Windows NTFS Naming Considerations}
2182 \index[general]{Windows NTFS Naming Considerations }
2183 \index[general]{Considerations!Windows NTFS Naming }
2184 \addcontentsline{toc}{subsection}{Windows NTFS Naming Considerations}
2185
2186 NTFS filenames containing Unicode characters (i.e. \gt{} 0xFF) cannot be
2187 explicitly named at the moment. You must include such names by naming a higher
2188 level directory or a drive letter that does not contain Unicode characters. 
2189
2190 \section*{The Client Resource}
2191 \label{ClientResource2}
2192 \index[general]{Resource!Client }
2193 \index[general]{Client Resource }
2194 \addcontentsline{toc}{section}{Client Resource}
2195
2196 The Client resource defines the attributes of the Clients that are served by
2197 this Director; that is the machines that are to be backed up. You will need
2198 one Client resource definition for each machine to be backed up. 
2199
2200 \begin{description}
2201
2202 \item [Client (or FileDaemon)]
2203    \index[dir]{Client (or FileDaemon) }
2204    Start of the Client directives.  
2205
2206 \item [Name = \lt{}name\gt{}]
2207    \index[dir]{Name  }
2208    The client name which will be used in the  Job resource directive or in the
2209 console run command.  This directive is required.  
2210
2211 \item [Address = \lt{}address\gt{}]
2212    \index[console]{Address  }
2213    Where the address is a host  name, a fully qualified domain name, or a network
2214 address in  dotted quad notation for a Bacula File server daemon.  This
2215 directive is required. 
2216
2217 \item [FD Port = \lt{}port-number\gt{}]
2218    \index[console]{FD Port  }
2219    Where the port is a port  number at which the Bacula File server daemon can be
2220 contacted.  The default is 9102. 
2221
2222 \item [Catalog = \lt{}Catalog-resource-name\gt{}]
2223    \index[console]{Catalog  }
2224    This specifies the  name of the catalog resource to be used for this Client. 
2225 This directive is required.  
2226
2227 \item [Password = \lt{}password\gt{}]
2228    \index[console]{Password  }
2229    This is the password to be  used when establishing a connection with the File
2230 services, so  the Client configuration file on the machine to be backed up
2231 must  have the same password defined for this Director. This directive is 
2232 required.  If you have either {\bf /dev/random}  {\bf bc} on your machine,
2233 Bacula will generate a random  password during the configuration process,
2234 otherwise it will  be left blank. 
2235 \label{FileRetention}
2236
2237 \item [File Retention = \lt{}time-period-specification\gt{}  ]
2238    \index[fd]{File Retention  }
2239    The File Retention directive defines the length of time that  Bacula will keep
2240 File records in the Catalog database.  When this time period expires, and if
2241 {\bf AutoPrune} is set to  {\bf yes} Bacula will prune (remove) File records
2242 that  are older than the specified File Retention period. Note, this  affects
2243 only records in the catalog database. It does not  effect your archive
2244 backups.  
2245
2246 File records  may actually be retained for a shorter period than you specify
2247 on  this directive if you specify either a shorter {\bf Job Retention}  or
2248 shorter {\bf Volume Retention} period. The shortest  retention period of the
2249 three takes precedence.  The time may be expressed in seconds, minutes, 
2250 hours, days, weeks, months, quarters, or years. See the 
2251 \ilink{ Configuration chapter}{Time} of this  manual for
2252 additional details of time specification. 
2253
2254 The  default is 60 days. 
2255 \label{JobRetention}
2256
2257 \item [Job Retention = \lt{}time-period-specification\gt{}  ]
2258    \index[fd]{Job Retention  }
2259    The Job Retention directive defines the length of time that  Bacula will keep
2260 Job records in the Catalog database.  When this time period expires, and if
2261 {\bf AutoPrune} is set to  {\bf yes} Bacula will prune (remove) Job records
2262 that are  older than the specified File Retention period. As with the other 
2263 retention periods, this affects only records in the catalog and  not data in
2264 your archive backup.  
2265
2266 If a Job  record is selected for pruning, all associated File and JobMedia 
2267 records will also be pruned regardless of the File Retention  period set. As a
2268 consequence, you normally will set the File  retention period to be less than
2269 the Job retention period. The  Job retention period can actually be less than
2270 the value you  specify here if you set the {\bf Volume Retention} directive in
2271 the  Pool resource to a smaller duration. This is because the Job  retention
2272 period and the Volume retention period are  independently applied, so the
2273 smaller of the two takes  precedence.  
2274
2275 The Job retention period is specified as seconds,  minutes, hours, days,
2276 weeks, months,  quarters, or years.  See the 
2277 \ilink{ Configuration chapter}{Time} of this manual for
2278 additional details of  time specification.  
2279
2280 The default is 180 days.  
2281 \label{AutoPrune}
2282
2283 \item [AutoPrune = \lt{}yes|no\gt{}]
2284    \index[fd]{AutoPrune  }
2285    If AutoPrune is set to  {\bf yes} (default), Bacula (version 1.20 or greater)
2286 will  automatically apply the File retention period and the Job  retention
2287 period for the Client at the end of the Job.  If you set {\bf AutoPrune = no},
2288 pruning will not be done,  and your Catalog will grow in size each time you
2289 run a Job.  Pruning affects only information in the catalog and not data 
2290 stored in the backup archives (on Volumes).  
2291
2292 \item [Maximum Concurrent Jobs = \lt{}number\gt{}]
2293    \index[fd]{Maximum Concurrent Jobs  }
2294    where \lt{}number\gt{}  is the maximum number of Jobs with the current Client
2295 that  can run concurrently. Note, this directive limits only Jobs  for Clients
2296 with the same name as the resource in which it appears. Any  other
2297 restrictions on the maximum concurrent jobs such as in  the Director, Job, or
2298 Storage resources will also apply in addition to  any limit specified here.
2299 The  default is set to 1, but you may set it to a larger number.  We strongly
2300 recommend that you read the WARNING documented under  
2301 \ilink{ Maximum Concurrent Jobs}{DirMaxConJobs} in the Director's
2302 resource.  
2303
2304 \item [*Priority = \lt{}number\gt{}]
2305    \index[fd]{*Priority  }
2306    The number specifies the  priority of this client relative to other clients
2307 that the  Director is processing simultaneously. The priority can range  from
2308 1 to 1000. The clients are ordered such that the smaller  number priorities
2309 are performed first (not currently  implemented). 
2310 \end{description}
2311
2312 The following is an example of a valid Client resource definition: 
2313
2314 \footnotesize
2315 \begin{verbatim}
2316 Client {
2317   Name = Minimatou
2318   Address = minimatou
2319   Catalog = MySQL
2320   Password = very_good
2321 }
2322 \end{verbatim}
2323 \normalsize
2324
2325 \section*{The Storage Resource}
2326 \label{StorageResource2}
2327 \index[general]{Resource!Storage }
2328 \index[general]{Storage Resource }
2329 \addcontentsline{toc}{section}{Storage Resource}
2330
2331 The Storage resource defines which Storage daemons are available for use by
2332 the Director. 
2333
2334 \begin{description}
2335
2336 \item [Storage]
2337    \index[fd]{Storage }
2338    Start of the Storage resources. At least one  storage resource must be
2339 specified. 
2340
2341 \item [Name = \lt{}name\gt{}]
2342    \index[sd]{Name  }
2343    The name of the storage resource. This  name appears on the Storage directive
2344 specified in the Job directive and  is required. 
2345
2346 \item [Address = \lt{}address\gt{}]
2347    \index[sd]{Address  }
2348    Where the address is a host name,  a {\bf fully qualified domain name}, or an
2349 {\bf IP address}. Please note  that the \lt{}address\gt{} as specified here
2350 will be transmitted to  the File daemon who will then use it to contact the
2351 Storage daemon. Hence,  it is {\bf not}, a good idea to use {\bf localhost} as
2352 the  name but rather a fully qualified machine name or an IP address.  This
2353 directive is required. 
2354
2355 \item [SD Port = \lt{}port\gt{}]
2356    \index[sd]{SD Port  }
2357    Where port is the port to use to  contact the storage daemon for information
2358 and to start jobs.  This same port number must appear in the Storage resource
2359 of the  Storage daemon's configuration file. The default is 9103. 
2360
2361 \item [Password = \lt{}password\gt{}]
2362    \index[sd]{Password  }
2363    This is the password to be used  when establishing a connection with the
2364 Storage services. This  same password also must appear in the Director
2365 resource of the Storage  daemon's configuration file. This directive is
2366 required.  If you have either {\bf /dev/random}  {\bf bc} on your machine,
2367 Bacula will generate a random  password during the configuration process,
2368 otherwise it will  be left blank. 
2369
2370 \item [Device = \lt{}device-name\gt{}]
2371    \index[sd]{Device  }
2372    This directive specifies the name  of the device to be used to for the
2373 storage. This name is not the  physical device name, but the logical device
2374 name as defined on the  {\bf Name} directive contained in the {\bf Device}
2375 resource  definition of the {\bf Storage daemon} configuration file.  You can
2376 specify any name you would like (even the device name if  you prefer) up to a
2377 maximum of 127 characters in length.  The physical device name associated with
2378 this device is specified in  the {\bf Storage daemon} configuration file (as
2379 {\bf Archive  Device}). Please take care not to define two different  Storage
2380 resource directives in the Director that point to the  same Device in the
2381 Storage daemon. Doing so may cause the  Storage daemon to block (or hang)
2382 attempting to open the  same device that is already open. This directive is
2383 required. 
2384
2385 \item [Media Type = \lt{}MediaType\gt{}]
2386    \index[fd]{Media Type  }
2387    This directive specifies the  Media Type to be used to store the data. This is
2388 an arbitrary  string of characters up to 127 maximum that you define. It can 
2389 be anything you want. However, it is best to  make it descriptive of the
2390 storage media (e.g. File, DAT, ''HP  DLT8000``, 8mm, ...). In addition, it is
2391 essential that you  make the {\bf Media Type} specification unique for each
2392 storage  media type. If you have two DDS-4 drives that have incompatible 
2393 formats, or if you have a DDS-4 drive and a DDS-4 autochanger,  you almost
2394 certainly should specify different {\bf Media Types}.  During a restore,
2395 assuming a {\bf DDS-4} Media Type is associated  with the Job, Bacula can
2396 decide to use any Storage  daemon that support Media Type {\bf DDS-4} and on
2397 any drive  supports it. If you want to tie Bacula to using a single Storage 
2398 daemon or drive, you must specify a unique Media Type for that drive.  This is
2399 an important point that should be carefully understood. You  can find more on
2400 this subject in the 
2401 \ilink{Basic Volume Management}{_ChapterStart39} chapter of this
2402 manual.  
2403
2404 The {\bf MediaType} specified here, {\bf must}  correspond to the {\bf Media
2405 Type} specified in the {\bf Device}  resource of the {\bf Storage daemon}
2406 configuration file.  This directive is required, and it is used by the
2407 Director and the  Storage daemon to ensure that a Volume automatically
2408 selected from  the Pool corresponds to the physical device. If a Storage
2409 daemon  handles multiple devices (e.g. will write to various file Volumes  on
2410 different partitions), this directive allows you to specify exactly  which
2411 device.  
2412
2413 As mentioned above, the value specified in the Director's Storage  resource
2414 must agree with the value specified in the Device resource in  the {\bf
2415 Storage daemon's} configuration file. It is also an  additional check so  that
2416 you don't try to write data for a DLT onto an 8mm device. 
2417 \label{Autochanger1}
2418
2419 \item [Autochanger = \lt{}yes|no\gt{}  ]
2420    \index[fd]{Autochanger  }
2421    If you specify {\bf yes}  for this command (the default is {\bf no}), when you
2422 use the {\bf label}  command or the {\bf add} command to create a new Volume,
2423 {\bf Bacula}  will also request the Autochanger Slot number. This simplifies 
2424 creating database entries for Volumes in an autochanger. If you forget  to
2425 specify the Slot, the autochanger will not be used. However, you  may modify
2426 the Slot associated with a Volume at any time  by using the {\bf update
2427 volume} command in the console program.  When {\bf autochanger} is enabled,
2428 the algorithm used by  Bacula to search for available volumes will be modified
2429 to  consider only Volumes that are known to be in the autochanger's  magazine.
2430 If no {\bf in changer} volume is found, Bacula will  attempt recycling,
2431 pruning, ..., and if still no volume is found,  Bacula will search for any
2432 volume whether or not in the magazine.  By privileging in changer volumes,
2433 this procedure minimizes  operator intervention.  The default is {\bf no}.  
2434
2435 For the autochanger to be  used, you must also specify {\bf Autochanger = yes}
2436 in the  
2437 \ilink{Device Resource}{Autochanger}  in the Storage daemon's
2438 configuration file as well as other  important Storage daemon configuration
2439 information.  Please consult the 
2440 \ilink{ Using Autochangers}{_ChapterStart18} manual of this
2441 chapter for the details of  using autochangers. 
2442
2443 \item [Maximum Concurrent Jobs = \lt{}number\gt{}]
2444    \index[fd]{Maximum Concurrent Jobs  }
2445    where \lt{}number\gt{}  is the maximum number of Jobs with the current Storage
2446 resource that  can run concurrently. Note, this directive limits only Jobs 
2447 for Jobs using this Storage daemon. Any  other restrictions on the maximum
2448 concurrent jobs such as in  the Director, Job, or Client resources will also
2449 apply in addition to  any limit specified here. The  default is set to 1, but
2450 you may set it to a larger number.  We strongly recommend that you read the
2451 WARNING documented under  
2452 \ilink{ Maximum Concurrent Jobs}{DirMaxConJobs} in the Director's
2453 resource.  
2454
2455 While it is possible to set the Director's, Job's, or Client's  maximum
2456 concurrent jobs greater than one, you should take great  care in setting the
2457 Storage daemon's greater than one. By keeping  this directive set to one, you
2458 will avoid having two jobs simultaneously  write to the same Volume. Although
2459 this is supported, it is not  currently recommended.  
2460 \end{description}
2461
2462 The following is an example of a valid Storage resource definition: 
2463
2464 \footnotesize
2465 \begin{verbatim}
2466 # Definition of tape storage device
2467 Storage {
2468   Name = DLTDrive
2469   Address = lpmatou
2470   Password = storage_password # password for Storage daemon
2471   Device = "HP DLT 80"    # same as Device in Storage daemon
2472   Media Type = DLT8000    # same as MediaType in Storage daemon
2473 }
2474 \end{verbatim}
2475 \normalsize
2476
2477 \section*{The Pool Resource}
2478 \label{PoolResource}
2479 \index[general]{Resource!Pool }
2480 \index[general]{Pool Resource }
2481 \addcontentsline{toc}{section}{Pool Resource}
2482
2483 The Pool resource defines the set of storage Volumes (tapes or files) to be
2484 used by Bacula to write the data. By configuring different Pools, you can
2485 determine which set of Volumes (media) receives the backup data. This permits,
2486 for example, to store all full backup data on one set of Volumes and all
2487 incremental backups on another set of Volumes. Alternatively, you could assign
2488 a different set of Volumes to each machine that you backup. This is most
2489 easily done by defining multiple Pools. 
2490
2491 Another important aspect of a Pool is that it contains the default attributes
2492 (Maximum Jobs, Retention Period, Recycle flag, ...) that will be given to a
2493 Volume when it is created. This avoids the need for you to answer a large
2494 number of questions when labeling a new Volume. Each of these attributes can
2495 later be changed on a Volume by Volume basis using the {\bf update} command in
2496 the console program. Note that you must explicitly specify which Pool Bacula
2497 is to use with each Job. Bacula will not automatically search for the correct
2498 Pool. 
2499
2500 Most often in Bacula installations all backups for all machines (Clients) go
2501 to a single set of Volumes. In this case, you will probably only use the {\bf
2502 Default} Pool. If your backup strategy calls for you to mount a different tape
2503 each day, you will probably want to define a separate Pool for each day. For
2504 more information on this subject, please see the 
2505 \ilink{Backup Strategies}{_ChapterStart3} chapter of this
2506 manual. 
2507
2508 To use a Pool, there are three distinct steps. First the Pool must be defined
2509 in the Director's configuration file. Then the Pool must be written to the
2510 Catalog database. This is done automatically by the Director each time that it
2511 starts, or alternatively can be done using the {\bf create} command in the
2512 console program. Finally, if you change the Pool definition in the Director's
2513 configuration file and restart Bacula, the pool will be updated alternatively
2514 you can use the {\bf update pool} console command to refresh the database
2515 image. It is this database image rather than the Director's resource image
2516 that is used for the default Volume attributes. Note, for the pool to be
2517 automatically created or updated, it must be explicitly referenced by a Job
2518 resource. 
2519
2520 Next the physical media must be labeled. The labeling can either be done with
2521 the {\bf label} command in the {\bf console} program or using the {\bf btape}
2522 program. The preferred method is to use the {\bf label} command in the {\bf
2523 console} program. 
2524
2525 Finally, you must add Volume names (and their attributes) to the Pool. For
2526 Volumes to be used by Bacula they must be of the same {\bf Media Type} as the
2527 archive device specified for the job (i.e. if you are going to back up to a
2528 DLT device, the Pool must have DLT volumes defined since 8mm volumes cannot be
2529 mounted on a DLT drive). The {\bf Media Type} has particular importance if you
2530 are backing up to files. When running a Job, you must explicitly specify which
2531 Pool to use. Bacula will then automatically select the next Volume to use from
2532 the Pool, but it will ensure that the {\bf Media Type} of any Volume selected
2533 from the Pool is identical to that required by the Storage resource you have
2534 specified for the Job. 
2535
2536 If you use the {\bf label} command in the console program to label the
2537 Volumes, they will automatically be added to the Pool, so this last step is
2538 not normally required. 
2539
2540 It is also possible to add Volumes to the database without explicitly labeling
2541 the physical volume. This is done with the {\bf add} console command. 
2542
2543 As previously mentioned, each time Bacula starts, it scans all the Pools
2544 associated with each Catalog, and if the database record does not already
2545 exist, it will be created from the Pool Resource definition. {\bf Bacula}
2546 probably should do an {\bf update pool} if you change the Pool definition, but
2547 currently, you must do this manually using the {\bf update pool} command in
2548 the Console program. 
2549
2550 The Pool Resource defined in the Director's configuration file
2551 (bacula-dir.conf) may contain the following directives: 
2552
2553 \begin{description}
2554
2555 \item [Pool]
2556    \index[dir]{Pool }
2557    Start of the Pool resource. There must  be at least one Pool resource defined.
2558
2559
2560 \item [Name = \lt{}name\gt{}]
2561    \index[dir]{Name  }
2562    The name of the pool.  For most applications, you will use the default pool 
2563 name {\bf Default}. This directive is required.  
2564
2565 \item [Number of Volumes = \lt{}number\gt{}]
2566    \index[dir]{Number of Volumes  }
2567    This directive specifies  the number of volumes (tapes or files) contained in
2568 the pool.  Normally, it is defined and updated automatically by the  Bacula
2569 catalog handling routines. 
2570 \label{MaxVolumes}
2571
2572 \item [Maximum Volumes = \lt{}number\gt{}]
2573    \index[dir]{Maximum Volumes  }
2574    This directive specifies the  maximum number of volumes (tapes or files)
2575 contained in the pool.  This directive is optional, if omitted or set to zero,
2576 any number  of volumes will be permitted. In general, this directive is useful
2577 for Autochangers where there is a fixed number of Volumes, or  for File
2578 storage where you wish to ensure that the backups made to  disk files do not
2579 become too numerous or consume too much space.  
2580
2581 \item [Pool Type = \lt{}type\gt{}]
2582    \index[dir]{Pool Type  }
2583    This directive defines the pool  type, which corresponds to the type of Job
2584 being run. It is  required and may be one of the following:  
2585
2586 \begin{itemize}
2587 \item [Backup]  
2588 \item [*Archive]  
2589 \item [*Cloned]  
2590 \item [*Migration]  
2591 \item [*Copy]  
2592 \item [*Save]  
2593    \end{itemize}
2594
2595 \item [Use Volume Once = \lt{}yes|no\gt{}]
2596    \index[dir]{Use Volume Once  }
2597    This directive  if set to {\bf yes} specifies that each volume is to be  used
2598 only once. This is most useful when the Media is a  file and you want a new
2599 file for each backup that is  done. The default is {\bf no} (i.e. use volume
2600 any  number of times). This directive will most likely be phased out 
2601 (deprecated), so you are recommended to use {\bf Maximum Volume Jobs = 1} 
2602 instead.  
2603
2604 Please note that the value defined by this directive in the  bacula-dir.conf
2605 file is the default value used when a Volume  is created. Once the volume is
2606 created, changing the value  in the bacula-dir.conf file will not change what
2607 is stored  for the Volume. To change the value for an existing Volume  you
2608 must use the {\bf update} command in the Console.  
2609
2610 \item [Maximum Volume Jobs = \lt{}positive-integer\gt{}]
2611    \index[fd]{Maximum Volume Jobs  }
2612    This directive specifies  the maximum number of Jobs that can be written to
2613 the Volume. If  you specify zero (the default), there is no limit. Otherwise, 
2614 when the number of Jobs backed up to the Volume equals {\bf positive-integer} 
2615 the Volume will be marked {\bf Used}. When the Volume is marked  {\bf Used} it
2616 can no longer be used for appending Jobs, much like  the {\bf Full} status but
2617 it can be recycled if recycling is enabled.  By setting {\bf
2618 MaximumVolumeJobs} to one, you get the same  effect as setting {\bf
2619 UseVolumeOnce = yes}.  
2620
2621 Please note that the value defined by this directive in the  bacula-dir.conf
2622 file is the default value used when a Volume  is created. Once the volume is
2623 created, changing the value  in the bacula-dir.conf file will not change what
2624 is stored  for the Volume. To change the value for an existing Volume  you
2625 must use the {\bf update} command in the Console.  
2626
2627 \item [Maximum Volume Files = \lt{}positive-integer\gt{}]
2628    \index[fd]{Maximum Volume Files  }
2629    This directive specifies  the maximum number of files that can be written to
2630 the Volume. If  you specify zero (the default), there is no limit. Otherwise, 
2631 when the number of files written to the Volume equals {\bf positive-integer} 
2632 the Volume will be marked {\bf Used}. When the Volume is marked  {\bf Used} it
2633 can no longer be used for appending Jobs, much like  the {\bf Full} status but
2634 it can be recycled if recycling is enabled.  This value is checked and the
2635 {\bf Used} status is set only  at the end of a job that writes to the
2636 particular volume.  
2637
2638 Please note that the value defined by this directive in the  bacula-dir.conf
2639 file is the default value used when a Volume  is created. Once the volume is
2640 created, changing the value  in the bacula-dir.conf file will not change what
2641 is stored  for the Volume. To change the value for an existing Volume  you
2642 must use the {\bf update} command in the Console.  
2643
2644 \item [Maximum Volume Bytes = \lt{}size\gt{}]
2645    \index[fd]{Maximum Volume Bytes  }
2646    This directive specifies  the maximum number of bytes that can be written to
2647 the Volume. If  you specify zero (the default), there is no limit except the 
2648 physical size of the Volume. Otherwise,  when the number of bytes written to
2649 the Volume equals {\bf size}  the Volume will be marked {\bf Used}. When the
2650 Volume is marked  {\bf Used} it can no longer be used for appending Jobs, much
2651 like  the {\bf Full} status but it can be recycled if recycling is enabled. 
2652 This value is checked and the {\bf Used} status set while  the job is writing
2653 to the particular volume.  
2654
2655 Please note that the value defined by this directive in the  bacula-dir.conf
2656 file is the default value used when a Volume  is created. Once the volume is
2657 created, changing the value  in the bacula-dir.conf file will not change what
2658 is stored  for the Volume. To change the value for an existing Volume  you
2659 must use the {\bf update} command in the Console.  
2660
2661 \item [Volume Use Duration = \lt{}time-period-specification\gt{}]
2662    \index[fd]{Volume Use Duration  }
2663    The Volume Use Duration directive defines the time period that  the Volume can
2664 be written beginning from the time of first data  write to the Volume. If the
2665 time-period specified is zero (the  default), the Volume can be written
2666 indefinitely. Otherwise,  when the time period from the first write to the
2667 volume (the  first Job written) exceeds the time-period-specification, the 
2668 Volume will be marked {\bf Used}, which means that no more  Jobs can be
2669 appended to the Volume, but it may be recycled if  recycling is enabled.  
2670
2671 You might use this directive, for example, if you have a Volume  used for
2672 Incremental backups, and Volumes used for Weekly Full  backups. Once the Full
2673 backup is done, you will want to use a  different Incremental Volume. This can
2674 be accomplished by setting  the Volume Use Duration for the Incremental Volume
2675 to six days.  I.e. it will be used for the 6 days following a Full save, then 
2676 a different Incremental volume will be used.  
2677
2678 This value is checked and the {\bf Used} status is set only  at the end of a
2679 job that writes to the particular volume, which  means that even though the
2680 use duration may have expired, the  catalog entry will not be updated until
2681 the next job that  uses this volume is run.  
2682
2683 Please note that the value defined by this directive in the  bacula-dir.conf
2684 file is the default value used when a Volume  is created. Once the volume is
2685 created, changing the value  in the bacula-dir.conf file will not change what
2686 is stored  for the Volume. To change the value for an existing Volume  you
2687 must use the {\bf update} command in the Console.  
2688
2689 \item [Catalog Files = \lt{}yes|no\gt{}]
2690    \index[fd]{Catalog Files  }
2691    This directive  defines whether or not you want the names of the files  that
2692 were saved to be put into the catalog. The default  is {\bf yes}. The
2693 advantage of specifying {\bf Catalog Files = No}  is that you will have a
2694 significantly smaller Catalog database. The  disadvantage is that you will not
2695 be able to produce a Catalog listing  of the files backed up for each Job
2696 (this is often called Browsing).  Also, without the File entries in the
2697 catalog, you will not be  able to use the Console {\bf restore} command nor
2698 any other  command that references File entries.  
2699 \label{PoolAutoPrune}
2700
2701 \item [AutoPrune = \lt{}yes|no\gt{}]
2702    \index[fd]{AutoPrune  }
2703    If AutoPrune is set to  {\bf yes} (default), Bacula (version 1.20 or greater)
2704 will  automatically apply the Volume Retention period when new Volume  is
2705 needed and no appendable Volumes exist in the Pool. Volume  pruning causes
2706 expired Jobs (older than the {\bf Volume  Retention} period) to be deleted
2707 from the Catalog and permits  possible recycling of the Volume.  
2708 \label{VolRetention}
2709
2710 \item [Volume Retention = \lt{}time-period-specification\gt{}]
2711    \index[fd]{Volume Retention  }
2712    The  Volume Retention directive defines the length of time that {\bf Bacula} 
2713 will keep Job records associated with the Volume in the Catalog  database.
2714 When this time period expires, and if {\bf AutoPrune}  is set to {\bf yes}
2715 Bacula will prune (remove) Job  records that are older than the specified
2716 Volume Retention period.  All File records associated with pruned Jobs are
2717 also pruned.  The time may be specified as seconds,  minutes, hours, days,
2718 weeks, months, quarters, or years.  The {\bf Volume Retention} applied
2719 independently to the  {\bf Job Retention} and the {\bf File Retention} periods
2720 defined in the Client resource. This means that the shorter  period is the
2721 one that applies. Note, that when the  {\bf Volume Retention} period has been
2722 reached, it will  prune both the Job and the File records.  
2723
2724 The default is 365 days. Note, this directive sets the default  value for each
2725 Volume entry in the Catalog when the Volume is  created. The value in the 
2726 catalog may be later individually changed for each Volume using  the Console
2727 program.  
2728
2729 By defining multiple Pools with different Volume Retention periods,  you may
2730 effectively have a set of tapes that is recycled weekly,  another Pool of
2731 tapes that is recycled monthly and so on. However,  one must keep in mind that
2732 if your {\bf Volume Retention} period  is too short, it may prune the last
2733 valid Full backup, and hence  until the next Full backup is done, you will not
2734 have a complete  backup of your system, and in addition, the next Incremental 
2735 or Differential backup will be promoted to a Full backup. As  a consequence,
2736 the minimum {\bf Volume Retention} period should be at  twice the interval of
2737 your Full backups. This means that if you  do a Full backup once a month, the
2738 minimum Volume retention  period should be two months.  
2739
2740 Please note that the value defined by this directive in the  bacula-dir.conf
2741 file is the default value used when a Volume  is created. Once the volume is
2742 created, changing the value  in the bacula-dir.conf file will not change what
2743 is stored  for the Volume. To change the value for an existing Volume  you
2744 must use the {\bf update} command in the Console.  
2745 \label{PoolRecycle}
2746
2747 \item [Recycle = \lt{}yes|no\gt{}]
2748    \index[fd]{Recycle  }
2749    This directive specifies the  default for recycling Purged Volumes. If it is
2750 set to {\bf yes}  and Bacula needs a volume but finds none that are 
2751 appendable, it will search for Purged Volumes (i.e. volumes  with all the Jobs
2752 and Files expired and thus deleted from  the Catalog). If the Volume is
2753 recycled, all previous data  written to that Volume will be overwritten.  
2754
2755 Please note that the value defined by this directive in the  bacula-dir.conf
2756 file is the default value used when a Volume  is created. Once the volume is
2757 created, changing the value  in the bacula-dir.conf file will not change what
2758 is stored  for the Volume. To change the value for an existing Volume  you
2759 must use the {\bf update} command in the Console.  
2760 \label{RecycleOldest}
2761
2762 \item [Recycle Oldest Volume = \lt{}yes|no\gt{}]
2763    \index[fd]{Recycle Oldest Volume  }
2764    This directive  instructs the Director to search for the oldest used  Volume
2765 in the Pool when another Volume is requested by  the Storage daemon and none
2766 are available.  The catalog is then {\bf pruned} respecting the retention 
2767 periods of all Files and Jobs written to this Volume.  If all Jobs are pruned
2768 (i.e. the volume is Purged), then  the Volume is recycled and will be used as
2769 the next  Volume to be written. This directive respects any Job,  File, or
2770 Volume retention periods that you may have specified,  and as such it is {\bf
2771 much} better to use this directive  than the Purge Oldest Volume.  
2772
2773 This directive can be useful if you have  a fixed number of Volumes in the
2774 Pool and you want to  cycle through them and you have specified the correct 
2775 retention periods.  
2776 \label{RecycleCurrent}
2777
2778 \item [Recycle Current Volume = \lt{}yes|no\gt{}]
2779    \index[fd]{Recycle Current Volume  }
2780    If  Bacula needs a new Volume, this directive instructs Bacula  to Prune the
2781 volume respecting the Job and File  retention periods.  If all Jobs are pruned
2782 (i.e. the volume is Purged), then  the Volume is recycled and will be used as
2783 the next  Volume to be written. This directive respects any Job,  File, or
2784 Volume retention periods that you may have specified,  and thus it is {\bf
2785 much} better to use it rather  than the Purge Oldest Volume directive.  
2786
2787 This directive can be useful if you have:  a fixed number of Volumes in the
2788 Pool, you want to  cycle through them, and you have specified  retention
2789 periods that prune Volumes before  you have cycled through the Volume in the
2790 Pool.  
2791 \label{PurgeOldest}
2792
2793 \item [Purge Oldest Volume = \lt{}yes|no\gt{}]
2794    \index[fd]{Purge Oldest Volume  }
2795    This directive  instructs the Director to search for the oldest used  Volume
2796 in the Pool when another Volume is requested by  the Storage daemon and none
2797 are available.  The catalog is then {\bf purged} irrespective of retention 
2798 periods of all Files and Jobs written to this Volume.  The Volume is then
2799 recycled and will be used as the next  Volume to be written. This directive
2800 overrides any Job,  File, or Volume retention periods that you may have
2801 specified.  
2802
2803 This directive can be useful if you have  a fixed number of Volumes in the
2804 Pool and you want to  cycle through them and when all Volumes are full, but
2805 you don't  want to worry about setting proper retention periods. However,  by
2806 using this option you risk losing valuable data.  
2807
2808 {\bf Please be aware that {\bf Purge Oldest Volume} disregards  all retention
2809 periods.} If you have only a single Volume  defined and you turn this variable
2810 on, that Volume will always  be immediately overwritten when it fills! So at a
2811 minimum,  ensure that you have a decent number of Volumes in your Pool  before
2812 running any jobs. If you want retention periods to apply  do not use this
2813 directive. To specify a retention period,  use the {\bf Volume Retention}
2814 directive (see above).  
2815
2816 I highly recommend against using this directive, because it is  sure that some
2817 day, Bacula will recycle a Volume that contains  current data. 
2818
2819 \item [Accept Any Volume = \lt{}yes|no\gt{}]
2820    \index[fd]{Accept Any Volume  }
2821    This directive  specifies whether or not any volume from the Pool may  be used
2822 for backup. The default is {\bf yes} as of version  1.27 and later. If it is
2823 {\bf no} then only the first  writable volume in the Pool will be accepted for
2824 writing backup  data, thus Bacula will fill each Volume sequentially  in turn
2825 before using any other appendable volume in the  Pool. If this is {\bf no} and
2826 you mount a volume out  of order, Bacula will not accept it. If this  is {\bf
2827 yes} any appendable volume from the pool  mounted will be accepted.  
2828
2829 If your tape backup procedure dictates that you manually  mount the next
2830 volume, you will almost certainly want to be  sure this directive is turned
2831 on.  
2832
2833 If you are going on vacation and you think the current volume  may not have
2834 enough room on it, you can simply label a new tape  and leave it in the drive,
2835 and assuming that {\bf Accept Any Volume}  is {\bf yes} Bacula will begin
2836 writing on it. When you return  from vacation, simply remount the last tape,
2837 and Bacula will  continue writing on it until it is full. Then you can remount
2838  your vacation tape and Bacula will fill it in turn.  
2839
2840 \item [Cleaning Prefix = \lt{}string\gt{}]
2841    \index[fd]{Cleaning Prefix  }
2842    This directive defines  a prefix string, which if it matches the beginning of 
2843 a Volume name during labeling of a Volume, the Volume  will be defined with
2844 the VolStatus set to {\bf Cleaning} and  thus Bacula will never attempt to use
2845 this tape. This  is primarily for use with autochangers that accept barcodes 
2846 where the convention is that barcodes beginning with {\bf CLN}  are treated as
2847 cleaning tapes.  
2848 \label{Label}
2849
2850 \item [Label Format = \lt{}format\gt{}]
2851    \index[fd]{Label Format  }
2852    This directive specifies the  format of the labels contained in this pool. The
2853 format directive  is used as a sort of template to create new Volume names
2854 during  automatic Volume labeling.  
2855
2856 The {\bf format} should be specified in double quotes, and  consists of
2857 letters, numbers and the special characters  hyphen ({\bf -}), underscore
2858 ({\bf \_}), colon ({\bf :}), and  period ({\bf .}), which are the legal
2859 characters for a Volume  name. The {\bf format} should be enclosed in  double
2860 quotes ('').  
2861
2862 In addition, the format may contain a number of variable expansion  characters
2863 which will be expanded by a complex algorithm allowing  you to create Volume
2864 names of many different formats. In all  cases, the expansion process must
2865 resolve to the set of characters  noted above that are legal Volume names.
2866 Generally, these  variable expansion characters begin with a dollar sign ({\bf
2867 \$})  or a left bracket ({\bf [}). If you specify variable expansion 
2868 characters, you should always enclose the format with double  quote characters
2869 ({\bf ``}). For more details on variable expansion,  please see the 
2870 \ilink{Variable Expansion}{_ChapterStart50} Chapter of  this manual.  
2871
2872 If no variable expansion characters are found in the string,  the Volume name
2873 will be formed from the {\bf format} string  appended with the number of
2874 volumes in the pool plus one, which  will be edited as four digits with
2875 leading zeros. For example,  with a {\bf Label Format = ''File-``}, the first
2876 volumes will be  named {\bf File-0001}, {\bf File-0002}, ...  
2877
2878 With the exception of Job specific variables, you can test  your {\bf
2879 LabelFormat} by using the 
2880 \ilink{ var command}{var} the Console Chapter of this manual.  
2881
2882 In almost all cases, you should enclose the format specification  (part after
2883 the equal sign) in double quotes.  
2884 \end{description}
2885
2886 In order for a Pool to be used during a Backup Job, the Pool must have at
2887 least one Volume associated with it. Volumes are created for a Pool using the
2888 {\bf label} or the {\bf add} commands in the {\bf Bacula Console}, program. In
2889 addition to adding Volumes to the Pool (i.e. putting the Volume names in the
2890 Catalog database), the physical Volume must be labeled with valid Bacula
2891 software volume label before {\bf Bacula} will accept the Volume. This will be
2892 automatically done if you use the {\bf label} command. Bacula can
2893 automatically label Volumes if instructed to do so, but this feature is not
2894 yet fully implemented. 
2895
2896 The following is an example of a valid Pool resource definition: 
2897
2898 \footnotesize
2899 \begin{verbatim}
2900  
2901 Pool {
2902   Name = Default
2903   Pool Type = Backup
2904 }
2905 \end{verbatim}
2906 \normalsize
2907
2908 \section*{The Catalog Resource}
2909 \label{CatalogResource}
2910 \index[general]{Resource!Catalog }
2911 \index[general]{Catalog Resource }
2912 \addcontentsline{toc}{section}{Catalog Resource}
2913
2914 The Catalog Resource defines what catalog to use for the current job.
2915 Currently, Bacula can only handle a single database server (SQLite, MySQL,
2916 built-in) that is defined when configuring {\bf Bacula}. However, there may be
2917 as many Catalogs (databases) defined as you wish. For example, you may want
2918 each Client to have its own Catalog database, or you may want backup jobs to
2919 use one database and verify or restore jobs to use another database. 
2920
2921 \begin{description}
2922
2923 \item [Catalog]
2924    \index[console]{Catalog }
2925    Start of the Catalog resource.  At least one Catalog resource must be defined.
2926
2927
2928 \item [Name = \lt{}name\gt{}]
2929    \index[console]{Name  }
2930    The name of the Catalog. No  necessary relation to the database server name.
2931 This name  will be specified in the Client resource directive indicating  that
2932 all catalog data for that Client is maintained in this  Catalog. This
2933 directive is required.  
2934
2935 \item [password = \lt{}password\gt{}]
2936    \index[console]{password  }
2937    This specifies the password  to use when logging into the database. This
2938 directive is required.  
2939
2940 \item [DB Name = \lt{}name\gt{}]
2941    \index[console]{DB Name  }
2942    This specifies the name of the  database. If you use multiple catalogs
2943 (databases), you specify  which one here. If you are using an external
2944 database server  rather than the internal one, you must specify a name that 
2945 is known to the server (i.e. you explicitly created the  Bacula tables using
2946 this name. This directive is  required. 
2947
2948 \item [user = \lt{}user\gt{}]
2949    \index[console]{user  }
2950    This specifies what user name  to use to log into the database. This directive
2951 is required.  
2952
2953 \item [DB Socket = \lt{}socket-name\gt{}]
2954    \index[console]{DB Socket  }
2955    This is the name of  a socket to use on the local host to connect to the
2956 database.  This directive is used only by MySQL and is ignored by  SQLite.
2957 Normally, if neither {\bf DB Socket} or {\bf DB Address}  are specified, MySQL
2958 will use the default socket.  
2959
2960 \item [DB Address = \lt{}address\gt{}]
2961    \index[console]{DB Address  }
2962    This is the host address  of the database server. Normally, you would specify
2963 this instead  of {\bf DB Socket} if the database server is on another machine.
2964 In that case, you will also specify {\bf DB Port}. This directive  is used
2965 only by MySQL and is ignored by SQLite if provided.  This directive is
2966 optional.  
2967
2968 \item [DB Port = \lt{}port\gt{}]
2969    \index[console]{DB Port  }
2970    This defines the port to  be used in conjunction with {\bf DB Address} to
2971 access the  database if it is on another machine. This directive is used  only
2972 by MySQL and is ignored by SQLite if provided. This  directive is optional.  
2973
2974 \item [Multiple Connections = \lt{}yes|no\gt{}]
2975    \index[console]{Multiple Connections  }
2976    By default, this  directive is set to no. In that case, each job that uses the
2977 same Catalog will use a single connection to the catalog. It will  be shared,
2978 and Bacula will allow only one Job at a time to  communicate. If you set this
2979 directive to yes, Bacula will  permit multiple connections to the database,
2980 and the database  must be multi-thread capable. For SQLite and PostgreSQL,
2981 this is  no problem. For MySQL, you must be *very* careful to have the 
2982 multi-thread version of the client library loaded on your system.  When this
2983 directive is set yes, each Job will have a separate  connection to the
2984 database, and the database will control the  interaction between the different
2985 Jobs. This can significantly  speed up the database operations if you are
2986 running multiple  simultaneous jobs. In addition, for SQLite and PostgreSQL,
2987 Bacula  will automatically enable transactions. This can significantly  speed
2988 up insertion of attributes in the database either for  a single Job or
2989 multiple simultaneous Jobs.  
2990
2991 This directive has not been tested. Please test carefully  before running it
2992 in production and report back your results.  
2993 \end{description}
2994
2995 The following is an example of a valid Catalog resource definition: 
2996
2997 \footnotesize
2998 \begin{verbatim}
2999 Catalog
3000 {
3001   Name = SQLite
3002   dbname = bacula;
3003   user = bacula;
3004   password = ""                       # no password = no security
3005 }
3006 \end{verbatim}
3007 \normalsize
3008
3009 or for a Catalog on another machine: 
3010
3011 \footnotesize
3012 \begin{verbatim}
3013 Catalog
3014 {
3015   Name = MySQL
3016   dbname = bacula
3017   user = bacula
3018   password = ""
3019   DB Address = remote.acme.com
3020   DB Port = 1234
3021 }
3022 \end{verbatim}
3023 \normalsize
3024
3025 \section*{The Messages Resource}
3026 \label{MessagesResource2}
3027 \index[general]{Resource!Messages }
3028 \index[general]{Messages Resource }
3029 \addcontentsline{toc}{section}{Messages Resource}
3030
3031 For the details of the Messages Resource, please see the 
3032 \ilink{Messages Resource Chapter}{_ChapterStart15} of this
3033 manual. 
3034
3035 \section*{The Console Resource}
3036 \label{ConsoleResource1}
3037 \index[general]{Console Resource }
3038 \index[general]{Resource!Console }
3039 \addcontentsline{toc}{section}{Console Resource}
3040
3041 As of Bacula version 1.33 and higher, there are three different kinds of
3042 consoles, which the administrator or user can use to interact with the
3043 Director. These three kinds of consoles comprise three different security
3044 levels. 
3045
3046 \begin{itemize}
3047 \item The first console type is an {\bf anonymous} or {\bf default}  console,
3048    which  has full privileges. There is no console resource necessary  for this
3049    type since the password is specified in the Director's  resource and
3050 consequently such consoles do not have an  name as defined on a {\bf Name =}
3051 directive. This is the kind of  console that was initially implemented in
3052 versions prior to 1.33  and remains valid. Typically you would use it only for
3053  administrators.  
3054 \item The second type of console, and new to version 1.33 and  higher is a
3055    ''named`` console defined within  a Console resource in both the Director's
3056    configuration file and in  the Console's configuration file. Both the names
3057 and the passwords  in these two entries must match much as is the case for 
3058 Client programs.  
3059
3060 This second type of console begins with absolutely no  privileges except those
3061 explicitly specified in the Director's  Console resource. Thus you can have
3062 multiple Consoles with  different names and passwords, sort of like multiple
3063 users, each  with different privileges. As a  default, these consoles can do
3064 absolutely nothing -- no commands  what so ever. You give them privileges or
3065 rather access  to commands and resources by specifying access  control lists
3066 in the Director's Console resource. The ACLs are  specified by a directive
3067 followed by a list of access names.  Examples of this are shown below.  
3068 \item The third type of console is similar to the above mentioned  one in that
3069    it requires a Console resource definition in both  the Director and the
3070    Console. In addition, if the console name,  provided on the {\bf Name =}
3071 directive, is the same as a Client  name, that console is permitted to use the
3072 {\bf SetIP}  command to change the Address directive in the  Director's client
3073 resource to the IP address of the Console. This  permits portables or other
3074 machines using DHCP (non-fixed IP addresses)  to ''notify`` the Director of
3075 their current IP address.  
3076 \end{itemize}
3077
3078 The Console resource is optional and need not be specified. The following
3079 directives are permited within the Director's configuration resource: 
3080
3081 \begin{description}
3082
3083 \item [Name = \lt{}name\gt{}]
3084    \index[console]{Name  }
3085    The name of the console. This  name must match the name specified in the
3086 Console's configuration  resource (much as is the case with Client
3087 definitions).  
3088
3089 \item [Password = \lt{}password\gt{}]
3090    \index[console]{Password  }
3091    Specifies the password that  must be supplied for a named Bacula Console to be
3092 authorized. The same  password must appear in the {\bf Console} resource of
3093 the Console  configuration file. For added security, the password is never 
3094 actually passed across the network but rather a challenge response  hash code
3095 created with the password. This directive is required.  If you have either
3096 {\bf /dev/random}  {\bf bc} on your machine, Bacula will generate a random 
3097 password during the configuration process, otherwise it will  be left blank. 
3098
3099 \item [JobACL = \lt{}name-list\gt{}]
3100    \index[console]{JobACL  }
3101    This directive is used to  specify a list of Job resource names that can be
3102 accessed by  the console. Without this directive, the console cannot access 
3103 any of the Director's Job resources. Multiple Job resource names  may be
3104 specified by separating them with commas, and/or by specifying  multiple
3105 JobACL directives. For example, the directive  may be specified as:  
3106
3107 \footnotesize
3108 \begin{verbatim}
3109     JobACL = kernsave, "Backup client 1", "Backup client 2"
3110     JobACL = "RestoreFiles"
3111     
3112 \end{verbatim}
3113 \normalsize
3114
3115 With the above specification, the console can access the Director's  resources
3116 for the four jobs named on the JobACL directives,  but for no others.  
3117
3118 \item [ClientACL = \lt{}name-list\gt{}]
3119    \index[console]{ClientACL  }
3120    This directive is used to  specify a list of Client resource names that can be
3121 accessed by  the console.  
3122
3123 \item [StorageACL = \lt{}name-list\gt{}]
3124    \index[console]{StorageACL  }
3125    This directive is used to  specify a list of Storage resource names that can
3126 be accessed by  the console.  
3127
3128 \item [ScheduleACL = \lt{}name-list\gt{}]
3129    \index[console]{ScheduleACL  }
3130    This directive is used to  specify a list of Schedule resource names that can
3131 be accessed by  the console.  
3132
3133 \item [PoolACL = \lt{}name-list\gt{}]
3134    \index[console]{PoolACL  }
3135    This directive is used to  specify a list of Pool resource names that can be
3136 accessed by  the console.  
3137
3138 \item [FileSetACL = \lt{}name-list\gt{}]
3139    \index[console]{FileSetACL  }
3140    This directive is used to  specify a list of FileSet resource names that can
3141 be accessed by  the console.  
3142
3143 \item [CatalogACL = \lt{}name-list\gt{}]
3144    \index[console]{CatalogACL  }
3145    This directive is used to  specify a list of Catalog resource names that can
3146 be accessed by  the console.  
3147
3148 \item [CommandACL = \lt{}name-list\gt{}]
3149    \index[console]{CommandACL  }
3150    This directive is used to  specify a list of of console commands that can be
3151 executed by  the console. 
3152 \end{description}
3153
3154 Aside from Director resource names and console command names, the special
3155 keyword {\bf *all*} can be specified in any of the above access control lists.
3156 When this keyword is present, any resource or command name (which ever is
3157 appropriate) will be accepted. For an example configuration file, please see
3158 the 
3159 \ilink{Console Configuration}{_ChapterStart36} chapter of this
3160 manual. 
3161
3162 \section*{The Counter Resource}
3163 \label{CounterResource}
3164 \index[general]{Resource!Counter }
3165 \index[general]{Counter Resource }
3166 \addcontentsline{toc}{section}{Counter Resource}
3167
3168 The Counter Resource defines a counter variable that can be accessed by
3169 variable expansion used for creating Volume labels with the {\bf LabelFormat}
3170 directive. See the 
3171 \ilink{LabelFormat}{Label} directive in this chapter for more
3172 details. 
3173
3174 \begin{description}
3175
3176 \item [Counter]
3177    \index[console]{Counter }
3178    Start of the Counter resource.  Counter directives are optional. 
3179
3180 \item [Name = \lt{}name\gt{}]
3181    \index[console]{Name  }
3182    The name of the Counter.  This is the name you will use in the variable
3183 expansion  to reference the counter value.  
3184
3185 \item [Minimum = \lt{}integer\gt{}]
3186    \index[console]{Minimum  }
3187    This specifies the minimum  value that the counter can have. It also becomes
3188 the default.  If not supplied, zero is assumed.  
3189
3190 \item [Maximum = \lt{}integer\gt{}]
3191    \index[console]{Maximum  }
3192    This is the maximum value  value that the counter can have. If not specified
3193 or set to  zero, the counter can have a maximum value of 2,147,483,648  (2 to
3194 the 31 power). When the counter is incremented past  this value, it is reset
3195 to the Minimum.  
3196
3197 \item [*WrapCounter = \lt{}counter-name\gt{}]
3198    \index[console]{*WrapCounter  }
3199    If this value  is specified, when the counter is incremented past the maximum 
3200 and thus reset to the minimum, the counter specified on the  {\bf WrapCounter}
3201 is incremented. (This is not currently  implemented). 
3202
3203 \item [Catalog = \lt{}catalog-name\gt{}]
3204    \index[console]{Catalog  }
3205    If this directive is  specified, the counter and its values will be saved in 
3206 the specified catalog. If this directive is not present, the  counter will be
3207 redefined each time that Bacula is started. 
3208 \end{description}
3209
3210 \section*{ A Complete Example Director Configuration File}
3211 \label{SampleDirectorConfiguration}
3212 \index[general]{File!Complete Example Director Configuration }
3213 \index[general]{Complete Example Director Configuration File }
3214 \addcontentsline{toc}{section}{Complete Example Director Configuration File}
3215
3216 An example Director configuration file might be the following: 
3217
3218 \footnotesize
3219 \begin{verbatim}
3220 #
3221 # Default Bacula Director Configuration file
3222 #
3223 #  The only thing that MUST be changed is to add one or more
3224 #   file or directory names in the Include directive of the
3225 #   FileSet resource.
3226 #
3227 #  For Bacula release 1.15 (5 March 2002) -- redhat
3228 #
3229 #  You might also want to change the default email address
3230 #   from root to your address.  See the "mail" and "operator"
3231 #   directives in the Messages resource.
3232 #
3233 Director {                            # define myself
3234   Name = rufus-dir
3235   QueryFile = "/home/kern/bacula/bin/query.sql"
3236   WorkingDirectory = "/home/kern/bacula/bin/working"
3237   PidDirectory = "/home/kern/bacula/bin/working"
3238   Password = "XkSfzu/Cf/wX4L8Zh4G4/yhCbpLcz3YVdmVoQvU3EyF/"
3239 }
3240 # Define the backup Job
3241 Job {
3242   Name = "NightlySave"
3243   Type = Backup
3244   Level = Incremental                 # default
3245   Client=rufus-fd
3246   FileSet="Full Set"
3247   Schedule = "WeeklyCycle"
3248   Storage = DLTDrive
3249   Messages = Standard
3250   Pool = Default
3251 }
3252 Job {
3253   Name = "Restore"
3254   Type = Restore
3255   Client=rufus-fd
3256   FileSet="Full Set"
3257   Where = /tmp/bacula-restores
3258   Storage = DLTDrive
3259   Messages = Standard
3260   Pool = Default
3261 }
3262    
3263 # List of files to be backed up
3264 FileSet {
3265   Name = "Full Set"
3266   Include {
3267     Options { signature=SHA1 }
3268 #
3269 #  Put your list of files here, one per line or include an
3270 #    external list with:
3271 #
3272 #    @file-name
3273 #
3274 #  Note: / backs up everything
3275   File = /
3276   }
3277   Exclude { }
3278 }
3279 # When to do the backups
3280 Schedule {
3281   Name = "WeeklyCycle"
3282   Run = Full sun at 1:05
3283   Run = Incremental mon-sat at 1:05
3284 }
3285 # Client (File Services) to backup
3286 Client {
3287   Name = rufus-fd
3288   Address = rufus
3289   Catalog = MyCatalog
3290   Password = "MQk6lVinz4GG2hdIZk1dsKE/LxMZGo6znMHiD7t7vzF+"
3291   File Retention = 60d      # sixty day file retention
3292   Job Retention = 1y        # 1 year Job retention
3293   AutoPrune = yes           # Auto apply retention periods
3294 }
3295 # Definition of DLT tape storage device
3296 Storage {
3297   Name = DLTDrive
3298   Address = rufus
3299   Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
3300   Device = "HP DLT 80"      # same as Device in Storage daemon
3301   Media Type = DLT8000      # same as MediaType in Storage daemon
3302 }
3303 # Definition of DDS tape storage device
3304 Storage {
3305   Name = SDT-10000
3306   Address = rufus
3307   Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
3308   Device = SDT-10000        # same as Device in Storage daemon
3309   Media Type = DDS-4        # same as MediaType in Storage daemon
3310 }
3311 # Definition of 8mm tape storage device
3312 Storage {
3313   Name = "8mmDrive"
3314   Address = rufus
3315   Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
3316   Device = "Exabyte 8mm"
3317   MediaType = "8mm"
3318 }
3319 # Definition of file storage device
3320 Storage {
3321   Name = File
3322   Address = rufus
3323   Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
3324   Device = FileStorage
3325   Media Type = File
3326 }
3327 # Generic catalog service
3328 Catalog {
3329   Name = MyCatalog
3330   dbname = bacula; user = bacula; password = ""
3331 }
3332 # Reasonable message delivery -- send most everything to
3333 #   the email address and to the console
3334 Messages {
3335   Name = Standard
3336   mail = root@localhost = all, !skipped, !terminate
3337   operator = root@localhost = mount
3338   console = all, !skipped, !saved
3339 }
3340     
3341 # Default pool definition
3342 Pool {
3343   Name = Default
3344   Pool Type = Backup
3345   AutoPrune = yes
3346   Recycle = yes
3347 }
3348 #
3349 # Restricted console used by tray-monitor to get the status of the director
3350 #
3351 Console {
3352   Name = Monitor
3353   Password = "GN0uRo7PTUmlMbqrJ2Gr1p0fk0HQJTxwnFyE4WSST3MWZseR"
3354   CommandACL = status, .status
3355 }
3356 \end{verbatim}
3357 \normalsize