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}
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.
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
17 \ilink{Configuration}{_ChapterStart16} de ce manuel.
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}
24 Les types de ressources du Director sont :
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) :
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.
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.
43 \ilink{JobDefs}{JobDefsResource} -- Ressource optionnelle pour
44 fournir des valeurs par d\'efaut pour les ressources Job.
46 \ilink{Schedule}{ScheduleResource} -- Pour d\'efinir le moment
47 o\`u un Job doit \^etre lanc\'e automatiquement par le {\it scheduler}
50 \ilink{FileSet}{FileSetResource} -- Pour d\'efinir l'ensemble des
51 fichiers \`a sauvegarder pour chaque client.
53 \ilink{Client}{ClientResource2} -- Pour d\'efinir quel Client est
56 \ilink{Storage}{StorageResource2} -- Pour d\'efinir sur quel
57 p\'eriph\'erique physique les volumes seront mont\'es.
59 \ilink{Pool}{PoolResource} -- Pour d\'efinir quel pool de volumes
60 peut \^etre utilis\'e pour un Job donn\'e
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.
66 \ilink{Messages}{_ChapterStart15} -- Pour d\'efinir les
67 destinataires (ou les fichiers de logs) des messages d'erreur et
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}
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.
85 \index[dir]{Director }
86 D\'ebut de la ressource Director. Une ressource Director et une seule doit
89 \ item [Name = \lt{}nom\gt{}]
91 Le nom du Director utilis\'e par l'administrateur syst\`eme. Cette directive
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.
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
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.
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
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.
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.
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.
151 \label{DirMaxConJobs}
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
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.
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
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.
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.
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.
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 :
198 DirAddresses = { ip = {
199 addr = 1.2.3.4; port = 1205; }
201 addr = 1.2.3.4; port = http; }
214 addr = 201:220:222::2
217 addr = bluedot.thun.net
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.
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
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.
253 Voici un exemple d'une ressource Director valide :
259 WorkingDirectory = "$HOME/bacula/bin/working"
260 Password = UA_password
261 PidDirectory = "$HOME/bacula/bin/working"
262 QueryFile = "$HOME/bacula/bin/query.sql"
268 \section*{La ressource Job}
270 \index[general]{Resource!Job }
271 \index[general]{Job Resource }
272 \addcontentsline{toc}{section}{Job Resource}
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).
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.
289 \index[console]{Job }
290 D\'ebut de la ressource Job. Il faut d\'efinir au moins une ressource Job.
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.
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.
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.
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.
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
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
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.
347 \item {\bf Level = \lt{}job-level\gt{}}
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}.
356 Pour un job de type {\bf Backup} le niveau doit \^etre l'un des suivants :
362 Tous les fichiers du FileSet, qu'ils aient \'et\'e modifi\'es ou non.
365 \index[fd]{Incremental }
366 Tous les fichiers modifi\'es depuis la derni\`ere sauvegarde valide du FileSet
367 sp\'ecifi\'e. Si le Director ne peut trouver une sauvegarde Full ant\'erieure,
368 le niveau du job sera \'elev\'e en une sauvegarde Full. Lorsque le Director
369 recherche une Full valide dans le catalogue, il recherche un job avec
370 les caract\'eristiques suivantes :
373 \item le m\^eme nom de job ;
374 \item le m\^eme nom de client ;
375 \item le m\^eme FileSet (toute modification de la d\'efinition du FileSet telle
376 que l'ajout ou la suppression de fichiers dans les sections Include ou
377 Exclude constitue un changement de FileSet).
378 \item le niveau requis (Full, Differential ou Incremental)
379 \item le job s'est termin\'e normalement, c'est \`a dire un qu'il ne s'est pas termin\'e
380 en \'echec, et n'a pas \'et\'e effac\'e.
383 Si toutes les conditions ci-dessus ne sont pas r\'ealis\'ees, le Director
384 augmentera la sauvegarde incr\'ementale en une sauvegarde Full. Dans le cas
385 contraire, la sauvegarde incr\'ementale sera effectu\'ee normalement.
387 Le File Daemon (Client) d\'etermine les fichiers \`a sauvegarder pour une
388 incr\'ementale par comparaison de l'heure de d\'emarrage du Job pr\'ec\'edent
389 (Full, Diff\'erentiel ou Incr\'emental) avec les dates de derni\`ere modification
390 de chaque fichier (st\_mtime) et de ses attributs (st\_ctime). Si le fichier
391 ou ses attributs ont chang\'es depuis cette date de d\'emarrage, alors le fichier
394 Veuillez noter que certains logiciels anti-virus peuvent modifier la date
395 st\_time lors de leurs op\'erations de scan. Ainsi, si l'antivirus modifie
396 la date d'acc\`es (st\_atime), qui n'est pas utilis\'ee par Bacula, il
397 provoquera une modification du st\_ctime et conduira Bacula \`a sauvegarder
398 les fichiers concern\'es lors des incr\'ementales et diff\'erentielles. Dans le
399 cas de l'antivirus Sophos, vous pouvez \'eviter cet inconv\'enient en utilisant
400 l'option {\bf \verb{--{no-reset-atime}. Pour les autres logiciels, voyez
403 Lorsque Bacula effectue une sauvegarde incr\'ementale, tous les fichiers modifi\'es
404 pr\'esents sur le syst\`eme sont sauvegard\'es. Cependant, tout fichier supprim\'e depuis
405 la derni\`ere Full demeure dans le catalogue, ce qui signifie que si vous effectuez
406 une restauration \`a partir de sauvegardes incr\'ementales (et de la Full associ\'ee),
407 les fichiers supprim\'es depuis la derni\`ere Full seront aussi restaur\'es. Ces fichiers
408 n'apparaîtront plus dans le catalogue apr\`es avoir fait une nouvelle sauvegarde
409 Full. Le processus pour supprimer ces fichiers du catalogue lors d'une
410 incr\'ementale ralentirait fortement les sauvegardes incr\'ementales. Il n'est
411 actuellement pas impl\'ement\'e dans Bacula.
414 \index[fd]{Differential }
415 Tous les fichiers modifi\'es depuis la derni\`ere sauvegarde Full valide du FileSet
416 sp\'ecifi\'e. Si le Director ne peut trouver une sauvegarde Full ant\'erieure,
417 le niveau du job sera \'elev\'e en une sauvegarde Full. Lorsque le Director
418 recherche une Full valide dans le catalogue, il recherche un job avec
419 les caract\'eristiques suivantes :
422 \item le m\^eme nom de job ;
423 \item le m\^eme nom de client ;
424 \item le m\^eme FileSet (toute modification de la d\'efinition du FileSet telle
425 que l'ajout ou la suppression de fichiers dans les sections Include ou
426 Exclude constitue un changement de FileSet).
427 \item le Job \'etait une sauvegarde FULL
428 \item le Job s'est termin\'e normalement, c'est \`a dire qu'il ne s'est pas termin\'e
429 en \'echec, et n'a pas \'et\'e effac\'e.
432 Si toutes les conditions ci-dessus ne sont pas r\'ealis\'ees, le Director
433 augmentera la sauvegarde diff\'erentielle en une sauvegarde Full. Dans le cas
434 contraire, la sauvegarde diff\'erentielle sera effectu\'ee normalement.
436 Le File Daemon (Client) d\'etermine les fichiers \`a sauvegarder pour une
437 diff\'erentielle par comparaison de l'heure de d\'emarrage de la derni\`ere
438 sauvegarde Full avec les dates de derni\`ere modification
439 de chaque fichier (st\_mtime) et de ses attributs (st\_ctime). Si le fichier
440 ou ses attributs ont chang\'es depuis cette date de d\'emarrage, alors le fichier
441 sera sauvegard\'e. La date de d\'emarrage utilis\'ee est affich\'e apr\`es le {\bf Since}
442 du rapport de Job. Dans de rares cas, certains fichiers sont sauvegard\'es deux fois
443 \`a cause de l'utilisation de la date de d\'emarrage de la sauvegarde pr\'ec\'edente,
444 mais ceci assure qu'aucun changement n'est perdu. Comme pour les incr\'ementales,
445 vous devriez vous assurer que les horloges de votre serveur Bacula et de vos clients
446 sont synchronis\'ees, ou aussi proches que possible, pour \'eviter le risque d'omission
447 d'un fichier. Notez qu'\`a partir de la version 1.33, Bacula effectue automatiquement
448 ces ajustements de sorte que les horloges utilis\'ees par Bacula soient synchrones.
450 Veuillez noter que certains logiciels anti-virus peuvent modifier la date
451 st\_time lors de leurs op\'erations de scan. Ainsi, si l'antivirus modifie
452 la date d'acc\`es (st\_atime), qui n'est pas utilis\'ee par Bacula, il
453 provoquera une modification du st\_ctime et conduira Bacula \`a sauvegarder
454 les fichiers concern\'es lors des incr\'ementales et diff\'erentielles. Dans le
455 cas de l'antivirus Sophos, vous pouvez \'eviter cet inconv\'enient en utilisant
456 l'option {\bf \verb{--{no-reset-atime}. Pour les autres logiciels, voyez
459 Lorsque Bacula effectue une sauvegarde diff\'erentielle, tous les fichiers modifi\'es
460 pr\'esents sur le syst\`eme sont sauvegard\'es. Cependant, tout fichier supprim\'e depuis
461 la derni\`ere Full demeure dans le catalogue, ce qui signifie que si vous effectuez
462 une restauration \`a partir de sauvegardes diff\'erentielles (et de la Full associ\'ee),
463 les fichiers supprim\'es depuis la derni\`ere Full seront aussi restaur\'es. Ces fichiers
464 n'apparaîtront plus dans le catalogue apr\`es avoir fait une nouvelle sauvegarde
465 Full. Le processus pour supprimer ces fichiers du catalogue lors d'une
466 incr\'ementale ralentirait fortement les sauvegardes diff\'erentielles. Il n'est
467 actuellement pas impl\'ement\'e dans Bacula.
471 Pour un Job de type {\bf Restore}, aucun niveau ne doit \^etre sp\'ecifi\'e.
473 Pour un Job de type {\bf Verify}, le niveau peut \^etre l'un des suivants :
478 \index[fd]{InitCatalog }
479 Examine le {\bf FileSet} sp\'ecifi\'e et stocke les attributs de fichiers dans le
480 catalogue. Vous pouvez vous interroger sur l'int\'er\^et d'un Job qui ne
481 sauvegarde aucun fichier. La r\'eponse est de pouvoir utiliser Bacula comme
482 vous utiliseriez Tripwire, en d'autres termes, ce type de Jobs vous permet
483 de sauvegarder l'\'etat d'un ensemble de fichiers d\'efini par un {\bf FileSet}
484 afin de pouvoir ult\'erieurement contr\^oler si rien n'a \'et\'e modifi\'e, supprim\'e ou
485 ajout\'e. Ceci peut \^etre utilis\'e pour d\'etecter une intrusion. Typiquement,
486 vous sp\'ecifiez un {\bf FileSet} qui contient l'ensemble des fichiers qui ne
487 devraient pas changer (par exemple /sbin, /boot, /lib, /bin, ...). Ensuite,
488 vous ex\'ecutez le Job verify de niveau {\bf InitCatalog} apr\`es l'installation
489 de votre syst\`eme, puis apr\`es chaque modification (mise \`a jour). Ensuite,
490 lorsque vous souhaitez contr\^oler l'\'etat de votre syst\`eme de fichiers,
491 vous utilisez un Job {\bf Verify}, {\bf level = Catalog} afin de comparer
492 le r\'esultat de votre {\bf InitCatalog} avec l'\'etat actuel de votre syst\`eme
497 Compare l'\'etat actuel des fichiers et l'\'etat pr\'ec\'edemment sauvegard\'e
498 lors d'un {\bf InitCatalog}. Toutes les anomalies sont rapport\'ees.
499 Les objets du rapport sont d\'etermin\'es par les options {\bf verify}
500 sp\'ecifi\'ees dans la directive {\bf Include} du {\bf FileSet} sp\'ecifi\'e
501 (voyez la ressource {\bf FileSet} ci-dessous pour plus de d\'etails).
502 Typiquement, cette commande sera ex\'ecut\'ee quotidiennement pour
503 contr\^oler toute modification de votre syst\`eme de fichier.
505 Attention ! Si vous ex\'ecutez deux jobs Verify Catalog simultan\'ement sur le m\^eme client,
506 les r\'esultats seront probablement erronn\'es. En effet, Verify Catalog modifie
507 le catalogue lors de son ex\'ecution afin de d\'etecter les nouveaux fichiers.
509 \item [VolumeToCatalog]
510 \index[fd]{VolumeToCatalog }
511 Ce niveau permet de lire les attributs de fichiers \'ecrits sur le Volume
512 lors du dernier Job. Les attributs de fichiers sont compar\'es aux valeurs
513 sauvegard\'ees dans le catalogue et toute diff\'erence est rapport\'ee. Ceci
514 est similaire au niveau {\bf Catalog}, sauf que ce sont les
515 attributs des fichiers du volume plut\^ot que ceux des fichiers du disque
516 qui sont compar\'es aux attributs sauvegard\'es dans le catalogue. Bien que
517 les attributs et signatures (MD5 ou SHA1) soient compar\'es, les donn\'ees
518 r\'eelles ne le sont pas (elles ne figurent pas dans le catalogue).
520 Attention ! Si vous ex\'ecutez deux jobs Verify VolumeToCatalog simultan\'ement sur le m\^eme client,
521 les r\'esultats seront probablement erronn\'es. En effet, Verify VolumeToCatalog modifie
522 le catalogue lors de son ex\'ecution afin de d\'etecter les nouveaux fichiers.
524 \item [DiskToCatalog]
525 \index[fd]{DiskToCatalog }
526 Ce niveau permet de lire les fichiers tels qu'ils sont actuellement sur le
527 disque et de comparer leurs attributs actuels avec ceux stock\'es dans le
528 catalogue lors de la derni\`ere sauvegarde pour le Job sp\'ecifi\'e par la
529 directive {\bf VerifyJob}. Ce niveau diff\`ere du niveau {\bf Catalog}
530 d\'ecrit plus haut en ce qu'il ne se r\'ef\`ere pas \`a un Job Verify ant\'erieur,
531 mais \`a la derni\`ere sauvegarde. Lorsque vous utilisez ce niveau , vous devez
532 renseigner les option Verify de la section Include. Ces options d\'eterminent
533 quels attributs seront compar\'es.
535 Cette commande peut se r\'ev\'eler tr\`es utile si vous avez des probl\`emes de disque
536 car elle comparera l'\'etat actuel de votre disque avec la derni\`ere sauvegarde
537 valide, qui peut remonter \`a plusieurs jobs.
539 Notez que l'impl\'ementation actuelle (1.32c) n'identifie pas les fichiers qui
540 ont \'et\'e supprim\'es.
543 \item {\bf Verify Job = \lt{}Job-Resource-Name\gt{}}
544 \index[fd]{Verify Job }
545 Si vous ex\'ecutez un job verify sans cette directive, le dernier job
546 ex\'ecut\'e sera compar\'e avec le catalogue, ce qui signifie que votre commande
547 verify doit succ\'eder imm\'ediatement \`a une sauvegarde. Si vous sp\'ecifiez
548 un {\bf Verify Job}, Bacula trouvera le dernier job ex\'ecut\'e avec ce nom.
549 Ceci vous permet d'ex\'ecuter toutes vos sauvegardes, puis d'ex\'ecuter les jobs
550 Verify sur les sauvegardes de votre choix (le plus souvent, un {\bf VolumeToCatalog}
551 de sorte que la cartouche qui vient juste d'\^etre \'ecrite est relue).
553 \item {\bf JobDefs = \lt{}JobDefs-Resource-Name\gt{}}
555 If a JobDefs-Resource-Name is specified, all the values contained in the
556 named JobDefs resource will be used as the defaults for the current Job. Any
557 value that you explicitly define in the current Job resource, will override
558 any defaults specified in the JobDefs resource. The use of this directive
559 permits writing much more compact Job resources where the bulk of the
560 directives are defined in one or more JobDefs. This is particularly useful if
561 you have many similar Jobs but with minor variations such as different
562 Clients. A simple example of the use of JobDefs is provided in the default
563 bacula-dir.conf file.
565 \item {\bf Bootstrap = \lt{}bootstrap-file\gt{}}
566 \index[dir]{Bootstrap }
567 The Bootstrap directive specifies a bootstrap file that, if provided, will
568 be used during {\bf Restore} Jobs and is ignored in other Job types. The {\bf
569 bootstrap} file contains the list of tapes to be used in a restore Job as
570 well as which files are to be restored. Specification of this directive is
571 optional, and if specified, it is used only for a restore job. In addition,
572 when running a Restore job from the console, this value can be changed.
574 If you use the {\bf Restore} command in the Console program, to start a
575 restore job, the {\bf bootstrap} file will be created automatically from the
576 files you select to be restored.
578 For additional details of the {\bf bootstrap} file, please see
579 \ilink{Restoring Files with the Bootstrap File}{_ChapterStart43}
580 chapter of this manual.
583 \label{writebootstrap}
584 Write Bootstrap = \lt{}bootstrap-file-specification\gt{}}
586 The {\bf writebootstrap} directive specifies a file name where Bacula will
587 write a {\bf bootstrap} file for each Backup job run. Thus this directive
588 applies only to Backup Jobs. If the Backup job is a Full save, Bacula will
589 erase any current contents of the specified file before writing the bootstrap
590 records. If the Job is an Incremental save, Bacula will append the current
591 bootstrap record to the end of the file.
593 Using this feature, permits you to constantly have a bootstrap file that can
594 recover the current state of your system. Normally, the file specified should
595 be a mounted drive on another machine, so that if your hard disk is lost,
596 you will immediately have a bootstrap record available. Alternatively, you
597 should copy the bootstrap file to another machine after it is updated.
599 If the {\bf bootstrap-file-specification} begins with a vertical bar (|),
600 Bacula will use the specification as the name of a program to which it will
601 pipe the bootstrap record. It could for example be a shell script that emails
602 you the bootstrap record.
604 For more details on using this file, please see the chapter entitled
605 \ilink{The Bootstrap File}{_ChapterStart43} of this manual.
607 \item {\bf Client = \lt{}client-resource-name\gt{}}
609 The Client directive specifies the Client (File daemon) that will be used in
610 the current Job. Only a single Client may be specified in any one Job. The
611 Client runs on the machine to be backed up, and sends the requested files to
612 the Storage daemon for backup, or receives them when restoring. For
613 additional details, see the
614 \ilink{Client Resource section}{ClientResource2} of this chapter.
615 This directive is required.
617 \item {\bf FileSet = \lt{}FileSet-resource-name\gt{}}
619 The FileSet directive specifies the FileSet that will be used in the current
620 Job. The FileSet specifies which directories (or files) are to be backed up,
621 and what options to use (e.g. compression, ...). Only a single FileSet
622 resource may be specified in any one Job. For additional details, see the
623 \ilink{FileSet Resource section}{FileSetResource} of this
624 chapter. This directive is required.
626 \item {\bf Messages = \lt{}messages-resource-name\gt{}}
627 \index[dir]{Messages }
628 The Messages directive defines what Messages resource should be used for this
629 job, and thus how and where the various messages are to be delivered. For
630 example, you can direct some messages to a log file, and others can be sent
631 by email. For additional details, see the
632 \ilink{Messages Resource}{_ChapterStart15} Chapter of this
633 manual. This directive is required.
635 \item {\bf Pool = \lt{}pool-resource-name\gt{}}
637 The Pool directive defines the pool of Volumes where your data can be backed
638 up. Many Bacula installations will use only the {\bf Default} pool. However,
639 if you want to specify a different set of Volumes for different Clients or
640 different Jobs, you will probably want to use Pools. For additional details,
642 \ilink{Pool Resource section}{PoolResource} of this chapter. This
643 resource is required.
645 \item {\bf Full Backup Pool = \lt{}pool-resource-name\gt{} }
646 \index[dir]{Full Backup Pool }
647 The {\it Full Backup Pool} specifies a Pool to be used for Full backups. It
648 will override any Pool specification during a Full backup. This resource is
651 \item {\bf Differential Backup Pool = \lt{}pool-resource-name\gt{} }
652 \index[dir]{Differential Backup Pool }
653 The {\it Differential Backup Pool} specifies a Pool to be used for
654 Differential backups. It will override any Pool specification during a
655 Differentia backup. This resource is optional.
657 \item {\bf Incremental Backup Pool = \lt{}pool-resource-name\gt{} }
658 \index[dir]{Incremental Backup Pool }
659 The {\it Incremental Backup Pool} specifies a Pool to be used for Incremental
660 backups. It will override any Pool specification during a Incremental backup.
661 This resource is optional.
663 \item {\bf Schedule = \lt{}schedule-name\gt{}}
664 \index[dir]{Schedule }
665 The Schedule directive defines what schedule is to be used for the Job. The
666 schedule determines when the Job will be automatically started and what Job
667 level (i.e. Full, Incremental, ...) is to be run. This directive is optional,
668 and if left out, the Job can only be started manually. For additional
670 \ilink{Schedule Resource Chapter}{ScheduleResource} of this
671 manual. If a Schedule resource is specified, the job will be run according to
672 the schedule specified. If no Schedule resource is specified for the Job,
673 the job must be manually started using the Console program. Although you may
674 specify only a single Schedule resource for any one job, the Schedule
675 resource may contain multiple {\bf Run} directives, which allow you to run
676 the Job at many different times, and each {\bf run} directive permits
677 overriding the default Job Level Pool, Storage, and Messages resources. This
678 gives considerable flexibility in what can be done with a single Job.
680 \item {\bf Storage = \lt{}storage-resource-name\gt{}}
681 \index[dir]{Storage }
682 The Storage directive defines the name of the storage services where you want
683 to backup the FileSet data. For additional details, see the
684 \ilink{Storage Resource Chapter}{StorageResource2} of this manual.
685 This directive is required.
687 \item {\bf Max Start Delay = \lt{}time\gt{}}
688 \index[sd]{Max Start Delay }
689 The time specifies maximum delay between the scheduled time and the actual
690 start time for the Job. For example, a job can be scheduled to run at
691 1:00am, but because other jobs are running, it may wait to run. If the delay
692 is set to 3600 (one hour) and the job has not begun to run by 2:00am, the job
693 will be canceled. This can be useful, for example, to prevent jobs from
694 running during day time hours. The default is 0 which indicates no limit.
696 \item {\bf Max Run Time = \lt{}time\gt{}}
697 \index[sd]{Max Run Time }
698 The time specifies maximum allowed time that a job may run, counted from the
699 when the job starts ({\bf not} necessarily the same as when the job was
700 scheduled). This directive is implemented only in version 1.33 and later.
702 \item {\bf Max Wait Time = \lt{}time\gt{}}
703 \index[sd]{Max Wait Time }
704 The time specifies maximum allowed time that a job may block waiting for a
705 resource (such as waiting for a tape to be mounted, or waiting for the
706 storage or file daemons to perform their duties), counted from the when the
707 job starts ({\bf not} necessarily the same as when the job was scheduled).
708 This directive is implemented only in version 1.33 and later. Note, the
709 implementation is not yet complete, so this directive does not yet work
712 \item {\bf Prune Jobs = \lt{}yes|no\gt{}}
713 \index[fd]{Prune Jobs }
714 Normally, pruning of Jobs from the Catalog is specified on a Client by Client
715 basis in the Client resource with the {\bf AutoPrune} directive. If this
716 directive is specified (not normally) and the value is {\bf yes}, it will
717 override the value specified in the Client resource. The default is {\bf no}.
720 \item {\bf Prune Files = \lt{}yes|no\gt{}}
721 \index[fd]{Prune Files }
722 Normally, pruning of Files from the Catalog is specified on a Client by
723 Client basis in the Client resource with the {\bf AutoPrune} directive. If
724 this directive is specified (not normally) and the value is {\bf yes}, it
725 will override the value specified in the Client resource. The default is {\bf
728 \item {\bf Prune Volumes = \lt{}yes|no\gt{}}
729 \index[fd]{Prune Volumes }
730 Normally, pruning of Volumes from the Catalog is specified on a Client by
731 Client basis in the Client resource with the {\bf AutoPrune} directive. If
732 this directive is specified (not normally) and the value is {\bf yes}, it
733 will override the value specified in the Client resource. The default is {\bf
736 \item {\bf Run Before Job = \lt{}command\gt{}}
737 \index[fd]{Run Before Job }
738 The specified {\bf command} is run as an external program prior to running
739 the current Job. Any output sent by the job to standard output will be
740 included in the Bacula job report. The command string must be a valid program
741 name or name of a shell script. This directive is not required, but if it is
742 defined, and if the exit code of the program run is non-zero, the current
743 Bacula job will be canceled. In addition, the command string is parsed then
744 feed to the execvp() function, which means that the path will be searched to
745 execute your specified command, but there is no shell interpretation, as a
746 consequence, if you complicated commands or want any shell features such as
747 redirection or piping, you must call a shell script and do it inside that
750 Before submitting the specified command to the operating system, Bacula
751 performs character substitution of the following characters:
769 As of version 1.30, Bacula checks the exit status of the RunBeforeJob
770 program. If it is non-zero, the job will be error terminated. Lutz Kittler
771 has pointed out that this can be a simple way to modify your schedules during
772 a holiday. For example, suppose that you normally do Full backups on Fridays,
773 but Thursday and Friday are holidays. To avoid having to change tapes between
774 Thursday and Friday when no one is in the office, you can create a
775 RunBeforeJob that returns a non-zero status on Thursday and zero on all other
776 days. That way, the Thursday job will not run, and on Friday the tape you
777 insert on Wednesday before leaving will be used.
779 \item {\bf Run After Job = \lt{}command\gt{}}
780 \index[fd]{Run After Job }
781 The specified {\bf command} is run as an external program after the current
782 job terminates. This directive is not required. The command string must be a
783 valid program name or name of a shell script. If the exit code of the program
784 run is non-zero, the current Bacula job will terminate in error. Before
785 submitting the specified command to the operating system, Bacula performs
786 character substitution as described above for the {\bf Run Before Job}
789 An example of the use of this command is given in the
790 \ilink{Tips Chapter}{JobNotification} of this manual. As of version
791 1.30, Bacula checks the exit status of the RunAfter program. If it is
792 non-zero, the job will be terminated in error.
794 \item {\bf Client Run Before Job = \lt{}command\gt{}}
795 \index[fd]{Client Run Before Job }
796 This command is the same as {\bf Run Before Job} except that it is run on
797 the client machine. The same restrictions apply to Unix systems as noted
798 above for the {\bf Run Before Job}. In addition, for a Windows client on
799 version 1.33 and above, please take careful note that you must ensure a
800 correct path to your script, and the script or program can be a .com, .exe or
801 a .bat file. However, if you specify a path, you must also specify the full
802 extension. Unix like commands will not work unless you have installed and
803 properly configured Cygwin in addition to and separately from Bacula.
805 {\bf Special Windows Considerations}
806 The command can be anything that cmd.exe or command.com will recognize as a
807 executable file. Specifiying the executable's extention is optional, unless
808 there is an ambiguity. (i.e. ls.bat, ls.exe)
810 The System \%Path\% will be searched for the command. (under the envrionment
811 variable dialog you have have both System Environment and User Environment,
812 we believe that only the System environment will be available to bacual-fd,
813 if it is running as a service.)
815 System environment varaible can be called out using the \%var\% syntax and
816 used as either part of the command name or arguments.
818 When specifiying a full path to an executable if the path or executable name
819 contains whitespace or special characters they will need to be quoted.
820 Arguments containing whitespace or special characters will also have to be
825 ClientRunBeforeJob = "\"C:/Program Files/Software
826 Vendor/Executable\" /arg1 /arg2 \"foo bar\""
830 The special characters \&()[]\{\}\^{}=;!'+,`\~{} will need to be quoted if
831 part of a filename or argument.
833 If someone is logged in a blank ``command'' window running the commands will
834 be present during the execution of the command.
836 Some Suggestions from Phil Stracchino for running on Win32 machines with the
837 native Win32 File daemon:
840 \item You might want the ClientRunBeforeJob directive to specify a .bat file
841 which runs the actual client-side commands, rather than trying to run (for
842 example) regedit /e directly.
843 \item The batch file should explicitly 'exit 0' on successful completion.
844 \item The path to the batch file should be specified in Unix form:
846 ClientRunBeforeJob = ``c:/bacula/bin/systemstate.bat''
848 rather than DOS/Windows form:
851 ``c:\textbackslash{}bacula\textbackslash{}bin\textbackslash{}systemstate.bat''
855 \item {\bf Client Run After Job = \lt{}command\gt{}}
856 \index[fd]{Client Run After Job }
857 This command is the same as {\bf Run After Job} except that it is run on the
858 client machine. Note, please see the notes above in {\bf Client Run Before
859 Job} concerning Windows clients.
861 \item {\bf Rerun Failed Levels = \lt{}yes|no\gt{}}
862 \index[fd]{Rerun Failed Levels }
863 If this directive is set to {\bf yes} (default no), and Bacula detects that a
864 previous job at a higher level (i.e. Full or Differential) has failed, the
865 current job level will be upgraded to the higher level. This is particularly
866 useful for Laptops where they may often be unreachable, and if a prior Full
867 save has failed, you wish the very next backup to be a Full save rather than
868 whatever level it is started as.
870 \item {\bf Spool Data = \lt{}yes|no\gt{}}
871 \index[fd]{Spool Data }
872 If this directive is set to {\bf yes} (default no), the Storage daemon will
873 be requested to spool the data for this Job to disk rather than write it
874 directly to tape. Once all the data arrives or the spool file maximum sizes
875 are reached, the data will be despooled and written to tape. When this
876 directive is set to yes, the Spool Attributes is also automatically set to
877 yes. Spooling data prevents tape shoe-shine (start and stop) during
878 Incremental saves. This option should not be used if you are writing to a
881 \item {\bf Spool Attributes = \lt{}yes|no\gt{}}
882 \index[fd]{Spool Attributes }
883 The default is set to {\bf no}, which means that the File attributes are sent
884 by the Storage daemon to the Director as they are stored on tape. However,
885 if you want to avoid the possibility that database updates will slow down
886 writing to the tape, you may want to set the value to {\bf yes}, in which
887 case the Storage daemon will buffer the File attributes and Storage
888 coordinates to a temporary file in the Working Directory, then when writing
889 the Job data to the tape is completed, the attributes and storage coordinates
890 will be sent to the Director. The default is {\bf no}.
892 \item {\bf Where = \lt{}directory\gt{}}
894 This directive applies only to a Restore job and specifies a prefix to the
895 directory name of all files being restored. This permits files to be restored
896 in a different location from which they were saved. If {\bf Where} is not
897 specified or is set to backslash ({\bf /}), the files will be restored to
898 their original location. By default, we have set {\bf Where} in the example
899 configuration files to be {\bf /tmp/bacula-restores}. This is to prevent
900 accidental overwriting of your files.
902 \item {\bf Replace = \lt{}replace-option\gt{}}
903 \index[dir]{Replace }
904 This directive applies only to a Restore job and specifies what happens when
905 Bacula wants to restore a file or directory that already exists. You have the
906 following options for {\bf replace-option}:
912 when the file to be restored already exists, it is deleted then replaced by
917 if the backed up file (on tape) is newer than the existing file, the existing
918 file is deleted and replaced by the back up.
922 if the backed up file (on tape) is older than the existing file, the existing
923 file is deleted and replaced by the back up.
927 if the backed up file already exists, Bacula skips restoring this file.
930 \item {\bf Prefix Links=\lt{}yes|no\gt{}}
931 \index[fd]{Prefix Links }
932 If a {\bf Where} path prefix is specified for a recovery job, apply it to
933 absolute links as well. The default is {\bf No}. When set to {\bf Yes} then
934 while restoring files to an alternate directory, any absolute soft links
935 will also be modified to point to the new alternate directory. Normally this
936 is what is desired -- i.e. everything is self consistent. However, if you
937 wish to later move the files to their original locations, all files linked
938 with absolute names will be broken.
940 \item {\bf Maximum Concurrent Jobs = \lt{}number\gt{}}
941 \index[dir]{Maximum Concurrent Jobs }
942 where \lt{}number\gt{} is the maximum number of Jobs from the current Job
943 resource that can run concurrently. Note, this directive limits only Jobs
944 with the same name as the resource in which it appears. Any other
945 restrictions on the maximum concurrent jobs such as in the Director, Client,
946 or Storage resources will also apply in addition to the limit specified here.
947 The default is set to 1, but you may set it to a larger number. We strongly
948 recommend that you read the WARNING documented under
949 \ilink{ Maximum Concurrent Jobs}{DirMaxConJobs} in the Director's
952 \item {\bf Reschedule On Error = \lt{}yes|no\gt{}}
953 \index[dir]{Reschedule On Error }
954 If this directive is enabled, and the job terminates in error, the job will
955 be rescheduled as determined by the {\bf Reschedule Interval} and {\bf
956 Reschedule Times} directives. If you cancel the job, it will not be
957 rescheduled. The default is {\bf no} (i.e. the job will not be rescheduled).
960 This specification can be useful for portables, laptops, or other machines
961 that are not always connected to the network or switched on.
963 \item {\bf Reschedule Interval = \lt{}time-specification\gt{}}
964 \index[dir]{Reschedule Interval }
965 If you have specified {\bf Reschedule On Error = yes} and the job terminates
966 in error, it will be rescheduled after the interval of time specified by
967 {\bf time-specification}. See
968 \ilink{ the time specification formats}{Time} in the Configure
969 chapter for details of time specifications. If no interval is specified, the
970 job will not be rescheduled on error.
972 \item {\bf Reschedule Times = \lt{}count\gt{}}
973 \index[dir]{Reschedule Times }
974 This directive specifies the maximum number of times to reschedule the job.
975 If it is set to zero (the default) the job will be rescheduled an indefinite
979 \item {\bf Priority = \lt{}number\gt{}}
980 \index[dir]{Priority }
981 This directive permits you to control the order in which your jobs run by
982 specifying a positive non-zero number. The higher the number, the lower the
983 job priority. Assuming you are not running concurrent jobs, all queued jobs
984 of priority 1 will run before queued jobs of priority 2 and so on,
985 regardless of the original scheduling order.
987 The priority only affects waiting jobs that are queued to run, not jobs that
988 are already running. If one or more jobs of priority 2 are already running,
989 and a new job is scheduled with priority 1, the currently running priority 2
990 jobs must complete before the priority 1 job is run.
992 The default priority is 10.
994 If you want to run concurrent jobs, which is not recommended, you should keep
995 these points in mind:
998 \item To run concurrent jobs, you must set Maximum Concurrent Jobs = 2 in 5
999 or 6 distinct places: in bacula-dir.conf in the Director, the Job, the
1000 Client, the Storage resources; in bacula-fd in the FileDaemon (or Client)
1001 resource, and in bacula-sd.conf in the Storage resource. If any one is
1002 missing, it will throttle the jobs to one at a time.
1003 \item Bacula concurrently runs jobs of only one priority at a time. It will
1004 not simultaneously run a priority 1 and a priority 2 job.
1005 \item If Bacula is running a priority 2 job and a new priority 1 job is
1006 scheduled, it will wait until the running priority 2 job terminates even if
1007 the Maximum Concurrent Jobs settings would otherwise allow two jobs to run
1009 \item Suppose that bacula is running a priority 2 job and new priority 1 job
1010 is scheduled and queued waiting for the running priority 2 job to terminate.
1011 If you then start a second priority 2 job, the waiting priority 1 job will
1012 prevent the new priority 2 job from running concurrently with the running
1013 priority 2 job. That is: as long as there is a higher priority job waiting to
1014 run, no new lower priority jobs will start even if the Maximum Concurrent
1015 Jobs settings would normally allow them to run. This ensures that higher
1016 priority jobs will be run as soon as possible.
1019 If you have several jobs of different priority, it is best not to start them
1020 at exactly the same time, because Bacula must examine them one at a time. If
1021 by chance Bacula treats a lower priority first, then it will run before your
1022 high priority jobs. To avoid this, start any higher priority a few seconds
1023 before lower ones. This insures that Bacula will examine the jobs in the
1024 correct order, and that your priority scheme will be respected.
1025 \label{WritePartAfterJob}
1027 \item {\bf Write Part After Job = \lt{}yes|no\gt{}}
1028 \index[sd]{Write Part After Job }
1029 If this directive is set to {\bf yes} (default {\bf no}), a new part file
1030 will be created after the job is finished.
1032 It should be set to {\bf yes} when writing to devices that require mount (for
1033 example DVD), so you are sure that the current part, containing this job's
1034 data, is written to the device, and that no data is left in the temporary
1035 file on the hard disk. However, on some media, like DVD+R and DVD-R, a lot of
1036 space (about 10Mb) is lost everytime a part is written. So, if you run
1037 several jobs each after another, you could set this directive to {\bf no} for
1038 all jobs, except the last one, to avoid wasting too much space, but to ensure
1039 that the data is written to the medium when all jobs are finished.
1041 It is ignored with tape and FIFO devices.
1044 The following is an example of a valid Job resource definition:
1051 Level = Incremental # default
1053 FileSet="Minou Full Set"
1056 Schedule = "MinouWeeklyCycle"
1062 \section*{The JobDefs Resource}
1063 \label{JobDefsResource}
1064 \index[general]{JobDefs Resource }
1065 \index[general]{Resource!JobDefs }
1066 \addcontentsline{toc}{section}{JobDefs Resource}
1068 The JobDefs resource permits all the same directives that can appear in a Job
1069 resource. However, a JobDefs resource does not create a Job, rather it can be
1070 referenced within a Job to provide defaults for that Job. This permits you to
1071 concisely define several nearly identical Jobs, each one referencing a JobDefs
1072 resource which contains the defaults. Only the changes from the defaults need
1073 be mentioned in each Job.
1075 \section*{The Schedule Resource}
1076 \label{ScheduleResource}
1077 \index[general]{Resource!Schedule }
1078 \index[general]{Schedule Resource }
1079 \addcontentsline{toc}{section}{Schedule Resource}
1081 The Schedule resource provides a means of automatically scheduling a Job as
1082 well as the ability to override the default Level, Pool, Storage and Messages
1083 resources. If a Schedule resource is not referenced in a Job, the Job may only
1084 be run manually. In general, you specify an action to be taken and when.
1089 \index[sd]{Schedule }
1090 Start of the Schedule directives. No {\bf Schedule} resource is required, but
1091 you will need at least one if you want Jobs to be automatically started.
1093 \item [Name = \lt{}name\gt{}]
1095 The name of the schedule being defined. The Name directive is required.
1097 \item [Run = \lt{}Job-overrides\gt{} \lt{}Date-time-specification\gt{} ]
1099 The Run directive defines when a Job is to be run, and what overrides if any
1100 to apply. You may specify multiple {\bf run} directives within a {\bf
1101 Schedule} resource. If you do, they will all be applied (i.e. multiple
1102 schedules). If you have two {\bf Run} directives that start at the same time,
1103 two Jobs will start at the same time (well, within one second of each
1106 The {\bf Job-overrides} permit overriding the Level, the Storage, the
1107 Messages, and the Pool specifications provided in the Job resource. In
1108 addition, the FullPool, the IncrementalPool, and the DifferentialPool
1109 specifications permit overriding the Pool specification according to what
1110 backup Job Level is in effect.
1112 By the use of overrides, you may customize a particular Job. For example, you
1113 may specify a Messages override for your Incremental backups that outputs
1114 messages to a log file, but for your weekly or monthly Full backups, you may
1115 send the output by email by using a different Messages override.
1117 {\bf Job-overrides} are specified as: {\bf keyword=value} where the keyword
1118 is Level, Storage, Messages, Pool, FullPool, DifferentialPool, or
1119 IncrementalPool, and the {\bf value} is as defined on the respective
1120 directive formats for the Job resource. You may specify multiple {\bf
1121 Job-overrides} on one {\bf Run} directive by separating them with one or more
1122 spaces or by separating them with a trailing comma. For example:
1128 is all files in the FileSet whether or not they have changed.
1130 \item [Level=Incremental]
1132 is all files that have changed since the last backup.
1136 specifies to use the Pool named {\bf Weekly}.
1138 \item [Storage=DLT\_Drive]
1139 \index[sd]{Storage }
1140 specifies to use {\bf DLT\_Drive} for the storage device.
1142 \item [Messages=Verbose]
1143 \index[sd]{Messages }
1144 specifies to use the {\bf Verbose} message resource for the Job.
1146 \item [FullPool=Full]
1147 \index[sd]{FullPool }
1148 specifies to use the Pool named {\bf Full} if the job is a full backup, or is
1149 upgraded from another type to a full backup.
1151 \item [DifferentialPool=Differential]
1152 \index[sd]{DifferentialPool }
1153 specifies to use the Pool named {\bf Differential} if the job is a
1154 differential backup.
1156 \item [IncrementalPool=Incremental]
1157 \index[sd]{IncrementalPool }
1158 specifies to use the Pool named {\bf Incremental} if the job is an
1161 \item [SpoolData=yes|no]
1162 \index[sd]{SpoolData }
1163 tells Bacula to request the Storage daemon to spool data to a disk file
1164 before putting it on tape.
1166 \item [WritePartAfterJob=yes|no]
1167 \index[sd]{WritePartAfterJob }
1168 tells Bacula to request the Storage daemon to write the current part file to
1169 the device when the job is finished (see
1170 \ilink{Write Part After Job directive in the Job
1171 resource}{WritePartAfterJob}).
1174 {\bf Date-time-specification} determines when the Job is to be run. The
1175 specification is a repetition, and as a default Bacula is set to run a job at
1176 the beginning of the hour of every hour of every day of every week of every
1177 month of every year. This is not normally what you want, so you must specify
1178 or limit when you want the job to run. Any specification given is assumed to
1179 be repetitive in nature and will serve to override or limit the default
1180 repetition. This is done by specifing masks or times for the hour, day of the
1181 month, day of the week, week of the month, week of the year, and month when
1182 you want the job to run. By specifying one or more of the above, you can
1183 define a schedule to repeat at almost any frequency you want.
1185 Basically, you must supply a {\bf month}, {\bf day}, {\bf hour}, and {\bf
1186 minute} the Job is to be run. Of these four items to be specified, {\bf day}
1187 is special in that you may either specify a day of the month such as 1, 2,
1188 ... 31, or you may specify a day of the week such as Monday, Tuesday, ...
1189 Sunday. Finally, you may also specify a week qualifier to restrict the
1190 schedule to the first, second, third, fourth, or fifth week of the month.
1192 For example, if you specify only a day of the week, such as {\bf Tuesday} the
1193 Job will be run every hour of every Tuesday of every Month. That is the {\bf
1194 month} and {\bf hour} remain set to the defaults of every month and all
1197 Note, by default with no other specification, your job will run at the
1198 beginning of every hour. If you wish your job to run more than once in any
1199 given hour, you will need to specify multiple {\bf run} specifications each
1200 with a different minute.
1202 The date/time to run the Job can be specified in the following way in
1209 <week-keyword> = 1st | 2nd | 3rd | 4th | 5th | first |
1210 second | third | forth | fifth
1211 <wday-keyword> = sun | mon | tue | wed | thu | fri | sat |
1212 sunday | monday | tuesday | wednesday |
1214 <week-of-year-keyword> = w00 | w01 | ... w52 | w53
1215 <month-keyword> = jan | feb | mar | apr | may | jun | jul |
1216 aug | sep | oct | nov | dec | january |
1217 february | ... | december
1218 <daily-keyword> = daily
1219 <weekly-keyword> = weekly
1220 <monthly-keyword> = monthly
1221 <hourly-keyword> = hourly
1222 <digit> = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0
1223 <number> = <digit> | <digit><number>
1224 <12hour> = 0 | 1 | 2 | ... 12
1225 <hour> = 0 | 1 | 2 | ... 23
1226 <minute> = 0 | 1 | 2 | ... 59
1227 <day> = 1 | 2 | ... 31
1228 <time> = <hour>:<minute> |
1229 <12hour>:<minute>am |
1231 <time-spec> = <at-keyword> <time> |
1233 <date-keyword> = <void-keyword> <weekly-keyword>
1234 <day-range> = <day>-<day>
1235 <month-range> = <month-keyword>-<month-keyword>
1236 <wday-range> = <wday-keyword>-<wday-keyword>
1237 <range> = <day-range> | <month-range> |
1239 <date> = <date-keyword> | <day> | <range>
1240 <date-spec> = <date> | <date-spec>
1241 <day-spec> = <day> | <wday-keyword> |
1242 <day-range> | <wday-range> |
1244 <day-spec> = <day> | <wday-keyword> |
1245 <week-keyword> <wday-keyword>
1246 <month-spec> = <month-keyword> | <month-range> |
1248 <date-time-spec> = <month-spec> <day-spec> <time-spec>
1254 Note, the Week of Year specification wnn follows the ISO standard definition
1255 of the week of the year, where Week 1 is the week in which the first Thursday
1256 of the year occurs, or alternatively, the week which contains the 4th of
1257 January. Weeks are numbered w01 to w53. w00 for Bacula is the week that
1258 precedes the first ISO week (i.e. has the first few days of the year if any
1259 occur before Thursday). w00 is not defined by the ISO specification. A week
1260 starts with Monday and ends with Sunday.
1262 An example schedule resource that is named {\bf WeeklyCycle} and runs a job
1263 with level full each Sunday at 1:05am and an incremental job Monday through
1264 Saturday at 1:05am is:
1269 Name = "WeeklyCycle"
1270 Run = Level=Full sun at 1:05
1271 Run = Level=Incremental mon-sat at 1:05
1276 An example of a possible monthly cycle is as follows:
1281 Name = "MonthlyCycle"
1282 Run = Level=Full Pool=Monthly 1st sun at 1:05
1283 Run = Level=Differential 2nd-5th sun at 1:05
1284 Run = Level=Incremental Pool=Daily mon-sat at 1:05
1289 The first of every month:
1295 Run = Level=Full on 1 at 1:05
1296 Run = Level=Incremental on 2-31 at 1:05
1307 Run = Level=Full hourly at 0:05
1308 Run = Level=Full hourly at 0:15
1309 Run = Level=Full hourly at 0:25
1310 Run = Level=Full hourly at 0:35
1311 Run = Level=Full hourly at 0:45
1312 Run = Level=Full hourly at 0:55
1317 \subsection*{Technical Notes on Schedules}
1318 \index[general]{Schedules!Technical Notes on }
1319 \index[general]{Technical Notes on Schedules }
1320 \addcontentsline{toc}{subsection}{Technical Notes on Schedules}
1322 Internally Bacula keeps a schedule as a bit mask. There are six masks and a
1323 minute field to each schedule. The masks are hour, day of the month (mday),
1324 month, day of the week (wday), week of the month (wom), and week of the year
1325 (woy). The schedule is initialized to have the bits of each of these masks
1326 set, which means that at the beginning of every hour, the job will run. When
1327 you specify a month for the first time, the mask will be cleared and the bit
1328 corresponding to your selected month will be selected. If you specify a second
1329 month, the bit corresponding to it will also be added to the mask. Thus when
1330 Bacula checks the masks to see if the bits are set corresponding to the
1331 current time, your job will run only in the two months you have set. Likewise,
1332 if you set a time (hour), the hour mask will be cleared, and the hour you
1333 specify will be set in the bit mask and the minutes will be stored in the
1336 For any schedule you have defined, you can see how these bits are set by doing
1337 a {\bf show schedules} command in the Console program. Please note that the
1338 bit mask is zero based, and Sunday is the first day of the week (bit zero).
1340 \section*{The FileSet Resource}
1341 \label{FileSetResource}
1342 \index[general]{Resource!FileSet }
1343 \index[general]{FileSet Resource }
1344 \addcontentsline{toc}{section}{FileSet Resource}
1346 The FileSet resource defines what files are to be included in a backup job. At
1347 least one {\bf FileSet} resource is required for each backup Job. It consists
1348 of a list of files or directories to be included, a list of files or
1349 directories to be excluded and the various backup options such as compression,
1350 encryption, and signatures that are to be applied to each file.
1352 Any change to the list of the included files will cause Bacula to
1353 automatically create a new FileSet (defined by the name and an MD5 checksum of
1354 the Include contents). Each time a new FileSet is created, Bacula will ensure
1355 that the first backup is always a Full save.
1360 \index[dir]{FileSet }
1361 Start of the FileSet resource. At least one {\bf FileSet} resource must be
1364 \item [Name = \lt{}name\gt{}]
1366 The name of the FileSet resource. This directive is required.
1368 \item [Ignore FileSet Changes = \lt{}yes|no\gt{}
1370 \index[dir]{Ignore FileSet Changes }
1371 If this directive is set to {\bf yes}, any changes you make to the FileSet
1372 Include or Exclude lists will be ignored and not cause Bacula to immediately
1373 perform a Full backup. The default is {\bf no}, in which case, if you change
1374 the Include or Exclude, Bacula will force a Full backup to ensure that
1375 everything is properly backed up. It is not recommended to set this directive
1376 to yes. This directive is available in Bacula version 1.35.4 or later.
1378 \item [{Include \ \{ [ Options \{\lt{}file-options\gt{}\} ...]
1379 \lt{}file-list\gt{} \}
1381 \index[dir]{Include \ \{ [ Options \{\lt{}file-options\gt{}\} ...]
1382 \lt{}file-list\gt{} \} }
1384 \item [Options \ \{ \lt{}file-options\gt{} \}
1386 \index[dir]{Options \ \{ \lt{}file-options\gt{} \} }
1388 \item [Exclude \ \{ \lt{}file-list\gt{} \}]
1389 \index[dir]{Exclude \ \{ \lt{}file-list\gt{} \} }
1391 The Include resource must contain a list of directories and/or files to be
1392 processed in the backup job. Normally, all files found in all subdirectories
1393 of any directory in the Include File list will be backed up. The Include
1394 resource may also oner more Options resources that specify options such as
1395 compression to be applied to all or any subset of the files found for backup.
1397 There can be any number of {\bf Include} resources within the FileSet, each
1398 having its own list of directories or files to be backed up and the backup
1399 options defined by one or more Options resources. The {\bf file-list} consists
1400 of one file or directory name per line. Directory names should be specified
1401 without a trailing slash.
1403 You should always specify a full path for every directory and file that you
1404 list in the FileSet. In addition, on Windows machines, you should {\bf always}
1405 prefix the directory or filename with the drive specification (e.g. {\bf
1406 c:/xxx}) using Unix directory name separators (forward slash).
1408 Bacula's default for processing directories is to recursively descend in the
1409 directory saving all files and subdirectories. Bacula will not by default
1410 cross filesystems (or mount points in Unix parlance). This means that if you
1411 specify the root partition (e.g. {\bf /}), Bacula will save only the root
1412 partition and not any of the other mounted filesystems. Similarly on Windows
1413 systems, you must explicitly specify each of the drives you want saved (e.g.
1414 {\bf c:/} and {\bf d:/} ...). In addition, at least for Windows systems, you
1415 will most likely want to enclose each specification within double quotes
1416 particularly if the directory (or file) name contains spaces. The {\bf df}
1417 command on Unix systems will show you which mount points you must specify to
1418 save everything. See below for an example.
1420 Take special care not to include a directory twice or Bacula will backup the
1421 same files two times wasting a lot of space on your archive device. Including
1422 a directory twice is very easy to do. For example:
1429 Options { compression=GZIP }
1434 on a Unix system where /usr is a subdirectory (rather than a mounted
1435 filesystem) will cause /usr to be backed up twice. In this case, on Bacula
1436 versions prior to 1.32f-5-09Mar04 due to a bug, you will not be able to
1437 restore hard linked files that were backed up twice.
1439 If you have used Bacula prior to version 1.34.3, you will note three things in
1440 the new FileSet syntax:
1443 \item There is no equal sign (=) after the include and before the opening
1445 \item Each directory (or filename) to be backed up is preceded by a {\bf File
1446 =}. Previously they were simply listed on separate lines.
1447 \item The options that previously appeared on the Include line now must be
1448 specified within their own Options resource.
1451 The Options resource is optional, but when specified, it will contain a list
1452 of {\bf keyword=value} options to be applied to the file-list. Multiple
1453 Options resources may be specified one after another. As the files are found
1454 in the specified directories, the Options will applied to the filenames to
1455 determine if and how the file should be backed up. The Options resources are
1456 applied in the order they are specified in the FileSet until the first one
1457 that matches. An Options resource that does not contain a {\bf wild} directive
1458 (wild-card specification, see below) is assumed to match any filename. This is
1459 important to understand, because once Bacula determine that the Options
1460 matches the file under consideration, that file will be saved without looking
1461 at any other Options resources that may be present. This means that any wild
1462 cards must appear before an Option resource without wild cards.
1464 If for some reason, Bacula applies all the Options resources to a file under
1465 consideration for backup, but there are no matches (generally because of wild
1466 cards that don't match), Bacula as a default will then backup the file. This
1467 is quite logical if you consider the case of no Options, where you want
1468 everything to be backed up. However, one additional point is that in the case
1469 that no match was found, Bacula will use the options found in the last Options
1470 resource. As a consequence, if you want a particular set of ``default''
1471 options, you should put them in an Options resource after any other Options.
1473 The directives within an Options resource may be one of the following:
1477 \item [compression=GZIP]
1478 \index[fd]{compression }
1479 All files saved will be software compressed using the GNU ZIP compression
1480 format. The compression is done on a file by file basis by the File daemon.
1481 If there is a problem reading the tape in a single record of a file, it will
1482 at most affect that file and none of the other files on the tape. Normally
1483 this option is {\bf not} needed if you have a modern tape drive as the drive
1484 will do its own compression. In fact, if you specify software compression at
1485 the same time you have hardware compression turned on, your files may
1486 actually take more space on the volume.
1488 Software compression is very important if you are writing your Volumes to a
1489 file, and it can also be helpful if you have a fast computer but a slow
1492 Specifying {\bf GZIP} uses the default compression level six (i.e. {\bf GZIP}
1493 is identical to {\bf GZIP6}). If you want a different compression level (1
1494 through 9), you can specify it by appending the level number with no
1495 intervening spaces to {\bf GZIP}. Thus {\bf compression=GZIP1} would give
1496 minimum compression but the fastest algorithm, and {\bf compression=GZIP9}
1497 would give the highest level of compression, but requires more computation.
1498 According to the GZIP documentation, compression levels greater than 6
1499 generally give very little extra compression and are rather CPU intensive.
1501 \item [signature=SHA1]
1502 \index[fd]{signature }
1503 An SHA1 signature will be computed for all The SHA1 algorithm is purported to
1504 be some what slower than the MD5 algorithm, but at the same time is
1505 significantly better from a cryptographic point of view (i.e. much fewer
1506 collisions, much lower probability of being hacked.) It adds four more bytes
1507 than the MD5 signature. We strongly recommend that either this option or MD5
1508 be specified as a default for all files. Note, only one of the two options
1509 MD5 or SHA1 can be computed for any file.
1511 \item [signature=MD5]
1512 \index[fd]{signature }
1513 An MD5 signature will be computed for all files saved. Adding this option
1514 generates about 5\% extra overhead for each file saved. In addition to the
1515 additional CPU time, the MD5 signature adds 16 more bytes per file to your
1516 catalog. We strongly recommend that this option or the SHA1 option be
1517 specified as a default for all files.
1519 \item [verify=\lt{}options\gt{}]
1521 The options letters specified are used when running a {\bf Verify
1522 Level=Catalog} as well as the {\bf DiskToCatalog} level job. The options
1523 letters may be any combination of the following:
1531 compare the permission bits
1534 compare the number of links
1540 compare the group id
1546 compare the access time
1549 compare the modification time (st\_mtime)
1552 compare the change time (st\_ctime)
1555 report file size decreases
1558 compare the MD5 signature
1561 compare the SHA1 signature
1564 A useful set of general options on the {\bf Level=Catalog} or {\bf
1565 Level=DiskToCatalog} verify is {\bf pins5} i.e. compare permission bits,
1566 inodes, number of links, size, and MD5 changes.
1568 \item {\bf onefs=yes|no}
1570 If set to {\bf yes} (the default), {\bf Bacula} will remain on a single file
1571 system. That is it will not backup file systems that are mounted on a
1572 subdirectory. If you wish to backup multiple filesystems, you can explicitly
1573 list each file system you want saved. Otherwise, if you set the onefs option
1574 to {\bf no}, Bacula will backup all mounted file systems (i.e. traverse mount
1575 points) that are found within the {\bf FileSet}. Thus if you have NFS or
1576 Samba file systems mounted on a directory listed in your FileSet, they will
1577 also be backed up. Normally, it is preferable to set {\bf onefs=yes} and to
1578 explicitly name each filesystem you want backed up. Explicitly naming the
1579 filesystems you want backed up avoids the possibility of getting into a
1580 infinite loop recursing filesystems. See the example below for more details.
1583 \item {\bf portable=yes|no}
1584 \index[dir]{portable }
1585 If set to {\bf yes} (default is {\bf no}), the Bacula File daemon will backup
1586 Win32 files in a portable format, but not all Win32 file attributes will be
1587 saved and restored. By default, this option is set to {\bf no}, which means
1588 that on Win32 systems, the data will be backed up using Windows API calls and
1589 on WinNT/2K/XP, all the security and ownership attributes will be properly
1590 backed up (and restored). However this format is not portable to other
1591 systems -- e.g. Unix, Win95/98/Me. When backing up Unix systems, this option
1592 is ignored, and unless you have a specific need to have portable backups, we
1593 recommend accept the default ({\bf no}) so that the maximum information
1594 concerning your files is saved.
1596 \item {\bf recurse=yes|no}
1597 \index[fd]{recurse }
1598 If set to {\bf yes} (the default), Bacula will recurse (or descend) into all
1599 subdirectories found unless the directory is explicitly excluded using an
1600 {\bf exclude} definition. If you set {\bf recurse=no}, Bacula will save the
1601 subdirectory entries, but not descend into the subdirectories, and thus will
1602 not save the files or directories contained in the subdirectories. Normally,
1603 you will want the default ({\bf yes}).
1605 \item {\bf sparse=yes|no}
1606 \index[dir]{sparse }
1607 Enable special code that checks for sparse files such as created by ndbm. The
1608 default is {\bf no}, so no checks are made for sparse files. You may specify
1609 {\bf sparse=yes} even on files that are not sparse file. No harm will be
1610 done, but there will be a small additional overhead to check for buffers of
1611 all zero, and a small additional amount of space on the output archive will
1612 be used to save the seek address of each non-zero record read.
1614 {\bf Restrictions:} Bacula reads files in 32K buffers. If the whole buffer is
1615 zero, it will be treated as a sparse block and not written to tape. However,
1616 if any part of the buffer is non-zero, the whole buffer will be written to
1617 tape, possibly including some disk sectors (generally 4098 bytes) that are
1618 all zero. As a consequence, Bacula's detection of sparse blocks is in 32K
1619 increments rather than the system block size. If anyone considers this to be
1620 a real problem, please send in a request for change with the reason. The
1621 sparse code was first implemented in version 1.27.
1623 If you are not familiar with sparse files, an example is say a file where you
1624 wrote 512 bytes at address zero, then 512 bytes at address 1 million. The
1625 operating system will allocate only two blocks, and the empty space or hole
1626 will have nothing allocated. However, when you read the sparse file and read
1627 the addresses where nothing was written, the OS will return all zeros as if
1628 the space were allocated, and if you backup such a file, a lot of space will
1629 be used to write zeros to the volume. Worse yet, when you restore the file,
1630 all the previously empty space will now be allocated using much more disk
1631 space. By turning on the {\bf sparse} option, Bacula will specifically look
1632 for empty space in the file, and any empty space will not be written to the
1633 Volume, nor will it be restored. The price to pay for this is that Bacula
1634 must search each block it reads before writing it. On a slow system, this may
1635 be important. If you suspect you have sparse files, you should benchmark the
1636 difference or set sparse for only those files that are really sparse.
1639 \item {\bf readfifo=yes|no}
1640 \index[fd]{readfifo }
1641 If enabled, tells the Client to read the data on a backup and write the data
1642 on a restore to any FIFO (pipe) that is explicitly mentioned in the FileSet.
1643 In this case, you must have a program already running that writes into the
1644 FIFO for a backup or reads from the FIFO on a restore. This can be
1645 accomplished with the {\bf RunBeforeJob} directive. If this is not the case,
1646 Bacula will hang indefinitely on reading/writing the FIFO. When this is not
1647 enabled (default), the Client simply saves the directory entry for the FIFO.
1649 \item {\bf mtimeonly=yes|no}
1650 \index[dir]{mtimeonly }
1651 If enabled, tells the Client that the selection of files during Incremental
1652 and Differential backups should based only on the st\_mtime value in the
1653 stat() packet. The default is {\bf no} which means that the selection of
1654 files to be backed up will be based on both the st\_mtime and the st\_ctime
1655 values. In general, it is not recommended to use this option.
1657 \item {\bf keepatime=yes|no}
1658 \index[dir]{keepatime }
1659 The default is {\bf no}. When enabled, Bacula will reset the st\_atime
1660 (access time) field of files that it backs up to their value prior to the
1661 backup. This option is not generally recommended as there are very few
1662 programs that use st\_atime, and the backup overhead is increased because of
1663 the additional system call necessary to reset the times. (I'm not sure this
1666 \item {\bf wild=\lt{}string\gt{}}
1668 Specifies a wild-card string to be applied to the Files. Note, if {\bf
1669 Exclude} is not enabled, the wild-card will select which files are to be
1670 included. If {\bf Exclude=yes} is specified, the wild-card will select which
1671 files are to be excluded. Multiple wild-card directives may be specified, and
1672 they will be applied in turn until the first one that matches.
1674 \item {\bf regex=\lt{}string\gt{}}
1676 Specifies a POSIX extended regular expression to be applied to the Files.
1677 This directive is available in version 1.35 and later. If {\bf Exclude} is
1678 not enabled, the regex will select which files are to be included. If {\bf
1679 Exclude=yes} is specified, the regex will select which files are to be
1680 excluded. Multiple regex directives may be specified within an Options
1681 resource, and they will be applied in turn until the first one that matches.
1684 \item {\bf exclude=yes|no}
1685 \index[dir]{exclude }
1686 The default is {\bf no}. When enabled, any files matched within the Options
1687 will be excluded from the backup.
1690 \item {\bf aclsupport=yes|no}
1691 \index[dir]{aclsupport }
1692 The default is {\bf no}. If this option is set to yes, and you have the POSIX
1693 {\bf libacl} installed on your system, Bacula will backup the file and
1694 directory UNIX Access Control Lists (ACL) as defined in IEEE Std 1003.1e
1695 draft 17 and ``POSIX.1e'' (abandoned). This feature is available on UNIX only
1696 and depends on the ACL library. Bacula is automatically compiled with ACL
1697 support if the {\bf libacl} library is installed on your system (shown in
1698 config.out). While restoring the files Bacula will try to restore the ACLs,
1699 if there is no ACL support available on the system, Bacula restores the files
1700 and directories but not the ACL information. Please note, if you backup an
1701 EXT3 or XFS filesystem with ACLs, then you restore them to a different
1702 filesystem (perhaps reiserfs) that does not have ACLs, the ACLs will be
1706 {\bf \lt{}file-list\gt{}} is a list of directory and/or filename names
1707 specified with a {\bf File =} directive. To include names containing spaces,
1708 enclose the name between double-quotes.
1710 There are a number of special cases when specifying directories and files in a
1711 {\bf file-list}. They are:
1714 \item Any name preceded by an at-sign (@) is assumed to be the name of a
1715 file, which contains a list of files each preceded by a ``File =''. The named
1716 file is read once when the configuration file is parsed during the Director
1717 startup. Note, that the file is read on the Director's machine and not on
1718 the Client's. In fact, the @filename can appear anywhere within the conf file
1719 where a token would be read, and the contents of the named file will be
1720 logically inserted in the place of the @filename. What must be in the file
1721 depends on the location the @filename is specified in the conf file.
1722 \item Any name beginning with a vertical bar (|) is assumed to be the name of
1723 a program. This program will be executed on the Director's machine at the
1724 time the Job starts (not when the Director reads the configuration file), and
1725 any output from that program will be assumed to be a list of files or
1726 directories, one per line, to be included. This allows you to have a job that
1727 for example includes all the local partitions even if you change the
1728 partitioning by adding a disk. In general, you will need to prefix your
1729 command or commands with a {\bf sh -c} so that they are invoked by a shell.
1730 This will not be the case if you are invoking a script as in the second
1731 example below. Also, you must take care to escape (precede with a
1732 \textbackslash{}) wild-cards, shell character, and to ensure that any spaces
1733 in your command are escaped as well. If you use a single quotes (') within a
1734 double quote (``), Bacula will treat everything between the single quotes as
1735 one field so it will not be necessary to escape the spaces. In general,
1736 getting all the quotes and escapes correct is a real pain as you can see by
1737 the next example. As a consequence, it is often easier to put everything in a
1738 file and simply use the file name within Bacula. In that case the {\bf sh
1739 -c} will not be necessary providing the first line of the file is {\bf
1748 Options { signature = SHA1 }
1749 File = "|sh -c 'df -l | grep \"^/dev/hd[ab]\" | grep -v \".*/tmp\" \
1750 | awk \"{print \\$6}\"'"
1755 will produce a list of all the local partitions on a RedHat Linux system.
1756 Note, the above line was split, but should normally be written on one line.
1757 Quoting is a real problem because you must quote for Bacula which consists of
1758 preceding every \textbackslash{} and every '' with a \textbackslash{}, and
1759 you must also quote for the shell command. In the end, it is probably easier
1760 just to execute a small file with:
1768 File = "|my_partitions"
1773 where my\_partitions has:
1778 df -l | grep "^/dev/hd[ab]" | grep -v ".*/tmp" \
1783 If the vertical bar (|) in front of my\_partitions is preceded by a backslash
1784 as in \textbackslash{}|, the program will be executed on the Client's machine
1785 instead of on the Director's machine -- (this is implemented but not
1786 thoroughly tested, and is reported to work on Windows). Please note that if
1787 the filename is given within quotes, you will need to use two slashes. An
1788 example, provided by John Donagher, that backs up all the local UFS
1789 partitions on a remote system is:
1794 Name = "All local partitions"
1796 Options { signature=SHA1; onefs=yes; }
1797 File = "\\|bash -c \"df -klF ufs | tail +2 | awk '{print \$6}'\""
1803 Note, it requires two backslash characters after the double quote (one
1804 preserves the next one). If you are a Linux user, just change the {\bf ufs}
1805 to {\bf ext3} (or your preferred filesystem type) and you will be in
1807 \item Any file-list item preceded by a less-than sign (\lt{}) will be taken
1808 to be a file. This file will be read on the Director's machine at the time
1809 the Job starts, and the data will be assumed to be a list of directories or
1810 files, one per line, to be included. The names should not be quoted even if
1811 they contain spaces. This feature allows you to modify the external file and
1812 change what will be saved without stopping and restarting Bacula as would be
1813 necessary if using the @ modifier noted above.
1815 If you precede the less-than sign (\lt{}) with a backslash as in
1816 \textbackslash{}\lt{}, the file-list will be read on the Client machine
1817 instead of on the Director's machine. Please note that if the filename is
1818 given within quotes, you will need to use two slashes.
1819 \item If you explicitly specify a block device such as {\bf /dev/hda1}, then
1820 Bacula (starting with version 1.28) will assume that this is a raw partition
1821 to be backed up. In this case, you are strongly urged to specify a {\bf
1822 sparse=yes} include option, otherwise, you will save the whole partition
1823 rather than just the actual data that the partition contains. For example:
1828 Options { signature=MD5; sparse=yes }
1834 will backup the data in device /dev/hd6.
1836 Ludovic Strappazon has pointed out that this feature can be used to backup a
1837 full Microsoft Windows disk. Simply boot into the system using a Linux Rescue
1838 disk, then load a statically linked Bacula as described in the
1839 \ilink{ Disaster Recovery Using Bacula}{_ChapterStart38} chapter of
1840 this manual. Then save the whole disk partition. In the case of a disaster,
1841 you can then restore the desired partition by again booting with the rescue
1842 disk and doing a restore of the partition.
1843 \item If you explicitly specify a FIFO device name (created with mkfifo), and
1844 you add the option {\bf readfifo=yes} as an option, Bacula will read the FIFO
1845 and back its data up to the Volume. For example:
1854 File = /home/abc/fifo
1859 if {\bf /home/abc/fifo} is a fifo device, Bacula will open the fifo, read it,
1860 and store all data thus obtained on the Volume. Please note, you must have a
1861 process on the system that is writing into the fifo, or Bacula will hang,
1862 and after one minute of waiting, Bacula will give up and go on to the next
1863 file. The data read can be anything since Bacula treats it as a stream.
1865 This feature can be an excellent way to do a ``hot'' backup of a very large
1866 database. You can use the {\bf RunBeforeJob} to create the fifo and to start
1867 a program that dynamically reads your database and writes it to the fifo.
1868 Bacula will then write it to the Volume.
1870 During the restore operation, the inverse is true, after Bacula creates the
1871 fifo if there was any data stored with it (no need to explicitly list it or
1872 add any options), that data will be written back to the fifo. As a
1873 consequence, if any such FIFOs exist in the fileset to be restored, you must
1874 ensure that there is a reader program or Bacula will block, and after one
1875 minute, Bacula will time out the write to the fifo and move on to the next
1881 The following is an example of a valid FileSet resource definition. Note, the
1882 first Include pulls in the contents of the file {\bf /etc/backup.list} when
1883 Bacula is started (i.e. the @).
1895 File = @/etc/backup.list
1903 File = /usr/lib/another_file
1909 Note, in the above example, all the files contained in /etc/backup.list will
1910 be compressed with GZIP compression, an SHA1 signature will be computed on the
1911 file's contents (its data), and sparse file handling will apply.
1913 The two directories /root/myfile and /usr/lib/another\_file will also be saved
1914 without any options, but all files in those directories with the extension
1915 {\bf .o} will be excluded.
1917 Suppose you want to save everything except {\bf /tmp} on your system. Doing a
1918 {\bf df} command, you get the following output:
1923 Filesystem 1k-blocks Used Available Use% Mounted on
1924 /dev/hda5 5044156 439232 4348692 10% /
1925 /dev/hda1 62193 4935 54047 9% /boot
1926 /dev/hda9 20161172 5524660 13612372 29% /home
1927 /dev/hda2 62217 6843 52161 12% /rescue
1928 /dev/hda8 5044156 42548 4745376 1% /tmp
1929 /dev/hda6 5044156 2613132 2174792 55% /usr
1930 none 127708 0 127708 0% /dev/shm
1931 //minimatou/c$ 14099200 9895424 4203776 71% /mnt/mmatou
1932 lmatou:/ 1554264 215884 1258056 15% /mnt/matou
1933 lmatou:/home 2478140 1589952 760072 68% /mnt/matou/home
1934 lmatou:/usr 1981000 1199960 678628 64% /mnt/matou/usr
1935 lpmatou:/ 995116 484112 459596 52% /mnt/pmatou
1936 lpmatou:/home 19222656 2787880 15458228 16% /mnt/pmatou/home
1937 lpmatou:/usr 2478140 2038764 311260 87% /mnt/pmatou/usr
1938 deuter:/ 4806936 97684 4465064 3% /mnt/deuter
1939 deuter:/home 4806904 280100 4282620 7% /mnt/deuter/home
1940 deuter:/files 44133352 27652876 14238608 67% /mnt/deuter/files
1944 If you specify only {\bf /} in your Include list, Bacula will only save the
1945 Filesystem {\bf /dev/hda5}. To save all file systems except {\bf /tmp} with
1946 out including any of the Samba or NFS mounted systems, and explicitly
1947 excluding a /tmp, /proc, .journal, and .autofsck, which you will not want to
1948 be saved and restored, you can use the following:
1953 Name = Include_example
1972 Since /tmp is on its own filesystem and it was not explicitly named in the
1973 Include list, it is not really needed in the exclude list. It is better to
1974 list it in the Exclude list for clarity, and in case the disks are changed so
1975 that it is no longer in its own partition.
1977 Please be aware that allowing Bacula to traverse or change file systems can be
1978 {\bf very} dangerous. For example, with the following:
1983 Name = "Bad example"
1985 Options { onefs=no }
1992 you will be backing up an NFS mounted partition ({\bf /mnt/matou}), and since
1993 {\bf onefs} is set to {\bf no}, Bacula will traverse file systems. Now if {\bf
1994 /mnt/matou} has the current machine's file systems mounted, as is often the
1995 case, you will get yourself into a recursive loop and the backup will never
1998 The following FileSet definition will backup a raw partition:
2003 Name = "RawPartition"
2005 Options { sparse=yes }
2012 While backing up and restoring a raw partition, you should ensure that no
2013 other process including the system is writing to that partition. As a
2014 precaution, you are strongly urged to ensure that the raw partition is not
2015 mounted or is mounted read-only. If necessary, this can be done using the {\bf
2016 RunBeforeJob} directive.
2019 \subsection*{Windows Considerations for FileSets}
2020 \index[general]{FileSets!Windows Considerations for }
2021 \index[general]{Windows Considerations for FileSets }
2022 \addcontentsline{toc}{subsection}{Windows Considerations for FileSets}
2024 If you are entering Windows file names, the directory path may be preceded by
2025 the drive and a colon (as in c:). However, the path separators must be
2026 specified in Unix convention (i.e. forward slash (/)). If you wish to include
2027 a quote in a file name, precede the quote with a backslash
2028 (\textbackslash{}\textbackslash{}). For example you might use the following
2029 for a Windows machine to backup the ``My Documents'' directory:
2034 Name = "Windows Set"
2041 File = "c:/My Documents"
2047 For exclude lists to work correctly on Windows, you must observe the following
2051 \item Filenames are case sensitive, so you must use the correct case.
2052 \item To exclude a directory, you must not have a trailing slash on the
2054 \item If you have spaces in your filename, you must enclose the entire name
2055 in double-quote characters (``). Trying to use a backslash before the space
2057 \item If you are using the old Exclude syntax (noted below), you may not
2058 specify a drive letter in the exclude. The new syntax noted above should work
2059 fine including driver letters.
2062 Thanks to Thiago Lima for summarizing the above items for us. If you are
2063 having difficulties getting includes or excludes to work, you might want to
2064 try using the {\bf estimate job=xxx listing} command documented in the
2065 \ilink{Console chapter}{estimate} of this manual.
2067 On Win32 systems, if you move a directory or file or rename a file into the
2068 set of files being backed up, and a Full backup has already been made, Bacula
2069 will not know there are new files to be saved during an Incremental or
2070 Differential backup (blame Microsoft, not me). To avoid this problem, please
2071 {\bf copy} any new directory or files into the backup area. If you do not have
2072 enough disk to copy the directory or files, move them, but then initiate a
2075 \subsubsection*{Excluding Files and Directories}
2076 \index[general]{Directories!Excluding Files and }
2077 \index[general]{Excluding Files and Directories }
2078 \addcontentsline{toc}{subsubsection}{Excluding Files and Directories}
2080 You may also include full filenames or directory names in addition to using
2081 wild-cards and {\bf Exclude=yes} in the Options resource as specified above by
2082 simply including the files to be excluded in an Exclude resource within the
2083 FileSet. For example:
2088 Name = Exclusion_example
2109 \subsection*{A Windows Example FileSet}
2110 \index[general]{FileSet!Windows Example }
2111 \index[general]{Windows Example FileSet }
2112 \addcontentsline{toc}{subsection}{Windows Example FileSet}
2114 The following example was contributed by Phil Stracchino:
2118 This is my Windows 2000 fileset:
2120 Name = "Windows 2000 Full Set"
2128 # Most of these files are excluded not because we don't want
2129 # them, but because Win2K won't allow them to be backed up
2130 # except via proprietary Win32 API calls.
2131 File = "/Documents and Settings/*/Application Data/*/Profiles/
2133 File = "/Documents and Settings/*/Local Settings/Application Data/
2134 Microsoft/Windows/[Uu][Ss][Rr][Cc][Ll][Aa][Ss][Ss].*"
2135 File = "/Documents and Settings/*/[Nn][Tt][Uu][Ss][Ee][Rr].*"
2136 File = "/Documents and Settings/*/Cookies/*"
2137 File = "/Documents and Settings/*/Local Settings/History/*"
2138 File = "/Documents and Settings/*/Local Settings/
2139 Temporary Internet Files/*"
2140 File = "/Documents and Settings/*/Local Settings/Temp/*"
2142 File = "/WINNT/security/logs/scepol.log"
2143 File = "/WINNT/system32/config/*"
2144 File = "/WINNT/msdownld.tmp/*"
2145 File = "/WINNT/Internet Logs/*"
2146 File = "/WINNT/$Nt*Uninstall*"
2147 File = "/WINNT/Temp/*"
2150 File = "/pagefile.sys"
2156 Note, the three line of the above Exclude were split to fit on the document
2157 page, they should be written on a single line in real use.
2159 \subsection*{The Old FileSet Resource}
2160 \index[general]{Resource!Old FileSet }
2161 \index[general]{Old FileSet Resource }
2162 \addcontentsline{toc}{subsection}{Old FileSet Resource}
2164 The old pre-version 1.34.3 FileSet Resource has been deprecated but will still
2165 work. You are encouraged to convert to using the new form since the old code
2166 will be removed in version 1.37.
2168 \subsection*{Testing Your FileSet}
2169 \index[general]{FileSet!Testing Your }
2170 \index[general]{Testing Your FileSet }
2171 \addcontentsline{toc}{subsection}{Testing Your FileSet}
2173 If you wish to get an idea of what your FileSet will really backup or if your
2174 exclusion rules will work correctly, you can test it by using the {\bf
2175 estimate} command in the Console program. See the
2176 \ilink{estimate command}{estimate} in the Console chapter of this
2179 \subsection*{Windows NTFS Naming Considerations}
2180 \index[general]{Windows NTFS Naming Considerations }
2181 \index[general]{Considerations!Windows NTFS Naming }
2182 \addcontentsline{toc}{subsection}{Windows NTFS Naming Considerations}
2184 NTFS filenames containing Unicode characters (i.e. \gt{} 0xFF) cannot be
2185 explicitly named at the moment. You must include such names by naming a higher
2186 level directory or a drive letter that does not contain Unicode characters.
2188 \section*{The Client Resource}
2189 \label{ClientResource2}
2190 \index[general]{Resource!Client }
2191 \index[general]{Client Resource }
2192 \addcontentsline{toc}{section}{Client Resource}
2194 The Client resource defines the attributes of the Clients that are served by
2195 this Director; that is the machines that are to be backed up. You will need
2196 one Client resource definition for each machine to be backed up.
2200 \item [Client (or FileDaemon)]
2201 \index[dir]{Client (or FileDaemon) }
2202 Start of the Client directives.
2204 \item [Name = \lt{}name\gt{}]
2206 The client name which will be used in the Job resource directive or in the
2207 console run command. This directive is required.
2209 \item [Address = \lt{}address\gt{}]
2210 \index[console]{Address }
2211 Where the address is a host name, a fully qualified domain name, or a network
2212 address in dotted quad notation for a Bacula File server daemon. This
2213 directive is required.
2215 \item [FD Port = \lt{}port-number\gt{}]
2216 \index[console]{FD Port }
2217 Where the port is a port number at which the Bacula File server daemon can be
2218 contacted. The default is 9102.
2220 \item [Catalog = \lt{}Catalog-resource-name\gt{}]
2221 \index[console]{Catalog }
2222 This specifies the name of the catalog resource to be used for this Client.
2223 This directive is required.
2225 \item [Password = \lt{}password\gt{}]
2226 \index[console]{Password }
2227 This is the password to be used when establishing a connection with the File
2228 services, so the Client configuration file on the machine to be backed up
2229 must have the same password defined for this Director. This directive is
2230 required. If you have either {\bf /dev/random} {\bf bc} on your machine,
2231 Bacula will generate a random password during the configuration process,
2232 otherwise it will be left blank.
2233 \label{FileRetention}
2235 \item [File Retention = \lt{}time-period-specification\gt{} ]
2236 \index[fd]{File Retention }
2237 The File Retention directive defines the length of time that Bacula will keep
2238 File records in the Catalog database. When this time period expires, and if
2239 {\bf AutoPrune} is set to {\bf yes} Bacula will prune (remove) File records
2240 that are older than the specified File Retention period. Note, this affects
2241 only records in the catalog database. It does not effect your archive
2244 File records may actually be retained for a shorter period than you specify
2245 on this directive if you specify either a shorter {\bf Job Retention} or
2246 shorter {\bf Volume Retention} period. The shortest retention period of the
2247 three takes precedence. The time may be expressed in seconds, minutes,
2248 hours, days, weeks, months, quarters, or years. See the
2249 \ilink{ Configuration chapter}{Time} of this manual for
2250 additional details of time specification.
2252 The default is 60 days.
2253 \label{JobRetention}
2255 \item [Job Retention = \lt{}time-period-specification\gt{} ]
2256 \index[fd]{Job Retention }
2257 The Job Retention directive defines the length of time that Bacula will keep
2258 Job records in the Catalog database. When this time period expires, and if
2259 {\bf AutoPrune} is set to {\bf yes} Bacula will prune (remove) Job records
2260 that are older than the specified File Retention period. As with the other
2261 retention periods, this affects only records in the catalog and not data in
2262 your archive backup.
2264 If a Job record is selected for pruning, all associated File and JobMedia
2265 records will also be pruned regardless of the File Retention period set. As a
2266 consequence, you normally will set the File retention period to be less than
2267 the Job retention period. The Job retention period can actually be less than
2268 the value you specify here if you set the {\bf Volume Retention} directive in
2269 the Pool resource to a smaller duration. This is because the Job retention
2270 period and the Volume retention period are independently applied, so the
2271 smaller of the two takes precedence.
2273 The Job retention period is specified as seconds, minutes, hours, days,
2274 weeks, months, quarters, or years. See the
2275 \ilink{ Configuration chapter}{Time} of this manual for
2276 additional details of time specification.
2278 The default is 180 days.
2281 \item [AutoPrune = \lt{}yes|no\gt{}]
2282 \index[fd]{AutoPrune }
2283 If AutoPrune is set to {\bf yes} (default), Bacula (version 1.20 or greater)
2284 will automatically apply the File retention period and the Job retention
2285 period for the Client at the end of the Job. If you set {\bf AutoPrune = no},
2286 pruning will not be done, and your Catalog will grow in size each time you
2287 run a Job. Pruning affects only information in the catalog and not data
2288 stored in the backup archives (on Volumes).
2290 \item [Maximum Concurrent Jobs = \lt{}number\gt{}]
2291 \index[fd]{Maximum Concurrent Jobs }
2292 where \lt{}number\gt{} is the maximum number of Jobs with the current Client
2293 that can run concurrently. Note, this directive limits only Jobs for Clients
2294 with the same name as the resource in which it appears. Any other
2295 restrictions on the maximum concurrent jobs such as in the Director, Job, or
2296 Storage resources will also apply in addition to any limit specified here.
2297 The default is set to 1, but you may set it to a larger number. We strongly
2298 recommend that you read the WARNING documented under
2299 \ilink{ Maximum Concurrent Jobs}{DirMaxConJobs} in the Director's
2302 \item [*Priority = \lt{}number\gt{}]
2303 \index[fd]{*Priority }
2304 The number specifies the priority of this client relative to other clients
2305 that the Director is processing simultaneously. The priority can range from
2306 1 to 1000. The clients are ordered such that the smaller number priorities
2307 are performed first (not currently implemented).
2310 The following is an example of a valid Client resource definition:
2318 Password = very_good
2323 \section*{The Storage Resource}
2324 \label{StorageResource2}
2325 \index[general]{Resource!Storage }
2326 \index[general]{Storage Resource }
2327 \addcontentsline{toc}{section}{Storage Resource}
2329 The Storage resource defines which Storage daemons are available for use by
2335 \index[fd]{Storage }
2336 Start of the Storage resources. At least one storage resource must be
2339 \item [Name = \lt{}name\gt{}]
2341 The name of the storage resource. This name appears on the Storage directive
2342 specified in the Job directive and is required.
2344 \item [Address = \lt{}address\gt{}]
2345 \index[sd]{Address }
2346 Where the address is a host name, a {\bf fully qualified domain name}, or an
2347 {\bf IP address}. Please note that the \lt{}address\gt{} as specified here
2348 will be transmitted to the File daemon who will then use it to contact the
2349 Storage daemon. Hence, it is {\bf not}, a good idea to use {\bf localhost} as
2350 the name but rather a fully qualified machine name or an IP address. This
2351 directive is required.
2353 \item [SD Port = \lt{}port\gt{}]
2354 \index[sd]{SD Port }
2355 Where port is the port to use to contact the storage daemon for information
2356 and to start jobs. This same port number must appear in the Storage resource
2357 of the Storage daemon's configuration file. The default is 9103.
2359 \item [Password = \lt{}password\gt{}]
2360 \index[sd]{Password }
2361 This is the password to be used when establishing a connection with the
2362 Storage services. This same password also must appear in the Director
2363 resource of the Storage daemon's configuration file. This directive is
2364 required. If you have either {\bf /dev/random} {\bf bc} on your machine,
2365 Bacula will generate a random password during the configuration process,
2366 otherwise it will be left blank.
2368 \item [Device = \lt{}device-name\gt{}]
2370 This directive specifies the name of the device to be used to for the
2371 storage. This name is not the physical device name, but the logical device
2372 name as defined on the {\bf Name} directive contained in the {\bf Device}
2373 resource definition of the {\bf Storage daemon} configuration file. You can
2374 specify any name you would like (even the device name if you prefer) up to a
2375 maximum of 127 characters in length. The physical device name associated with
2376 this device is specified in the {\bf Storage daemon} configuration file (as
2377 {\bf Archive Device}). Please take care not to define two different Storage
2378 resource directives in the Director that point to the same Device in the
2379 Storage daemon. Doing so may cause the Storage daemon to block (or hang)
2380 attempting to open the same device that is already open. This directive is
2383 \item [Media Type = \lt{}MediaType\gt{}]
2384 \index[fd]{Media Type }
2385 This directive specifies the Media Type to be used to store the data. This is
2386 an arbitrary string of characters up to 127 maximum that you define. It can
2387 be anything you want. However, it is best to make it descriptive of the
2388 storage media (e.g. File, DAT, ''HP DLT8000``, 8mm, ...). In addition, it is
2389 essential that you make the {\bf Media Type} specification unique for each
2390 storage media type. If you have two DDS-4 drives that have incompatible
2391 formats, or if you have a DDS-4 drive and a DDS-4 autochanger, you almost
2392 certainly should specify different {\bf Media Types}. During a restore,
2393 assuming a {\bf DDS-4} Media Type is associated with the Job, Bacula can
2394 decide to use any Storage daemon that support Media Type {\bf DDS-4} and on
2395 any drive supports it. If you want to tie Bacula to using a single Storage
2396 daemon or drive, you must specify a unique Media Type for that drive. This is
2397 an important point that should be carefully understood. You can find more on
2399 \ilink{Basic Volume Management}{_ChapterStart39} chapter of this
2402 The {\bf MediaType} specified here, {\bf must} correspond to the {\bf Media
2403 Type} specified in the {\bf Device} resource of the {\bf Storage daemon}
2404 configuration file. This directive is required, and it is used by the
2405 Director and the Storage daemon to ensure that a Volume automatically
2406 selected from the Pool corresponds to the physical device. If a Storage
2407 daemon handles multiple devices (e.g. will write to various file Volumes on
2408 different partitions), this directive allows you to specify exactly which
2411 As mentioned above, the value specified in the Director's Storage resource
2412 must agree with the value specified in the Device resource in the {\bf
2413 Storage daemon's} configuration file. It is also an additional check so that
2414 you don't try to write data for a DLT onto an 8mm device.
2415 \label{Autochanger1}
2417 \item [Autochanger = \lt{}yes|no\gt{} ]
2418 \index[fd]{Autochanger }
2419 If you specify {\bf yes} for this command (the default is {\bf no}), when you
2420 use the {\bf label} command or the {\bf add} command to create a new Volume,
2421 {\bf Bacula} will also request the Autochanger Slot number. This simplifies
2422 creating database entries for Volumes in an autochanger. If you forget to
2423 specify the Slot, the autochanger will not be used. However, you may modify
2424 the Slot associated with a Volume at any time by using the {\bf update
2425 volume} command in the console program. When {\bf autochanger} is enabled,
2426 the algorithm used by Bacula to search for available volumes will be modified
2427 to consider only Volumes that are known to be in the autochanger's magazine.
2428 If no {\bf in changer} volume is found, Bacula will attempt recycling,
2429 pruning, ..., and if still no volume is found, Bacula will search for any
2430 volume whether or not in the magazine. By privileging in changer volumes,
2431 this procedure minimizes operator intervention. The default is {\bf no}.
2433 For the autochanger to be used, you must also specify {\bf Autochanger = yes}
2435 \ilink{Device Resource}{Autochanger} in the Storage daemon's
2436 configuration file as well as other important Storage daemon configuration
2437 information. Please consult the
2438 \ilink{ Using Autochangers}{_ChapterStart18} manual of this
2439 chapter for the details of using autochangers.
2441 \item [Maximum Concurrent Jobs = \lt{}number\gt{}]
2442 \index[fd]{Maximum Concurrent Jobs }
2443 where \lt{}number\gt{} is the maximum number of Jobs with the current Storage
2444 resource that can run concurrently. Note, this directive limits only Jobs
2445 for Jobs using this Storage daemon. Any other restrictions on the maximum
2446 concurrent jobs such as in the Director, Job, or Client resources will also
2447 apply in addition to any limit specified here. The default is set to 1, but
2448 you may set it to a larger number. We strongly recommend that you read the
2449 WARNING documented under
2450 \ilink{ Maximum Concurrent Jobs}{DirMaxConJobs} in the Director's
2453 While it is possible to set the Director's, Job's, or Client's maximum
2454 concurrent jobs greater than one, you should take great care in setting the
2455 Storage daemon's greater than one. By keeping this directive set to one, you
2456 will avoid having two jobs simultaneously write to the same Volume. Although
2457 this is supported, it is not currently recommended.
2460 The following is an example of a valid Storage resource definition:
2464 # Definition of tape storage device
2468 Password = storage_password # password for Storage daemon
2469 Device = "HP DLT 80" # same as Device in Storage daemon
2470 Media Type = DLT8000 # same as MediaType in Storage daemon
2475 \section*{The Pool Resource}
2476 \label{PoolResource}
2477 \index[general]{Resource!Pool }
2478 \index[general]{Pool Resource }
2479 \addcontentsline{toc}{section}{Pool Resource}
2481 The Pool resource defines the set of storage Volumes (tapes or files) to be
2482 used by Bacula to write the data. By configuring different Pools, you can
2483 determine which set of Volumes (media) receives the backup data. This permits,
2484 for example, to store all full backup data on one set of Volumes and all
2485 incremental backups on another set of Volumes. Alternatively, you could assign
2486 a different set of Volumes to each machine that you backup. This is most
2487 easily done by defining multiple Pools.
2489 Another important aspect of a Pool is that it contains the default attributes
2490 (Maximum Jobs, Retention Period, Recycle flag, ...) that will be given to a
2491 Volume when it is created. This avoids the need for you to answer a large
2492 number of questions when labeling a new Volume. Each of these attributes can
2493 later be changed on a Volume by Volume basis using the {\bf update} command in
2494 the console program. Note that you must explicitly specify which Pool Bacula
2495 is to use with each Job. Bacula will not automatically search for the correct
2498 Most often in Bacula installations all backups for all machines (Clients) go
2499 to a single set of Volumes. In this case, you will probably only use the {\bf
2500 Default} Pool. If your backup strategy calls for you to mount a different tape
2501 each day, you will probably want to define a separate Pool for each day. For
2502 more information on this subject, please see the
2503 \ilink{Backup Strategies}{_ChapterStart3} chapter of this
2506 To use a Pool, there are three distinct steps. First the Pool must be defined
2507 in the Director's configuration file. Then the Pool must be written to the
2508 Catalog database. This is done automatically by the Director each time that it
2509 starts, or alternatively can be done using the {\bf create} command in the
2510 console program. Finally, if you change the Pool definition in the Director's
2511 configuration file and restart Bacula, the pool will be updated alternatively
2512 you can use the {\bf update pool} console command to refresh the database
2513 image. It is this database image rather than the Director's resource image
2514 that is used for the default Volume attributes. Note, for the pool to be
2515 automatically created or updated, it must be explicitly referenced by a Job
2518 Next the physical media must be labeled. The labeling can either be done with
2519 the {\bf label} command in the {\bf console} program or using the {\bf btape}
2520 program. The preferred method is to use the {\bf label} command in the {\bf
2523 Finally, you must add Volume names (and their attributes) to the Pool. For
2524 Volumes to be used by Bacula they must be of the same {\bf Media Type} as the
2525 archive device specified for the job (i.e. if you are going to back up to a
2526 DLT device, the Pool must have DLT volumes defined since 8mm volumes cannot be
2527 mounted on a DLT drive). The {\bf Media Type} has particular importance if you
2528 are backing up to files. When running a Job, you must explicitly specify which
2529 Pool to use. Bacula will then automatically select the next Volume to use from
2530 the Pool, but it will ensure that the {\bf Media Type} of any Volume selected
2531 from the Pool is identical to that required by the Storage resource you have
2532 specified for the Job.
2534 If you use the {\bf label} command in the console program to label the
2535 Volumes, they will automatically be added to the Pool, so this last step is
2536 not normally required.
2538 It is also possible to add Volumes to the database without explicitly labeling
2539 the physical volume. This is done with the {\bf add} console command.
2541 As previously mentioned, each time Bacula starts, it scans all the Pools
2542 associated with each Catalog, and if the database record does not already
2543 exist, it will be created from the Pool Resource definition. {\bf Bacula}
2544 probably should do an {\bf update pool} if you change the Pool definition, but
2545 currently, you must do this manually using the {\bf update pool} command in
2546 the Console program.
2548 The Pool Resource defined in the Director's configuration file
2549 (bacula-dir.conf) may contain the following directives:
2555 Start of the Pool resource. There must be at least one Pool resource defined.
2558 \item [Name = \lt{}name\gt{}]
2560 The name of the pool. For most applications, you will use the default pool
2561 name {\bf Default}. This directive is required.
2563 \item [Number of Volumes = \lt{}number\gt{}]
2564 \index[dir]{Number of Volumes }
2565 This directive specifies the number of volumes (tapes or files) contained in
2566 the pool. Normally, it is defined and updated automatically by the Bacula
2567 catalog handling routines.
2570 \item [Maximum Volumes = \lt{}number\gt{}]
2571 \index[dir]{Maximum Volumes }
2572 This directive specifies the maximum number of volumes (tapes or files)
2573 contained in the pool. This directive is optional, if omitted or set to zero,
2574 any number of volumes will be permitted. In general, this directive is useful
2575 for Autochangers where there is a fixed number of Volumes, or for File
2576 storage where you wish to ensure that the backups made to disk files do not
2577 become too numerous or consume too much space.
2579 \item [Pool Type = \lt{}type\gt{}]
2580 \index[dir]{Pool Type }
2581 This directive defines the pool type, which corresponds to the type of Job
2582 being run. It is required and may be one of the following:
2593 \item [Use Volume Once = \lt{}yes|no\gt{}]
2594 \index[dir]{Use Volume Once }
2595 This directive if set to {\bf yes} specifies that each volume is to be used
2596 only once. This is most useful when the Media is a file and you want a new
2597 file for each backup that is done. The default is {\bf no} (i.e. use volume
2598 any number of times). This directive will most likely be phased out
2599 (deprecated), so you are recommended to use {\bf Maximum Volume Jobs = 1}
2602 Please note that the value defined by this directive in the bacula-dir.conf
2603 file is the default value used when a Volume is created. Once the volume is
2604 created, changing the value in the bacula-dir.conf file will not change what
2605 is stored for the Volume. To change the value for an existing Volume you
2606 must use the {\bf update} command in the Console.
2608 \item [Maximum Volume Jobs = \lt{}positive-integer\gt{}]
2609 \index[fd]{Maximum Volume Jobs }
2610 This directive specifies the maximum number of Jobs that can be written to
2611 the Volume. If you specify zero (the default), there is no limit. Otherwise,
2612 when the number of Jobs backed up to the Volume equals {\bf positive-integer}
2613 the Volume will be marked {\bf Used}. When the Volume is marked {\bf Used} it
2614 can no longer be used for appending Jobs, much like the {\bf Full} status but
2615 it can be recycled if recycling is enabled. By setting {\bf
2616 MaximumVolumeJobs} to one, you get the same effect as setting {\bf
2617 UseVolumeOnce = yes}.
2619 Please note that the value defined by this directive in the bacula-dir.conf
2620 file is the default value used when a Volume is created. Once the volume is
2621 created, changing the value in the bacula-dir.conf file will not change what
2622 is stored for the Volume. To change the value for an existing Volume you
2623 must use the {\bf update} command in the Console.
2625 \item [Maximum Volume Files = \lt{}positive-integer\gt{}]
2626 \index[fd]{Maximum Volume Files }
2627 This directive specifies the maximum number of files that can be written to
2628 the Volume. If you specify zero (the default), there is no limit. Otherwise,
2629 when the number of files written to the Volume equals {\bf positive-integer}
2630 the Volume will be marked {\bf Used}. When the Volume is marked {\bf Used} it
2631 can no longer be used for appending Jobs, much like the {\bf Full} status but
2632 it can be recycled if recycling is enabled. This value is checked and the
2633 {\bf Used} status is set only at the end of a job that writes to the
2636 Please note that the value defined by this directive in the bacula-dir.conf
2637 file is the default value used when a Volume is created. Once the volume is
2638 created, changing the value in the bacula-dir.conf file will not change what
2639 is stored for the Volume. To change the value for an existing Volume you
2640 must use the {\bf update} command in the Console.
2642 \item [Maximum Volume Bytes = \lt{}size\gt{}]
2643 \index[fd]{Maximum Volume Bytes }
2644 This directive specifies the maximum number of bytes that can be written to
2645 the Volume. If you specify zero (the default), there is no limit except the
2646 physical size of the Volume. Otherwise, when the number of bytes written to
2647 the Volume equals {\bf size} the Volume will be marked {\bf Used}. When the
2648 Volume is marked {\bf Used} it can no longer be used for appending Jobs, much
2649 like the {\bf Full} status but it can be recycled if recycling is enabled.
2650 This value is checked and the {\bf Used} status set while the job is writing
2651 to the particular volume.
2653 Please note that the value defined by this directive in the bacula-dir.conf
2654 file is the default value used when a Volume is created. Once the volume is
2655 created, changing the value in the bacula-dir.conf file will not change what
2656 is stored for the Volume. To change the value for an existing Volume you
2657 must use the {\bf update} command in the Console.
2659 \item [Volume Use Duration = \lt{}time-period-specification\gt{}]
2660 \index[fd]{Volume Use Duration }
2661 The Volume Use Duration directive defines the time period that the Volume can
2662 be written beginning from the time of first data write to the Volume. If the
2663 time-period specified is zero (the default), the Volume can be written
2664 indefinitely. Otherwise, when the time period from the first write to the
2665 volume (the first Job written) exceeds the time-period-specification, the
2666 Volume will be marked {\bf Used}, which means that no more Jobs can be
2667 appended to the Volume, but it may be recycled if recycling is enabled.
2669 You might use this directive, for example, if you have a Volume used for
2670 Incremental backups, and Volumes used for Weekly Full backups. Once the Full
2671 backup is done, you will want to use a different Incremental Volume. This can
2672 be accomplished by setting the Volume Use Duration for the Incremental Volume
2673 to six days. I.e. it will be used for the 6 days following a Full save, then
2674 a different Incremental volume will be used.
2676 This value is checked and the {\bf Used} status is set only at the end of a
2677 job that writes to the particular volume, which means that even though the
2678 use duration may have expired, the catalog entry will not be updated until
2679 the next job that uses this volume is run.
2681 Please note that the value defined by this directive in the bacula-dir.conf
2682 file is the default value used when a Volume is created. Once the volume is
2683 created, changing the value in the bacula-dir.conf file will not change what
2684 is stored for the Volume. To change the value for an existing Volume you
2685 must use the {\bf update} command in the Console.
2687 \item [Catalog Files = \lt{}yes|no\gt{}]
2688 \index[fd]{Catalog Files }
2689 This directive defines whether or not you want the names of the files that
2690 were saved to be put into the catalog. The default is {\bf yes}. The
2691 advantage of specifying {\bf Catalog Files = No} is that you will have a
2692 significantly smaller Catalog database. The disadvantage is that you will not
2693 be able to produce a Catalog listing of the files backed up for each Job
2694 (this is often called Browsing). Also, without the File entries in the
2695 catalog, you will not be able to use the Console {\bf restore} command nor
2696 any other command that references File entries.
2697 \label{PoolAutoPrune}
2699 \item [AutoPrune = \lt{}yes|no\gt{}]
2700 \index[fd]{AutoPrune }
2701 If AutoPrune is set to {\bf yes} (default), Bacula (version 1.20 or greater)
2702 will automatically apply the Volume Retention period when new Volume is
2703 needed and no appendable Volumes exist in the Pool. Volume pruning causes
2704 expired Jobs (older than the {\bf Volume Retention} period) to be deleted
2705 from the Catalog and permits possible recycling of the Volume.
2706 \label{VolRetention}
2708 \item [Volume Retention = \lt{}time-period-specification\gt{}]
2709 \index[fd]{Volume Retention }
2710 The Volume Retention directive defines the length of time that {\bf Bacula}
2711 will keep Job records associated with the Volume in the Catalog database.
2712 When this time period expires, and if {\bf AutoPrune} is set to {\bf yes}
2713 Bacula will prune (remove) Job records that are older than the specified
2714 Volume Retention period. All File records associated with pruned Jobs are
2715 also pruned. The time may be specified as seconds, minutes, hours, days,
2716 weeks, months, quarters, or years. The {\bf Volume Retention} applied
2717 independently to the {\bf Job Retention} and the {\bf File Retention} periods
2718 defined in the Client resource. This means that the shorter period is the
2719 one that applies. Note, that when the {\bf Volume Retention} period has been
2720 reached, it will prune both the Job and the File records.
2722 The default is 365 days. Note, this directive sets the default value for each
2723 Volume entry in the Catalog when the Volume is created. The value in the
2724 catalog may be later individually changed for each Volume using the Console
2727 By defining multiple Pools with different Volume Retention periods, you may
2728 effectively have a set of tapes that is recycled weekly, another Pool of
2729 tapes that is recycled monthly and so on. However, one must keep in mind that
2730 if your {\bf Volume Retention} period is too short, it may prune the last
2731 valid Full backup, and hence until the next Full backup is done, you will not
2732 have a complete backup of your system, and in addition, the next Incremental
2733 or Differential backup will be promoted to a Full backup. As a consequence,
2734 the minimum {\bf Volume Retention} period should be at twice the interval of
2735 your Full backups. This means that if you do a Full backup once a month, the
2736 minimum Volume retention period should be two months.
2738 Please note that the value defined by this directive in the bacula-dir.conf
2739 file is the default value used when a Volume is created. Once the volume is
2740 created, changing the value in the bacula-dir.conf file will not change what
2741 is stored for the Volume. To change the value for an existing Volume you
2742 must use the {\bf update} command in the Console.
2745 \item [Recycle = \lt{}yes|no\gt{}]
2746 \index[fd]{Recycle }
2747 This directive specifies the default for recycling Purged Volumes. If it is
2748 set to {\bf yes} and Bacula needs a volume but finds none that are
2749 appendable, it will search for Purged Volumes (i.e. volumes with all the Jobs
2750 and Files expired and thus deleted from the Catalog). If the Volume is
2751 recycled, all previous data written to that Volume will be overwritten.
2753 Please note that the value defined by this directive in the bacula-dir.conf
2754 file is the default value used when a Volume is created. Once the volume is
2755 created, changing the value in the bacula-dir.conf file will not change what
2756 is stored for the Volume. To change the value for an existing Volume you
2757 must use the {\bf update} command in the Console.
2758 \label{RecycleOldest}
2760 \item [Recycle Oldest Volume = \lt{}yes|no\gt{}]
2761 \index[fd]{Recycle Oldest Volume }
2762 This directive instructs the Director to search for the oldest used Volume
2763 in the Pool when another Volume is requested by the Storage daemon and none
2764 are available. The catalog is then {\bf pruned} respecting the retention
2765 periods of all Files and Jobs written to this Volume. If all Jobs are pruned
2766 (i.e. the volume is Purged), then the Volume is recycled and will be used as
2767 the next Volume to be written. This directive respects any Job, File, or
2768 Volume retention periods that you may have specified, and as such it is {\bf
2769 much} better to use this directive than the Purge Oldest Volume.
2771 This directive can be useful if you have a fixed number of Volumes in the
2772 Pool and you want to cycle through them and you have specified the correct
2774 \label{RecycleCurrent}
2776 \item [Recycle Current Volume = \lt{}yes|no\gt{}]
2777 \index[fd]{Recycle Current Volume }
2778 If Bacula needs a new Volume, this directive instructs Bacula to Prune the
2779 volume respecting the Job and File retention periods. If all Jobs are pruned
2780 (i.e. the volume is Purged), then the Volume is recycled and will be used as
2781 the next Volume to be written. This directive respects any Job, File, or
2782 Volume retention periods that you may have specified, and thus it is {\bf
2783 much} better to use it rather than the Purge Oldest Volume directive.
2785 This directive can be useful if you have: a fixed number of Volumes in the
2786 Pool, you want to cycle through them, and you have specified retention
2787 periods that prune Volumes before you have cycled through the Volume in the
2791 \item [Purge Oldest Volume = \lt{}yes|no\gt{}]
2792 \index[fd]{Purge Oldest Volume }
2793 This directive instructs the Director to search for the oldest used Volume
2794 in the Pool when another Volume is requested by the Storage daemon and none
2795 are available. The catalog is then {\bf purged} irrespective of retention
2796 periods of all Files and Jobs written to this Volume. The Volume is then
2797 recycled and will be used as the next Volume to be written. This directive
2798 overrides any Job, File, or Volume retention periods that you may have
2801 This directive can be useful if you have a fixed number of Volumes in the
2802 Pool and you want to cycle through them and when all Volumes are full, but
2803 you don't want to worry about setting proper retention periods. However, by
2804 using this option you risk losing valuable data.
2806 {\bf Please be aware that {\bf Purge Oldest Volume} disregards all retention
2807 periods.} If you have only a single Volume defined and you turn this variable
2808 on, that Volume will always be immediately overwritten when it fills! So at a
2809 minimum, ensure that you have a decent number of Volumes in your Pool before
2810 running any jobs. If you want retention periods to apply do not use this
2811 directive. To specify a retention period, use the {\bf Volume Retention}
2812 directive (see above).
2814 I highly recommend against using this directive, because it is sure that some
2815 day, Bacula will recycle a Volume that contains current data.
2817 \item [Accept Any Volume = \lt{}yes|no\gt{}]
2818 \index[fd]{Accept Any Volume }
2819 This directive specifies whether or not any volume from the Pool may be used
2820 for backup. The default is {\bf yes} as of version 1.27 and later. If it is
2821 {\bf no} then only the first writable volume in the Pool will be accepted for
2822 writing backup data, thus Bacula will fill each Volume sequentially in turn
2823 before using any other appendable volume in the Pool. If this is {\bf no} and
2824 you mount a volume out of order, Bacula will not accept it. If this is {\bf
2825 yes} any appendable volume from the pool mounted will be accepted.
2827 If your tape backup procedure dictates that you manually mount the next
2828 volume, you will almost certainly want to be sure this directive is turned
2831 If you are going on vacation and you think the current volume may not have
2832 enough room on it, you can simply label a new tape and leave it in the drive,
2833 and assuming that {\bf Accept Any Volume} is {\bf yes} Bacula will begin
2834 writing on it. When you return from vacation, simply remount the last tape,
2835 and Bacula will continue writing on it until it is full. Then you can remount
2836 your vacation tape and Bacula will fill it in turn.
2838 \item [Cleaning Prefix = \lt{}string\gt{}]
2839 \index[fd]{Cleaning Prefix }
2840 This directive defines a prefix string, which if it matches the beginning of
2841 a Volume name during labeling of a Volume, the Volume will be defined with
2842 the VolStatus set to {\bf Cleaning} and thus Bacula will never attempt to use
2843 this tape. This is primarily for use with autochangers that accept barcodes
2844 where the convention is that barcodes beginning with {\bf CLN} are treated as
2848 \item [Label Format = \lt{}format\gt{}]
2849 \index[fd]{Label Format }
2850 This directive specifies the format of the labels contained in this pool. The
2851 format directive is used as a sort of template to create new Volume names
2852 during automatic Volume labeling.
2854 The {\bf format} should be specified in double quotes, and consists of
2855 letters, numbers and the special characters hyphen ({\bf -}), underscore
2856 ({\bf \_}), colon ({\bf :}), and period ({\bf .}), which are the legal
2857 characters for a Volume name. The {\bf format} should be enclosed in double
2860 In addition, the format may contain a number of variable expansion characters
2861 which will be expanded by a complex algorithm allowing you to create Volume
2862 names of many different formats. In all cases, the expansion process must
2863 resolve to the set of characters noted above that are legal Volume names.
2864 Generally, these variable expansion characters begin with a dollar sign ({\bf
2865 \$}) or a left bracket ({\bf [}). If you specify variable expansion
2866 characters, you should always enclose the format with double quote characters
2867 ({\bf ``}). For more details on variable expansion, please see the
2868 \ilink{Variable Expansion}{_ChapterStart50} Chapter of this manual.
2870 If no variable expansion characters are found in the string, the Volume name
2871 will be formed from the {\bf format} string appended with the number of
2872 volumes in the pool plus one, which will be edited as four digits with
2873 leading zeros. For example, with a {\bf Label Format = ''File-``}, the first
2874 volumes will be named {\bf File-0001}, {\bf File-0002}, ...
2876 With the exception of Job specific variables, you can test your {\bf
2877 LabelFormat} by using the
2878 \ilink{ var command}{var} the Console Chapter of this manual.
2880 In almost all cases, you should enclose the format specification (part after
2881 the equal sign) in double quotes.
2884 In order for a Pool to be used during a Backup Job, the Pool must have at
2885 least one Volume associated with it. Volumes are created for a Pool using the
2886 {\bf label} or the {\bf add} commands in the {\bf Bacula Console}, program. In
2887 addition to adding Volumes to the Pool (i.e. putting the Volume names in the
2888 Catalog database), the physical Volume must be labeled with valid Bacula
2889 software volume label before {\bf Bacula} will accept the Volume. This will be
2890 automatically done if you use the {\bf label} command. Bacula can
2891 automatically label Volumes if instructed to do so, but this feature is not
2892 yet fully implemented.
2894 The following is an example of a valid Pool resource definition:
2906 \section*{The Catalog Resource}
2907 \label{CatalogResource}
2908 \index[general]{Resource!Catalog }
2909 \index[general]{Catalog Resource }
2910 \addcontentsline{toc}{section}{Catalog Resource}
2912 The Catalog Resource defines what catalog to use for the current job.
2913 Currently, Bacula can only handle a single database server (SQLite, MySQL,
2914 built-in) that is defined when configuring {\bf Bacula}. However, there may be
2915 as many Catalogs (databases) defined as you wish. For example, you may want
2916 each Client to have its own Catalog database, or you may want backup jobs to
2917 use one database and verify or restore jobs to use another database.
2922 \index[console]{Catalog }
2923 Start of the Catalog resource. At least one Catalog resource must be defined.
2926 \item [Name = \lt{}name\gt{}]
2927 \index[console]{Name }
2928 The name of the Catalog. No necessary relation to the database server name.
2929 This name will be specified in the Client resource directive indicating that
2930 all catalog data for that Client is maintained in this Catalog. This
2931 directive is required.
2933 \item [password = \lt{}password\gt{}]
2934 \index[console]{password }
2935 This specifies the password to use when logging into the database. This
2936 directive is required.
2938 \item [DB Name = \lt{}name\gt{}]
2939 \index[console]{DB Name }
2940 This specifies the name of the database. If you use multiple catalogs
2941 (databases), you specify which one here. If you are using an external
2942 database server rather than the internal one, you must specify a name that
2943 is known to the server (i.e. you explicitly created the Bacula tables using
2944 this name. This directive is required.
2946 \item [user = \lt{}user\gt{}]
2947 \index[console]{user }
2948 This specifies what user name to use to log into the database. This directive
2951 \item [DB Socket = \lt{}socket-name\gt{}]
2952 \index[console]{DB Socket }
2953 This is the name of a socket to use on the local host to connect to the
2954 database. This directive is used only by MySQL and is ignored by SQLite.
2955 Normally, if neither {\bf DB Socket} or {\bf DB Address} are specified, MySQL
2956 will use the default socket.
2958 \item [DB Address = \lt{}address\gt{}]
2959 \index[console]{DB Address }
2960 This is the host address of the database server. Normally, you would specify
2961 this instead of {\bf DB Socket} if the database server is on another machine.
2962 In that case, you will also specify {\bf DB Port}. This directive is used
2963 only by MySQL and is ignored by SQLite if provided. This directive is
2966 \item [DB Port = \lt{}port\gt{}]
2967 \index[console]{DB Port }
2968 This defines the port to be used in conjunction with {\bf DB Address} to
2969 access the database if it is on another machine. This directive is used only
2970 by MySQL and is ignored by SQLite if provided. This directive is optional.
2972 \item [Multiple Connections = \lt{}yes|no\gt{}]
2973 \index[console]{Multiple Connections }
2974 By default, this directive is set to no. In that case, each job that uses the
2975 same Catalog will use a single connection to the catalog. It will be shared,
2976 and Bacula will allow only one Job at a time to communicate. If you set this
2977 directive to yes, Bacula will permit multiple connections to the database,
2978 and the database must be multi-thread capable. For SQLite and PostgreSQL,
2979 this is no problem. For MySQL, you must be *very* careful to have the
2980 multi-thread version of the client library loaded on your system. When this
2981 directive is set yes, each Job will have a separate connection to the
2982 database, and the database will control the interaction between the different
2983 Jobs. This can significantly speed up the database operations if you are
2984 running multiple simultaneous jobs. In addition, for SQLite and PostgreSQL,
2985 Bacula will automatically enable transactions. This can significantly speed
2986 up insertion of attributes in the database either for a single Job or
2987 multiple simultaneous Jobs.
2989 This directive has not been tested. Please test carefully before running it
2990 in production and report back your results.
2993 The following is an example of a valid Catalog resource definition:
3002 password = "" # no password = no security
3007 or for a Catalog on another machine:
3017 DB Address = remote.acme.com
3023 \section*{The Messages Resource}
3024 \label{MessagesResource2}
3025 \index[general]{Resource!Messages }
3026 \index[general]{Messages Resource }
3027 \addcontentsline{toc}{section}{Messages Resource}
3029 For the details of the Messages Resource, please see the
3030 \ilink{Messages Resource Chapter}{_ChapterStart15} of this
3033 \section*{The Console Resource}
3034 \label{ConsoleResource1}
3035 \index[general]{Console Resource }
3036 \index[general]{Resource!Console }
3037 \addcontentsline{toc}{section}{Console Resource}
3039 As of Bacula version 1.33 and higher, there are three different kinds of
3040 consoles, which the administrator or user can use to interact with the
3041 Director. These three kinds of consoles comprise three different security
3045 \item The first console type is an {\bf anonymous} or {\bf default} console,
3046 which has full privileges. There is no console resource necessary for this
3047 type since the password is specified in the Director's resource and
3048 consequently such consoles do not have an name as defined on a {\bf Name =}
3049 directive. This is the kind of console that was initially implemented in
3050 versions prior to 1.33 and remains valid. Typically you would use it only for
3052 \item The second type of console, and new to version 1.33 and higher is a
3053 ''named`` console defined within a Console resource in both the Director's
3054 configuration file and in the Console's configuration file. Both the names
3055 and the passwords in these two entries must match much as is the case for
3058 This second type of console begins with absolutely no privileges except those
3059 explicitly specified in the Director's Console resource. Thus you can have
3060 multiple Consoles with different names and passwords, sort of like multiple
3061 users, each with different privileges. As a default, these consoles can do
3062 absolutely nothing -- no commands what so ever. You give them privileges or
3063 rather access to commands and resources by specifying access control lists
3064 in the Director's Console resource. The ACLs are specified by a directive
3065 followed by a list of access names. Examples of this are shown below.
3066 \item The third type of console is similar to the above mentioned one in that
3067 it requires a Console resource definition in both the Director and the
3068 Console. In addition, if the console name, provided on the {\bf Name =}
3069 directive, is the same as a Client name, that console is permitted to use the
3070 {\bf SetIP} command to change the Address directive in the Director's client
3071 resource to the IP address of the Console. This permits portables or other
3072 machines using DHCP (non-fixed IP addresses) to ''notify`` the Director of
3073 their current IP address.
3076 The Console resource is optional and need not be specified. The following
3077 directives are permited within the Director's configuration resource:
3081 \item [Name = \lt{}name\gt{}]
3082 \index[console]{Name }
3083 The name of the console. This name must match the name specified in the
3084 Console's configuration resource (much as is the case with Client
3087 \item [Password = \lt{}password\gt{}]
3088 \index[console]{Password }
3089 Specifies the password that must be supplied for a named Bacula Console to be
3090 authorized. The same password must appear in the {\bf Console} resource of
3091 the Console configuration file. For added security, the password is never
3092 actually passed across the network but rather a challenge response hash code
3093 created with the password. This directive is required. If you have either
3094 {\bf /dev/random} {\bf bc} on your machine, Bacula will generate a random
3095 password during the configuration process, otherwise it will be left blank.
3097 \item [JobACL = \lt{}name-list\gt{}]
3098 \index[console]{JobACL }
3099 This directive is used to specify a list of Job resource names that can be
3100 accessed by the console. Without this directive, the console cannot access
3101 any of the Director's Job resources. Multiple Job resource names may be
3102 specified by separating them with commas, and/or by specifying multiple
3103 JobACL directives. For example, the directive may be specified as:
3107 JobACL = kernsave, "Backup client 1", "Backup client 2"
3108 JobACL = "RestoreFiles"
3113 With the above specification, the console can access the Director's resources
3114 for the four jobs named on the JobACL directives, but for no others.
3116 \item [ClientACL = \lt{}name-list\gt{}]
3117 \index[console]{ClientACL }
3118 This directive is used to specify a list of Client resource names that can be
3119 accessed by the console.
3121 \item [StorageACL = \lt{}name-list\gt{}]
3122 \index[console]{StorageACL }
3123 This directive is used to specify a list of Storage resource names that can
3124 be accessed by the console.
3126 \item [ScheduleACL = \lt{}name-list\gt{}]
3127 \index[console]{ScheduleACL }
3128 This directive is used to specify a list of Schedule resource names that can
3129 be accessed by the console.
3131 \item [PoolACL = \lt{}name-list\gt{}]
3132 \index[console]{PoolACL }
3133 This directive is used to specify a list of Pool resource names that can be
3134 accessed by the console.
3136 \item [FileSetACL = \lt{}name-list\gt{}]
3137 \index[console]{FileSetACL }
3138 This directive is used to specify a list of FileSet resource names that can
3139 be accessed by the console.
3141 \item [CatalogACL = \lt{}name-list\gt{}]
3142 \index[console]{CatalogACL }
3143 This directive is used to specify a list of Catalog resource names that can
3144 be accessed by the console.
3146 \item [CommandACL = \lt{}name-list\gt{}]
3147 \index[console]{CommandACL }
3148 This directive is used to specify a list of of console commands that can be
3149 executed by the console.
3152 Aside from Director resource names and console command names, the special
3153 keyword {\bf *all*} can be specified in any of the above access control lists.
3154 When this keyword is present, any resource or command name (which ever is
3155 appropriate) will be accepted. For an example configuration file, please see
3157 \ilink{Console Configuration}{_ChapterStart36} chapter of this
3160 \section*{The Counter Resource}
3161 \label{CounterResource}
3162 \index[general]{Resource!Counter }
3163 \index[general]{Counter Resource }
3164 \addcontentsline{toc}{section}{Counter Resource}
3166 The Counter Resource defines a counter variable that can be accessed by
3167 variable expansion used for creating Volume labels with the {\bf LabelFormat}
3169 \ilink{LabelFormat}{Label} directive in this chapter for more
3175 \index[console]{Counter }
3176 Start of the Counter resource. Counter directives are optional.
3178 \item [Name = \lt{}name\gt{}]
3179 \index[console]{Name }
3180 The name of the Counter. This is the name you will use in the variable
3181 expansion to reference the counter value.
3183 \item [Minimum = \lt{}integer\gt{}]
3184 \index[console]{Minimum }
3185 This specifies the minimum value that the counter can have. It also becomes
3186 the default. If not supplied, zero is assumed.
3188 \item [Maximum = \lt{}integer\gt{}]
3189 \index[console]{Maximum }
3190 This is the maximum value value that the counter can have. If not specified
3191 or set to zero, the counter can have a maximum value of 2,147,483,648 (2 to
3192 the 31 power). When the counter is incremented past this value, it is reset
3195 \item [*WrapCounter = \lt{}counter-name\gt{}]
3196 \index[console]{*WrapCounter }
3197 If this value is specified, when the counter is incremented past the maximum
3198 and thus reset to the minimum, the counter specified on the {\bf WrapCounter}
3199 is incremented. (This is not currently implemented).
3201 \item [Catalog = \lt{}catalog-name\gt{}]
3202 \index[console]{Catalog }
3203 If this directive is specified, the counter and its values will be saved in
3204 the specified catalog. If this directive is not present, the counter will be
3205 redefined each time that Bacula is started.
3208 \section*{ A Complete Example Director Configuration File}
3209 \label{SampleDirectorConfiguration}
3210 \index[general]{File!Complete Example Director Configuration }
3211 \index[general]{Complete Example Director Configuration File }
3212 \addcontentsline{toc}{section}{Complete Example Director Configuration File}
3214 An example Director configuration file might be the following:
3219 # Default Bacula Director Configuration file
3221 # The only thing that MUST be changed is to add one or more
3222 # file or directory names in the Include directive of the
3225 # For Bacula release 1.15 (5 March 2002) -- redhat
3227 # You might also want to change the default email address
3228 # from root to your address. See the "mail" and "operator"
3229 # directives in the Messages resource.
3231 Director { # define myself
3233 QueryFile = "/home/kern/bacula/bin/query.sql"
3234 WorkingDirectory = "/home/kern/bacula/bin/working"
3235 PidDirectory = "/home/kern/bacula/bin/working"
3236 Password = "XkSfzu/Cf/wX4L8Zh4G4/yhCbpLcz3YVdmVoQvU3EyF/"
3238 # Define the backup Job
3240 Name = "NightlySave"
3242 Level = Incremental # default
3245 Schedule = "WeeklyCycle"
3255 Where = /tmp/bacula-restores
3261 # List of files to be backed up
3265 Options { signature=SHA1 }
3267 # Put your list of files here, one per line or include an
3268 # external list with:
3272 # Note: / backs up everything
3277 # When to do the backups
3279 Name = "WeeklyCycle"
3280 Run = Full sun at 1:05
3281 Run = Incremental mon-sat at 1:05
3283 # Client (File Services) to backup
3288 Password = "MQk6lVinz4GG2hdIZk1dsKE/LxMZGo6znMHiD7t7vzF+"
3289 File Retention = 60d # sixty day file retention
3290 Job Retention = 1y # 1 year Job retention
3291 AutoPrune = yes # Auto apply retention periods
3293 # Definition of DLT tape storage device
3297 Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
3298 Device = "HP DLT 80" # same as Device in Storage daemon
3299 Media Type = DLT8000 # same as MediaType in Storage daemon
3301 # Definition of DDS tape storage device
3305 Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
3306 Device = SDT-10000 # same as Device in Storage daemon
3307 Media Type = DDS-4 # same as MediaType in Storage daemon
3309 # Definition of 8mm tape storage device
3313 Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
3314 Device = "Exabyte 8mm"
3317 # Definition of file storage device
3321 Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
3322 Device = FileStorage
3325 # Generic catalog service
3328 dbname = bacula; user = bacula; password = ""
3330 # Reasonable message delivery -- send most everything to
3331 # the email address and to the console
3334 mail = root@localhost = all, !skipped, !terminate
3335 operator = root@localhost = mount
3336 console = all, !skipped, !saved
3339 # Default pool definition
3347 # Restricted console used by tray-monitor to get the status of the director
3351 Password = "GN0uRo7PTUmlMbqrJ2Gr1p0fk0HQJTxwnFyE4WSST3MWZseR"
3352 CommandACL = status, .status