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