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ée\gt{}]
180 \index[console]{FD Connect Timeout }
181 O\`u {\bf dur\'ee} est le délai durant lequel le Director tente de contacter
182 le File Daemon pour démarrer un job. Une fois ce délai écoulé, le Director supprimera le job.
183 La valeur par défaut est 30 minutes.
185 \item [SD Connect Timeout = \lt{}durée\gt{}]
186 \index[console]{SD Connect Timeout }
187 O\`u {\bf dur\'ee} est le délai durant lequel le Director tente de contacter
188 le Storage Daemon pour démarrer un job. Une fois ce délai écoulé, le Director supprimera le job.
189 La valeur par défaut est 30 minutes.
191 \item [DirAddresses = \lt{}Spécification-adresses-IP\gt{}]
192 \index[console]{DirAddresses }
193 Spécifie 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 être spécifiées sous forme de quadruplets pointés, ou
225 suivant la notation à doubles points IPv6, ou encore sous forme de nom symbolique
226 (seulement pour la spécification ip). D'autre part, le port peut être spécifié
227 par un nombre, ou par une valeur mnémonique du fichier /etc/services. Si un port
228 n'est pas précisé, celui par défaut sera utilisé. Si une section ip est spécifié,
229 la résolution peut être fait soit par IPv4, soit par IPv6. Si ip4 est spécifié,
230 seules les résolutions IPv4 seront permises. Il en va de même avec ip6.
232 \item [DIRport = \lt{}numéro-de-port\gt{}]
233 \index[console]{DIRport }
234 Spécifie le port (un entier positif) sur lequel le Director est à l'écoute
235 de connections de Consoles Bacula. Ce même numéro de port doit être spécifié
236 dans la ressource Director du fichier de configuration de la console. La
237 valeur par défaut est 9101, aussi, il n'est en principe pas nécessaire
238 de renseigner cette directive. Elle n'est pas requise si vous spécifiez des
241 \item [DirAddress = \lt{}Adresse-IP\gt{}]
242 \index[console]{DirAddress }
243 Cette directive est optionnelle. Lorsqu'elle est spécifiée, le Director n'accepte
244 de connections Console que de l'adresse spécifiée {\bf Adresse-IP}, qui peut être
245 soit un nom de domaine, soit une adresse IP au format quadruplet pointé ou chaîne quotée.
246 Si cette directive n'est pas spécifiée, le Director acceptera des connections de Console
247 de toute adresse valide. Notez que contrairement à la spécification DirAdresses décrite
248 plus haut, cette directive ne permet de spécifier 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*{The Job Resource}
270 \index[general]{Resource!Job }
271 \index[general]{Job Resource }
272 \addcontentsline{toc}{section}{Job Resource}
274 The Job resource defines a Job (Backup, Restore, ...) that Bacula must
275 perform. Each Job resource definition contains the names of the Clients and
276 their FileSets to backup or restore, the Schedule for the Job, where the data
277 are to be stored, and what media Pool can be used. In effect, each Job
278 resource must specify What, Where, How, and When or FileSet, Storage,
279 Backup/Restore/Level, and Schedule respectively.
281 Only a single type ({\bf Backup}, {\bf Restore}, ...) can be specified for any
282 job. If you want to backup multiple FileSets on the same Client or multiple
283 Clients, you must define a Job for each one.
288 \index[console]{Job }
289 Start of the Job resource. At least one Job resource is required.
291 \item [Name = \lt{}name\gt{}]
292 \index[console]{Name }
293 The Job name. This name can be specified on the {\bf Run} command in the
294 console program to start a job. If the name contains spaces, it must be
295 specified between quotes. It is generally a good idea to give your job the
296 same name as the Client that it will backup. This permits easy identification
299 When the job actually runs, the unique Job Name will consist of the name you
300 specify here followed by the date and time the job was scheduled for
301 execution. This directive is required.
303 \item [Type = \lt{}job-type\gt{}]
304 \index[console]{Type }
305 The {\bf Type} directive specifies the Job type, which may be one of the
306 following: {\bf Backup}, {\bf Restore}, {\bf Verify}, or {\bf Admin}. This
307 directive is required. Within a particular Job Type, there are also Levels
308 as discussed in the next item.
313 \index[console]{Backup }
314 Run a backup Job. Normally you will have at least one Backup job for each
315 client you want to save. Normally, unless you turn off cataloging, most all
316 the important statistics and data concerning files backed up will be placed
320 \index[console]{Restore }
321 Run a restore Job. Normally, you will specify only one Restore job which acts
322 as a sort of prototype that you will modify using the console program in
323 order to perform restores. Although certain basic information from a Restore
324 job is saved in the catalog, it is very minimal compared to the information
325 stored for a Backup job -- for example, no File database entries are
326 generated since no Files are saved.
329 \index[console]{Verify }
330 Run a verify Job. In general, {\bf verify} jobs permit you to compare the
331 contents of the catalog to the file system, or to what was backed up. In
332 addition, to verifying that a tape that was written can be read, you can
333 also use {\bf verify} as a sort of tripwire intrusion detection.
337 Run a admin Job. An {\bf Admin} job can be used to periodically run catalog
338 pruning, if you do not want to do it at the end of each {\bf Backup} Job.
339 Although an Admin job is recorded in the catalog, very little data is saved.
344 \item {\bf Level = \lt{}job-level\gt{}}
346 The Level directive specifies the default Job level to be run. Each different
347 Job Type (Backup, Restore, ...) has a different set of Levels that can be
348 specified. The Level is normally overridden by a different value that is
349 specified in the {\bf Schedule} resource. This directive is not required, but
350 must be specified either by a {\bf Level} directive or as a override
351 specified in the {\bf Schedule} resource.
353 For a {\bf Backup} Job, the Level may be one of the following:
359 is all files in the FileSet whether or not they have changed.
362 \index[fd]{Incremental }
363 is all files that have changed since the last successful backup of the
364 specified FileSet. If the Director cannot find a previous Full backup then
365 the job will be upgraded into a Full backup. When the Director looks for a
366 ``suitable'' backup record in the catalog database, it looks for a previous
370 \item The same Job name.
371 \item The same Client name.
372 \item The same FileSet (any change to the definition of the FileSet such as
373 adding or deleting a file in the Include or Exclude sections constitutes a
375 \item The Job was a Full, Differential, or Incremental backup.
376 \item The Job terminated normally (i.e. did not fail or was not canceled).
379 If all the above conditions do not hold, the Director will upgrade the
380 Incremental to a Full save. Otherwise, the Incremental backup will be
381 performed as requested.
383 The File daemon (Client) decides which files to backup for an Incremental
384 backup by comparing start time of the prior Job (Full, Differential, or
385 Incremental) against the time each file was last ``modified'' (st\_mtime) and
386 the time its attributes were last ``changed''(st\_ctime). If the file was
387 modified or its attributes changed on or after this start time, it will then
390 Please note that some virus scanning software may change st\_ctime while
391 doing the scan. For exaple, if the the virus scanning program attempts to
392 reset the access time (st\_atime), which Bacula does not use, it will cause
393 st\_ctime to change and hence Bacula will backup the file during an
394 Incremental or Differential backup. In the case of Sophos virus scanning, you
395 can prevent it from resetting the access time (st\_atime) and hence changing
396 st\_ctime by using the {\bf \verb{--{no-reset-atime} option. For other software,
397 please see their manual.
399 When Bacula does an Incremental backup, all modified files that are still on
400 the system are backed up. However, any file that has been deleted since the
401 last Full backup remains in the Bacula catalog, which means that if between
402 a Full save and the time you do a restore, some files are deleted, those
403 deleted files will also be restored. The deleted files will no longer appear
404 in the catalog after doing another Full save. However, to remove deleted
405 files from the catalog during a Incremental backup is quite a time consuming
406 process and not currently implemented in Bacula.
409 \index[fd]{Differential }
410 is all files that have changed since the last successful Full backup of the
411 specified FileSet. If the Director cannot find a previous Full backup or a
412 suitable Full backup, then the Differential job will be upgraded into a Full
413 backup. When the Director looks for a ``suitable'' Full backup record in the
414 catalog database, it looks for a previous Job with:
417 \item The same Job name.
418 \item The same Client name.
419 \item The same FileSet (any change to the definition of the FileSet such as
420 adding or deleting a file in the Include or Exclude sections constitutes a
422 \item The Job was a FULL backup.
423 \item The Job terminated normally (i.e. did not fail or was not canceled).
426 If all the above conditions do not hold, the Director will upgrade the
427 Differential to a Full save. Otherwise, the Differential backup will be
428 performed as requested.
430 The File daemon (Client) decides which files to backup for a differential
431 backup by comparing the start time of the prior Full backup Job against the
432 time each file was last ``modified'' (st\_mtime) and the time its attributes
433 were last ``changed''(st\_ctime). If the file was modified or its attributs
434 were changed on or after this start time, it will then be backed up. The
435 start time used is displayed after the {\bf Since} on the Job report. In rare
436 cases, using the start time of the prior backup may cause some files to be
437 backed up twice, but it ensures that no change is missed. As with the
438 Incremental option, you shouldensure that the clocks on your server and
439 client are synchronized or as close as possible to avoid the possibility of a
440 file being skipped. Note, on versions 1.33 or greater Bacula automatically
441 makes the necessary adjstments to the time between the server and the client
442 so that the times Bacula uses are synchronized.
444 When Bacula does an Differential backup, all modified files that are still on
445 the system are backed up. However, any file that has been deleted since the
446 last Full backup remains in the Bacula catalog, which means that if between
447 a Full save and the time you do a restore, some files are deleted, those
448 deleted files will also be restored. The deleted files will no longer appear
449 in the catalog after doing another Full save. However, to remove deleted
450 files from the catalog during a Differential backup is quite a time consuming
451 process and not currently implemented in Bacula.
454 For a {\bf Restore} Job, no level need be specified.
456 For a {\bf Verify} Job, the Level may be one of the following:
461 \index[fd]{InitCatalog }
462 does a scan of the specified {\bf FileSet} and stores the file attributes in
463 the Catalog database. Since no file data is saved, you might ask why you
464 would want to do this. It turns out to be a very simple and easy way to have
465 a {\bf Tripwire} like feature using {\bf Bacula}. In other words, it allows
466 you to save the state of a set of files defined by the {\bf FileSet} and
467 later check to see if those files have been modified or deleted and if any
468 new files have been added. This can be used to detect system intrusion.
469 Typically you would specify a {\bf FileSet} that contains the set of system
470 files that should not change (e.g. /sbin, /boot, /lib, /bin, ...). Normally,
471 you run the {\bf InitCatalog} level verify one time when your system is first
472 setup, and then once again after each modification (upgrade) to your system.
473 Thereafter, when your want to check the state of your system files, you use
474 a {\bf Verify} {\bf level = Catalog}. This compares the results of your {\bf
475 InitCatalog} with the current state of the files.
479 Compares the current state of the files against the state previously saved
480 during an {\bf InitCatalog}. Any discrepancies are reported. The items
481 reported are determined by the {\bf verify} options specified on the {\bf
482 Include} directive in the specified {\bf FileSet} (see the {\bf FileSet}
483 resource below for more details). Typically this command will be run once a
484 day (or night) to check for any changes to your system files.
486 Please note! If you run two Verify Catalog jobs on the same client at the
487 same time, the results will certainly be incorrect. This is because Verify
488 Catalog modifies the Catalog database while running in order to track new
491 \item [VolumeToCatalog]
492 \index[fd]{VolumeToCatalog }
493 This level causes Bacula to read the file attribute data written to the
494 Volume from the last Job. The file attribute data are compared to the values
495 saved in the Catalog database and any differences are reported. This is
496 similar to the {\bf Catalog} level except that instead of comparing the disk
497 file attributes to the catalog database, the attribute data written to the
498 Volume is read and compared to the catalog database. Although the attribute
499 data including the signatures (MD5 or SHA1) are compared the actual file data
500 is not compared (it is not in the catalog).
502 Please note! If you run two Verify VolumeToCatalog jobs on the same client at
503 the same time, the results will certainly be incorrect. This is because the
504 Verify VolumeToCatalog modifies the Catalog database while running.
506 \item [DiskToCatalog]
507 \index[fd]{DiskToCatalog }
508 This level causes Bacula to read the files as they currently are on disk, and
509 to compare the current file attributes with the attributes saved in the
510 catalog from the last backup for the job specified on the {\bf VerifyJob}
511 directive. This level differs from the {\bf Catalog} level described above by
512 the fact that it compare not against a previous Verify job but against a
513 previous backup. When you run this level, you must supply the verify options
514 on your Include statements. Those options determine what attribute fields are
517 This command can be very useful if you have disk problems because it will
518 compare the current state of your disk against the last successful backup,
519 which may be several jobs.
521 Note, the current implementation (1.32c) does not identify files that have
525 \item {\bf Verify Job = \lt{}Job-Resource-Name\gt{}}
526 \index[fd]{Verify Job }
527 If you run a verify job without this directive, the last job run will be
528 compared with the catalog, which means that you must immediately follow a
529 backup by a verify command. If you specify a {\bf Verify Job} Bacula will
530 find the last job with that name that ran. This permits you to run all your
531 backups, then run Verify jobs on those that you wish to be verified (most
532 often a {\bf VolumeToCatalog}) so that the tape just written is re-read.
534 \item {\bf JobDefs = \lt{}JobDefs-Resource-Name\gt{}}
536 If a JobDefs-Resource-Name is specified, all the values contained in the
537 named JobDefs resource will be used as the defaults for the current Job. Any
538 value that you explicitly define in the current Job resource, will override
539 any defaults specified in the JobDefs resource. The use of this directive
540 permits writing much more compact Job resources where the bulk of the
541 directives are defined in one or more JobDefs. This is particularly useful if
542 you have many similar Jobs but with minor variations such as different
543 Clients. A simple example of the use of JobDefs is provided in the default
544 bacula-dir.conf file.
546 \item {\bf Bootstrap = \lt{}bootstrap-file\gt{}}
547 \index[dir]{Bootstrap }
548 The Bootstrap directive specifies a bootstrap file that, if provided, will
549 be used during {\bf Restore} Jobs and is ignored in other Job types. The {\bf
550 bootstrap} file contains the list of tapes to be used in a restore Job as
551 well as which files are to be restored. Specification of this directive is
552 optional, and if specified, it is used only for a restore job. In addition,
553 when running a Restore job from the console, this value can be changed.
555 If you use the {\bf Restore} command in the Console program, to start a
556 restore job, the {\bf bootstrap} file will be created automatically from the
557 files you select to be restored.
559 For additional details of the {\bf bootstrap} file, please see
560 \ilink{Restoring Files with the Bootstrap File}{_ChapterStart43}
561 chapter of this manual.
564 \label{writebootstrap}
565 Write Bootstrap = \lt{}bootstrap-file-specification\gt{}}
567 The {\bf writebootstrap} directive specifies a file name where Bacula will
568 write a {\bf bootstrap} file for each Backup job run. Thus this directive
569 applies only to Backup Jobs. If the Backup job is a Full save, Bacula will
570 erase any current contents of the specified file before writing the bootstrap
571 records. If the Job is an Incremental save, Bacula will append the current
572 bootstrap record to the end of the file.
574 Using this feature, permits you to constantly have a bootstrap file that can
575 recover the current state of your system. Normally, the file specified should
576 be a mounted drive on another machine, so that if your hard disk is lost,
577 you will immediately have a bootstrap record available. Alternatively, you
578 should copy the bootstrap file to another machine after it is updated.
580 If the {\bf bootstrap-file-specification} begins with a vertical bar (|),
581 Bacula will use the specification as the name of a program to which it will
582 pipe the bootstrap record. It could for example be a shell script that emails
583 you the bootstrap record.
585 For more details on using this file, please see the chapter entitled
586 \ilink{The Bootstrap File}{_ChapterStart43} of this manual.
588 \item {\bf Client = \lt{}client-resource-name\gt{}}
590 The Client directive specifies the Client (File daemon) that will be used in
591 the current Job. Only a single Client may be specified in any one Job. The
592 Client runs on the machine to be backed up, and sends the requested files to
593 the Storage daemon for backup, or receives them when restoring. For
594 additional details, see the
595 \ilink{Client Resource section}{ClientResource2} of this chapter.
596 This directive is required.
598 \item {\bf FileSet = \lt{}FileSet-resource-name\gt{}}
600 The FileSet directive specifies the FileSet that will be used in the current
601 Job. The FileSet specifies which directories (or files) are to be backed up,
602 and what options to use (e.g. compression, ...). Only a single FileSet
603 resource may be specified in any one Job. For additional details, see the
604 \ilink{FileSet Resource section}{FileSetResource} of this
605 chapter. This directive is required.
607 \item {\bf Messages = \lt{}messages-resource-name\gt{}}
608 \index[dir]{Messages }
609 The Messages directive defines what Messages resource should be used for this
610 job, and thus how and where the various messages are to be delivered. For
611 example, you can direct some messages to a log file, and others can be sent
612 by email. For additional details, see the
613 \ilink{Messages Resource}{_ChapterStart15} Chapter of this
614 manual. This directive is required.
616 \item {\bf Pool = \lt{}pool-resource-name\gt{}}
618 The Pool directive defines the pool of Volumes where your data can be backed
619 up. Many Bacula installations will use only the {\bf Default} pool. However,
620 if you want to specify a different set of Volumes for different Clients or
621 different Jobs, you will probably want to use Pools. For additional details,
623 \ilink{Pool Resource section}{PoolResource} of this chapter. This
624 resource is required.
626 \item {\bf Full Backup Pool = \lt{}pool-resource-name\gt{} }
627 \index[dir]{Full Backup Pool }
628 The {\it Full Backup Pool} specifies a Pool to be used for Full backups. It
629 will override any Pool specification during a Full backup. This resource is
632 \item {\bf Differential Backup Pool = \lt{}pool-resource-name\gt{} }
633 \index[dir]{Differential Backup Pool }
634 The {\it Differential Backup Pool} specifies a Pool to be used for
635 Differential backups. It will override any Pool specification during a
636 Differentia backup. This resource is optional.
638 \item {\bf Incremental Backup Pool = \lt{}pool-resource-name\gt{} }
639 \index[dir]{Incremental Backup Pool }
640 The {\it Incremental Backup Pool} specifies a Pool to be used for Incremental
641 backups. It will override any Pool specification during a Incremental backup.
642 This resource is optional.
644 \item {\bf Schedule = \lt{}schedule-name\gt{}}
645 \index[dir]{Schedule }
646 The Schedule directive defines what schedule is to be used for the Job. The
647 schedule determines when the Job will be automatically started and what Job
648 level (i.e. Full, Incremental, ...) is to be run. This directive is optional,
649 and if left out, the Job can only be started manually. For additional
651 \ilink{Schedule Resource Chapter}{ScheduleResource} of this
652 manual. If a Schedule resource is specified, the job will be run according to
653 the schedule specified. If no Schedule resource is specified for the Job,
654 the job must be manually started using the Console program. Although you may
655 specify only a single Schedule resource for any one job, the Schedule
656 resource may contain multiple {\bf Run} directives, which allow you to run
657 the Job at many different times, and each {\bf run} directive permits
658 overriding the default Job Level Pool, Storage, and Messages resources. This
659 gives considerable flexibility in what can be done with a single Job.
661 \item {\bf Storage = \lt{}storage-resource-name\gt{}}
662 \index[dir]{Storage }
663 The Storage directive defines the name of the storage services where you want
664 to backup the FileSet data. For additional details, see the
665 \ilink{Storage Resource Chapter}{StorageResource2} of this manual.
666 This directive is required.
668 \item {\bf Max Start Delay = \lt{}time\gt{}}
669 \index[sd]{Max Start Delay }
670 The time specifies maximum delay between the scheduled time and the actual
671 start time for the Job. For example, a job can be scheduled to run at
672 1:00am, but because other jobs are running, it may wait to run. If the delay
673 is set to 3600 (one hour) and the job has not begun to run by 2:00am, the job
674 will be canceled. This can be useful, for example, to prevent jobs from
675 running during day time hours. The default is 0 which indicates no limit.
677 \item {\bf Max Run Time = \lt{}time\gt{}}
678 \index[sd]{Max Run Time }
679 The time specifies maximum allowed time that a job may run, counted from the
680 when the job starts ({\bf not} necessarily the same as when the job was
681 scheduled). This directive is implemented only in version 1.33 and later.
683 \item {\bf Max Wait Time = \lt{}time\gt{}}
684 \index[sd]{Max Wait Time }
685 The time specifies maximum allowed time that a job may block waiting for a
686 resource (such as waiting for a tape to be mounted, or waiting for the
687 storage or file daemons to perform their duties), counted from the when the
688 job starts ({\bf not} necessarily the same as when the job was scheduled).
689 This directive is implemented only in version 1.33 and later. Note, the
690 implementation is not yet complete, so this directive does not yet work
693 \item {\bf Prune Jobs = \lt{}yes|no\gt{}}
694 \index[fd]{Prune Jobs }
695 Normally, pruning of Jobs from the Catalog is specified on a Client by Client
696 basis in the Client resource with the {\bf AutoPrune} directive. If this
697 directive is specified (not normally) and the value is {\bf yes}, it will
698 override the value specified in the Client resource. The default is {\bf no}.
701 \item {\bf Prune Files = \lt{}yes|no\gt{}}
702 \index[fd]{Prune Files }
703 Normally, pruning of Files from the Catalog is specified on a Client by
704 Client basis in the Client resource with the {\bf AutoPrune} directive. If
705 this directive is specified (not normally) and the value is {\bf yes}, it
706 will override the value specified in the Client resource. The default is {\bf
709 \item {\bf Prune Volumes = \lt{}yes|no\gt{}}
710 \index[fd]{Prune Volumes }
711 Normally, pruning of Volumes from the Catalog is specified on a Client by
712 Client basis in the Client resource with the {\bf AutoPrune} directive. If
713 this directive is specified (not normally) and the value is {\bf yes}, it
714 will override the value specified in the Client resource. The default is {\bf
717 \item {\bf Run Before Job = \lt{}command\gt{}}
718 \index[fd]{Run Before Job }
719 The specified {\bf command} is run as an external program prior to running
720 the current Job. Any output sent by the job to standard output will be
721 included in the Bacula job report. The command string must be a valid program
722 name or name of a shell script. This directive is not required, but if it is
723 defined, and if the exit code of the program run is non-zero, the current
724 Bacula job will be canceled. In addition, the command string is parsed then
725 feed to the execvp() function, which means that the path will be searched to
726 execute your specified command, but there is no shell interpretation, as a
727 consequence, if you complicated commands or want any shell features such as
728 redirection or piping, you must call a shell script and do it inside that
731 Before submitting the specified command to the operating system, Bacula
732 performs character substitution of the following characters:
750 As of version 1.30, Bacula checks the exit status of the RunBeforeJob
751 program. If it is non-zero, the job will be error terminated. Lutz Kittler
752 has pointed out that this can be a simple way to modify your schedules during
753 a holiday. For example, suppose that you normally do Full backups on Fridays,
754 but Thursday and Friday are holidays. To avoid having to change tapes between
755 Thursday and Friday when no one is in the office, you can create a
756 RunBeforeJob that returns a non-zero status on Thursday and zero on all other
757 days. That way, the Thursday job will not run, and on Friday the tape you
758 insert on Wednesday before leaving will be used.
760 \item {\bf Run After Job = \lt{}command\gt{}}
761 \index[fd]{Run After Job }
762 The specified {\bf command} is run as an external program after the current
763 job terminates. This directive is not required. The command string must be a
764 valid program name or name of a shell script. If the exit code of the program
765 run is non-zero, the current Bacula job will terminate in error. Before
766 submitting the specified command to the operating system, Bacula performs
767 character substitution as described above for the {\bf Run Before Job}
770 An example of the use of this command is given in the
771 \ilink{Tips Chapter}{JobNotification} of this manual. As of version
772 1.30, Bacula checks the exit status of the RunAfter program. If it is
773 non-zero, the job will be terminated in error.
775 \item {\bf Client Run Before Job = \lt{}command\gt{}}
776 \index[fd]{Client Run Before Job }
777 This command is the same as {\bf Run Before Job} except that it is run on
778 the client machine. The same restrictions apply to Unix systems as noted
779 above for the {\bf Run Before Job}. In addition, for a Windows client on
780 version 1.33 and above, please take careful note that you must ensure a
781 correct path to your script, and the script or program can be a .com, .exe or
782 a .bat file. However, if you specify a path, you must also specify the full
783 extension. Unix like commands will not work unless you have installed and
784 properly configured Cygwin in addition to and separately from Bacula.
786 {\bf Special Windows Considerations}
787 The command can be anything that cmd.exe or command.com will recognize as a
788 executable file. Specifiying the executable's extention is optional, unless
789 there is an ambiguity. (i.e. ls.bat, ls.exe)
791 The System \%Path\% will be searched for the command. (under the envrionment
792 variable dialog you have have both System Environment and User Environment,
793 we believe that only the System environment will be available to bacual-fd,
794 if it is running as a service.)
796 System environment varaible can be called out using the \%var\% syntax and
797 used as either part of the command name or arguments.
799 When specifiying a full path to an executable if the path or executable name
800 contains whitespace or special characters they will need to be quoted.
801 Arguments containing whitespace or special characters will also have to be
806 ClientRunBeforeJob = "\"C:/Program Files/Software
807 Vendor/Executable\" /arg1 /arg2 \"foo bar\""
811 The special characters \&()[]\{\}\^{}=;!'+,`\~{} will need to be quoted if
812 part of a filename or argument.
814 If someone is logged in a blank ``command'' window running the commands will
815 be present during the execution of the command.
817 Some Suggestions from Phil Stracchino for running on Win32 machines with the
818 native Win32 File daemon:
821 \item You might want the ClientRunBeforeJob directive to specify a .bat file
822 which runs the actual client-side commands, rather than trying to run (for
823 example) regedit /e directly.
824 \item The batch file should explicitly 'exit 0' on successful completion.
825 \item The path to the batch file should be specified in Unix form:
827 ClientRunBeforeJob = ``c:/bacula/bin/systemstate.bat''
829 rather than DOS/Windows form:
832 ``c:\textbackslash{}bacula\textbackslash{}bin\textbackslash{}systemstate.bat''
836 \item {\bf Client Run After Job = \lt{}command\gt{}}
837 \index[fd]{Client Run After Job }
838 This command is the same as {\bf Run After Job} except that it is run on the
839 client machine. Note, please see the notes above in {\bf Client Run Before
840 Job} concerning Windows clients.
842 \item {\bf Rerun Failed Levels = \lt{}yes|no\gt{}}
843 \index[fd]{Rerun Failed Levels }
844 If this directive is set to {\bf yes} (default no), and Bacula detects that a
845 previous job at a higher level (i.e. Full or Differential) has failed, the
846 current job level will be upgraded to the higher level. This is particularly
847 useful for Laptops where they may often be unreachable, and if a prior Full
848 save has failed, you wish the very next backup to be a Full save rather than
849 whatever level it is started as.
851 \item {\bf Spool Data = \lt{}yes|no\gt{}}
852 \index[fd]{Spool Data }
853 If this directive is set to {\bf yes} (default no), the Storage daemon will
854 be requested to spool the data for this Job to disk rather than write it
855 directly to tape. Once all the data arrives or the spool file maximum sizes
856 are reached, the data will be despooled and written to tape. When this
857 directive is set to yes, the Spool Attributes is also automatically set to
858 yes. Spooling data prevents tape shoe-shine (start and stop) during
859 Incremental saves. This option should not be used if you are writing to a
862 \item {\bf Spool Attributes = \lt{}yes|no\gt{}}
863 \index[fd]{Spool Attributes }
864 The default is set to {\bf no}, which means that the File attributes are sent
865 by the Storage daemon to the Director as they are stored on tape. However,
866 if you want to avoid the possibility that database updates will slow down
867 writing to the tape, you may want to set the value to {\bf yes}, in which
868 case the Storage daemon will buffer the File attributes and Storage
869 coordinates to a temporary file in the Working Directory, then when writing
870 the Job data to the tape is completed, the attributes and storage coordinates
871 will be sent to the Director. The default is {\bf no}.
873 \item {\bf Where = \lt{}directory\gt{}}
875 This directive applies only to a Restore job and specifies a prefix to the
876 directory name of all files being restored. This permits files to be restored
877 in a different location from which they were saved. If {\bf Where} is not
878 specified or is set to backslash ({\bf /}), the files will be restored to
879 their original location. By default, we have set {\bf Where} in the example
880 configuration files to be {\bf /tmp/bacula-restores}. This is to prevent
881 accidental overwriting of your files.
883 \item {\bf Replace = \lt{}replace-option\gt{}}
884 \index[dir]{Replace }
885 This directive applies only to a Restore job and specifies what happens when
886 Bacula wants to restore a file or directory that already exists. You have the
887 following options for {\bf replace-option}:
893 when the file to be restored already exists, it is deleted then replaced by
898 if the backed up file (on tape) is newer than the existing file, the existing
899 file is deleted and replaced by the back up.
903 if the backed up file (on tape) is older than the existing file, the existing
904 file is deleted and replaced by the back up.
908 if the backed up file already exists, Bacula skips restoring this file.
911 \item {\bf Prefix Links=\lt{}yes|no\gt{}}
912 \index[fd]{Prefix Links }
913 If a {\bf Where} path prefix is specified for a recovery job, apply it to
914 absolute links as well. The default is {\bf No}. When set to {\bf Yes} then
915 while restoring files to an alternate directory, any absolute soft links
916 will also be modified to point to the new alternate directory. Normally this
917 is what is desired -- i.e. everything is self consistent. However, if you
918 wish to later move the files to their original locations, all files linked
919 with absolute names will be broken.
921 \item {\bf Maximum Concurrent Jobs = \lt{}number\gt{}}
922 \index[dir]{Maximum Concurrent Jobs }
923 where \lt{}number\gt{} is the maximum number of Jobs from the current Job
924 resource that can run concurrently. Note, this directive limits only Jobs
925 with the same name as the resource in which it appears. Any other
926 restrictions on the maximum concurrent jobs such as in the Director, Client,
927 or Storage resources will also apply in addition to the limit specified here.
928 The default is set to 1, but you may set it to a larger number. We strongly
929 recommend that you read the WARNING documented under
930 \ilink{ Maximum Concurrent Jobs}{DirMaxConJobs} in the Director's
933 \item {\bf Reschedule On Error = \lt{}yes|no\gt{}}
934 \index[dir]{Reschedule On Error }
935 If this directive is enabled, and the job terminates in error, the job will
936 be rescheduled as determined by the {\bf Reschedule Interval} and {\bf
937 Reschedule Times} directives. If you cancel the job, it will not be
938 rescheduled. The default is {\bf no} (i.e. the job will not be rescheduled).
941 This specification can be useful for portables, laptops, or other machines
942 that are not always connected to the network or switched on.
944 \item {\bf Reschedule Interval = \lt{}time-specification\gt{}}
945 \index[dir]{Reschedule Interval }
946 If you have specified {\bf Reschedule On Error = yes} and the job terminates
947 in error, it will be rescheduled after the interval of time specified by
948 {\bf time-specification}. See
949 \ilink{ the time specification formats}{Time} in the Configure
950 chapter for details of time specifications. If no interval is specified, the
951 job will not be rescheduled on error.
953 \item {\bf Reschedule Times = \lt{}count\gt{}}
954 \index[dir]{Reschedule Times }
955 This directive specifies the maximum number of times to reschedule the job.
956 If it is set to zero (the default) the job will be rescheduled an indefinite
960 \item {\bf Priority = \lt{}number\gt{}}
961 \index[dir]{Priority }
962 This directive permits you to control the order in which your jobs run by
963 specifying a positive non-zero number. The higher the number, the lower the
964 job priority. Assuming you are not running concurrent jobs, all queued jobs
965 of priority 1 will run before queued jobs of priority 2 and so on,
966 regardless of the original scheduling order.
968 The priority only affects waiting jobs that are queued to run, not jobs that
969 are already running. If one or more jobs of priority 2 are already running,
970 and a new job is scheduled with priority 1, the currently running priority 2
971 jobs must complete before the priority 1 job is run.
973 The default priority is 10.
975 If you want to run concurrent jobs, which is not recommended, you should keep
976 these points in mind:
979 \item To run concurrent jobs, you must set Maximum Concurrent Jobs = 2 in 5
980 or 6 distinct places: in bacula-dir.conf in the Director, the Job, the
981 Client, the Storage resources; in bacula-fd in the FileDaemon (or Client)
982 resource, and in bacula-sd.conf in the Storage resource. If any one is
983 missing, it will throttle the jobs to one at a time.
984 \item Bacula concurrently runs jobs of only one priority at a time. It will
985 not simultaneously run a priority 1 and a priority 2 job.
986 \item If Bacula is running a priority 2 job and a new priority 1 job is
987 scheduled, it will wait until the running priority 2 job terminates even if
988 the Maximum Concurrent Jobs settings would otherwise allow two jobs to run
990 \item Suppose that bacula is running a priority 2 job and new priority 1 job
991 is scheduled and queued waiting for the running priority 2 job to terminate.
992 If you then start a second priority 2 job, the waiting priority 1 job will
993 prevent the new priority 2 job from running concurrently with the running
994 priority 2 job. That is: as long as there is a higher priority job waiting to
995 run, no new lower priority jobs will start even if the Maximum Concurrent
996 Jobs settings would normally allow them to run. This ensures that higher
997 priority jobs will be run as soon as possible.
1000 If you have several jobs of different priority, it is best not to start them
1001 at exactly the same time, because Bacula must examine them one at a time. If
1002 by chance Bacula treats a lower priority first, then it will run before your
1003 high priority jobs. To avoid this, start any higher priority a few seconds
1004 before lower ones. This insures that Bacula will examine the jobs in the
1005 correct order, and that your priority scheme will be respected.
1006 \label{WritePartAfterJob}
1008 \item {\bf Write Part After Job = \lt{}yes|no\gt{}}
1009 \index[sd]{Write Part After Job }
1010 If this directive is set to {\bf yes} (default {\bf no}), a new part file
1011 will be created after the job is finished.
1013 It should be set to {\bf yes} when writing to devices that require mount (for
1014 example DVD), so you are sure that the current part, containing this job's
1015 data, is written to the device, and that no data is left in the temporary
1016 file on the hard disk. However, on some media, like DVD+R and DVD-R, a lot of
1017 space (about 10Mb) is lost everytime a part is written. So, if you run
1018 several jobs each after another, you could set this directive to {\bf no} for
1019 all jobs, except the last one, to avoid wasting too much space, but to ensure
1020 that the data is written to the medium when all jobs are finished.
1022 It is ignored with tape and FIFO devices.
1025 The following is an example of a valid Job resource definition:
1032 Level = Incremental # default
1034 FileSet="Minou Full Set"
1037 Schedule = "MinouWeeklyCycle"
1043 \section*{The JobDefs Resource}
1044 \label{JobDefsResource}
1045 \index[general]{JobDefs Resource }
1046 \index[general]{Resource!JobDefs }
1047 \addcontentsline{toc}{section}{JobDefs Resource}
1049 The JobDefs resource permits all the same directives that can appear in a Job
1050 resource. However, a JobDefs resource does not create a Job, rather it can be
1051 referenced within a Job to provide defaults for that Job. This permits you to
1052 concisely define several nearly identical Jobs, each one referencing a JobDefs
1053 resource which contains the defaults. Only the changes from the defaults need
1054 be mentioned in each Job.
1056 \section*{The Schedule Resource}
1057 \label{ScheduleResource}
1058 \index[general]{Resource!Schedule }
1059 \index[general]{Schedule Resource }
1060 \addcontentsline{toc}{section}{Schedule Resource}
1062 The Schedule resource provides a means of automatically scheduling a Job as
1063 well as the ability to override the default Level, Pool, Storage and Messages
1064 resources. If a Schedule resource is not referenced in a Job, the Job may only
1065 be run manually. In general, you specify an action to be taken and when.
1070 \index[sd]{Schedule }
1071 Start of the Schedule directives. No {\bf Schedule} resource is required, but
1072 you will need at least one if you want Jobs to be automatically started.
1074 \item [Name = \lt{}name\gt{}]
1076 The name of the schedule being defined. The Name directive is required.
1078 \item [Run = \lt{}Job-overrides\gt{} \lt{}Date-time-specification\gt{} ]
1080 The Run directive defines when a Job is to be run, and what overrides if any
1081 to apply. You may specify multiple {\bf run} directives within a {\bf
1082 Schedule} resource. If you do, they will all be applied (i.e. multiple
1083 schedules). If you have two {\bf Run} directives that start at the same time,
1084 two Jobs will start at the same time (well, within one second of each
1087 The {\bf Job-overrides} permit overriding the Level, the Storage, the
1088 Messages, and the Pool specifications provided in the Job resource. In
1089 addition, the FullPool, the IncrementalPool, and the DifferentialPool
1090 specifications permit overriding the Pool specification according to what
1091 backup Job Level is in effect.
1093 By the use of overrides, you may customize a particular Job. For example, you
1094 may specify a Messages override for your Incremental backups that outputs
1095 messages to a log file, but for your weekly or monthly Full backups, you may
1096 send the output by email by using a different Messages override.
1098 {\bf Job-overrides} are specified as: {\bf keyword=value} where the keyword
1099 is Level, Storage, Messages, Pool, FullPool, DifferentialPool, or
1100 IncrementalPool, and the {\bf value} is as defined on the respective
1101 directive formats for the Job resource. You may specify multiple {\bf
1102 Job-overrides} on one {\bf Run} directive by separating them with one or more
1103 spaces or by separating them with a trailing comma. For example:
1109 is all files in the FileSet whether or not they have changed.
1111 \item [Level=Incremental]
1113 is all files that have changed since the last backup.
1117 specifies to use the Pool named {\bf Weekly}.
1119 \item [Storage=DLT\_Drive]
1120 \index[sd]{Storage }
1121 specifies to use {\bf DLT\_Drive} for the storage device.
1123 \item [Messages=Verbose]
1124 \index[sd]{Messages }
1125 specifies to use the {\bf Verbose} message resource for the Job.
1127 \item [FullPool=Full]
1128 \index[sd]{FullPool }
1129 specifies to use the Pool named {\bf Full} if the job is a full backup, or is
1130 upgraded from another type to a full backup.
1132 \item [DifferentialPool=Differential]
1133 \index[sd]{DifferentialPool }
1134 specifies to use the Pool named {\bf Differential} if the job is a
1135 differential backup.
1137 \item [IncrementalPool=Incremental]
1138 \index[sd]{IncrementalPool }
1139 specifies to use the Pool named {\bf Incremental} if the job is an
1142 \item [SpoolData=yes|no]
1143 \index[sd]{SpoolData }
1144 tells Bacula to request the Storage daemon to spool data to a disk file
1145 before putting it on tape.
1147 \item [WritePartAfterJob=yes|no]
1148 \index[sd]{WritePartAfterJob }
1149 tells Bacula to request the Storage daemon to write the current part file to
1150 the device when the job is finished (see
1151 \ilink{Write Part After Job directive in the Job
1152 resource}{WritePartAfterJob}).
1155 {\bf Date-time-specification} determines when the Job is to be run. The
1156 specification is a repetition, and as a default Bacula is set to run a job at
1157 the beginning of the hour of every hour of every day of every week of every
1158 month of every year. This is not normally what you want, so you must specify
1159 or limit when you want the job to run. Any specification given is assumed to
1160 be repetitive in nature and will serve to override or limit the default
1161 repetition. This is done by specifing masks or times for the hour, day of the
1162 month, day of the week, week of the month, week of the year, and month when
1163 you want the job to run. By specifying one or more of the above, you can
1164 define a schedule to repeat at almost any frequency you want.
1166 Basically, you must supply a {\bf month}, {\bf day}, {\bf hour}, and {\bf
1167 minute} the Job is to be run. Of these four items to be specified, {\bf day}
1168 is special in that you may either specify a day of the month such as 1, 2,
1169 ... 31, or you may specify a day of the week such as Monday, Tuesday, ...
1170 Sunday. Finally, you may also specify a week qualifier to restrict the
1171 schedule to the first, second, third, fourth, or fifth week of the month.
1173 For example, if you specify only a day of the week, such as {\bf Tuesday} the
1174 Job will be run every hour of every Tuesday of every Month. That is the {\bf
1175 month} and {\bf hour} remain set to the defaults of every month and all
1178 Note, by default with no other specification, your job will run at the
1179 beginning of every hour. If you wish your job to run more than once in any
1180 given hour, you will need to specify multiple {\bf run} specifications each
1181 with a different minute.
1183 The date/time to run the Job can be specified in the following way in
1190 <week-keyword> = 1st | 2nd | 3rd | 4th | 5th | first |
1191 second | third | forth | fifth
1192 <wday-keyword> = sun | mon | tue | wed | thu | fri | sat |
1193 sunday | monday | tuesday | wednesday |
1195 <week-of-year-keyword> = w00 | w01 | ... w52 | w53
1196 <month-keyword> = jan | feb | mar | apr | may | jun | jul |
1197 aug | sep | oct | nov | dec | january |
1198 february | ... | december
1199 <daily-keyword> = daily
1200 <weekly-keyword> = weekly
1201 <monthly-keyword> = monthly
1202 <hourly-keyword> = hourly
1203 <digit> = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0
1204 <number> = <digit> | <digit><number>
1205 <12hour> = 0 | 1 | 2 | ... 12
1206 <hour> = 0 | 1 | 2 | ... 23
1207 <minute> = 0 | 1 | 2 | ... 59
1208 <day> = 1 | 2 | ... 31
1209 <time> = <hour>:<minute> |
1210 <12hour>:<minute>am |
1212 <time-spec> = <at-keyword> <time> |
1214 <date-keyword> = <void-keyword> <weekly-keyword>
1215 <day-range> = <day>-<day>
1216 <month-range> = <month-keyword>-<month-keyword>
1217 <wday-range> = <wday-keyword>-<wday-keyword>
1218 <range> = <day-range> | <month-range> |
1220 <date> = <date-keyword> | <day> | <range>
1221 <date-spec> = <date> | <date-spec>
1222 <day-spec> = <day> | <wday-keyword> |
1223 <day-range> | <wday-range> |
1225 <day-spec> = <day> | <wday-keyword> |
1226 <week-keyword> <wday-keyword>
1227 <month-spec> = <month-keyword> | <month-range> |
1229 <date-time-spec> = <month-spec> <day-spec> <time-spec>
1235 Note, the Week of Year specification wnn follows the ISO standard definition
1236 of the week of the year, where Week 1 is the week in which the first Thursday
1237 of the year occurs, or alternatively, the week which contains the 4th of
1238 January. Weeks are numbered w01 to w53. w00 for Bacula is the week that
1239 precedes the first ISO week (i.e. has the first few days of the year if any
1240 occur before Thursday). w00 is not defined by the ISO specification. A week
1241 starts with Monday and ends with Sunday.
1243 An example schedule resource that is named {\bf WeeklyCycle} and runs a job
1244 with level full each Sunday at 1:05am and an incremental job Monday through
1245 Saturday at 1:05am is:
1250 Name = "WeeklyCycle"
1251 Run = Level=Full sun at 1:05
1252 Run = Level=Incremental mon-sat at 1:05
1257 An example of a possible monthly cycle is as follows:
1262 Name = "MonthlyCycle"
1263 Run = Level=Full Pool=Monthly 1st sun at 1:05
1264 Run = Level=Differential 2nd-5th sun at 1:05
1265 Run = Level=Incremental Pool=Daily mon-sat at 1:05
1270 The first of every month:
1276 Run = Level=Full on 1 at 1:05
1277 Run = Level=Incremental on 2-31 at 1:05
1288 Run = Level=Full hourly at 0:05
1289 Run = Level=Full hourly at 0:15
1290 Run = Level=Full hourly at 0:25
1291 Run = Level=Full hourly at 0:35
1292 Run = Level=Full hourly at 0:45
1293 Run = Level=Full hourly at 0:55
1298 \subsection*{Technical Notes on Schedules}
1299 \index[general]{Schedules!Technical Notes on }
1300 \index[general]{Technical Notes on Schedules }
1301 \addcontentsline{toc}{subsection}{Technical Notes on Schedules}
1303 Internally Bacula keeps a schedule as a bit mask. There are six masks and a
1304 minute field to each schedule. The masks are hour, day of the month (mday),
1305 month, day of the week (wday), week of the month (wom), and week of the year
1306 (woy). The schedule is initialized to have the bits of each of these masks
1307 set, which means that at the beginning of every hour, the job will run. When
1308 you specify a month for the first time, the mask will be cleared and the bit
1309 corresponding to your selected month will be selected. If you specify a second
1310 month, the bit corresponding to it will also be added to the mask. Thus when
1311 Bacula checks the masks to see if the bits are set corresponding to the
1312 current time, your job will run only in the two months you have set. Likewise,
1313 if you set a time (hour), the hour mask will be cleared, and the hour you
1314 specify will be set in the bit mask and the minutes will be stored in the
1317 For any schedule you have defined, you can see how these bits are set by doing
1318 a {\bf show schedules} command in the Console program. Please note that the
1319 bit mask is zero based, and Sunday is the first day of the week (bit zero).
1321 \section*{The FileSet Resource}
1322 \label{FileSetResource}
1323 \index[general]{Resource!FileSet }
1324 \index[general]{FileSet Resource }
1325 \addcontentsline{toc}{section}{FileSet Resource}
1327 The FileSet resource defines what files are to be included in a backup job. At
1328 least one {\bf FileSet} resource is required for each backup Job. It consists
1329 of a list of files or directories to be included, a list of files or
1330 directories to be excluded and the various backup options such as compression,
1331 encryption, and signatures that are to be applied to each file.
1333 Any change to the list of the included files will cause Bacula to
1334 automatically create a new FileSet (defined by the name and an MD5 checksum of
1335 the Include contents). Each time a new FileSet is created, Bacula will ensure
1336 that the first backup is always a Full save.
1341 \index[dir]{FileSet }
1342 Start of the FileSet resource. At least one {\bf FileSet} resource must be
1345 \item [Name = \lt{}name\gt{}]
1347 The name of the FileSet resource. This directive is required.
1349 \item [Ignore FileSet Changes = \lt{}yes|no\gt{}
1351 \index[dir]{Ignore FileSet Changes }
1352 If this directive is set to {\bf yes}, any changes you make to the FileSet
1353 Include or Exclude lists will be ignored and not cause Bacula to immediately
1354 perform a Full backup. The default is {\bf no}, in which case, if you change
1355 the Include or Exclude, Bacula will force a Full backup to ensure that
1356 everything is properly backed up. It is not recommended to set this directive
1357 to yes. This directive is available in Bacula version 1.35.4 or later.
1359 \item [{Include \ \{ [ Options \{\lt{}file-options\gt{}\} ...]
1360 \lt{}file-list\gt{} \}
1362 \index[dir]{Include \ \{ [ Options \{\lt{}file-options\gt{}\} ...]
1363 \lt{}file-list\gt{} \} }
1365 \item [Options \ \{ \lt{}file-options\gt{} \}
1367 \index[dir]{Options \ \{ \lt{}file-options\gt{} \} }
1369 \item [Exclude \ \{ \lt{}file-list\gt{} \}]
1370 \index[dir]{Exclude \ \{ \lt{}file-list\gt{} \} }
1372 The Include resource must contain a list of directories and/or files to be
1373 processed in the backup job. Normally, all files found in all subdirectories
1374 of any directory in the Include File list will be backed up. The Include
1375 resource may also oner more Options resources that specify options such as
1376 compression to be applied to all or any subset of the files found for backup.
1378 There can be any number of {\bf Include} resources within the FileSet, each
1379 having its own list of directories or files to be backed up and the backup
1380 options defined by one or more Options resources. The {\bf file-list} consists
1381 of one file or directory name per line. Directory names should be specified
1382 without a trailing slash.
1384 You should always specify a full path for every directory and file that you
1385 list in the FileSet. In addition, on Windows machines, you should {\bf always}
1386 prefix the directory or filename with the drive specification (e.g. {\bf
1387 c:/xxx}) using Unix directory name separators (forward slash).
1389 Bacula's default for processing directories is to recursively descend in the
1390 directory saving all files and subdirectories. Bacula will not by default
1391 cross filesystems (or mount points in Unix parlance). This means that if you
1392 specify the root partition (e.g. {\bf /}), Bacula will save only the root
1393 partition and not any of the other mounted filesystems. Similarly on Windows
1394 systems, you must explicitly specify each of the drives you want saved (e.g.
1395 {\bf c:/} and {\bf d:/} ...). In addition, at least for Windows systems, you
1396 will most likely want to enclose each specification within double quotes
1397 particularly if the directory (or file) name contains spaces. The {\bf df}
1398 command on Unix systems will show you which mount points you must specify to
1399 save everything. See below for an example.
1401 Take special care not to include a directory twice or Bacula will backup the
1402 same files two times wasting a lot of space on your archive device. Including
1403 a directory twice is very easy to do. For example:
1410 Options { compression=GZIP }
1415 on a Unix system where /usr is a subdirectory (rather than a mounted
1416 filesystem) will cause /usr to be backed up twice. In this case, on Bacula
1417 versions prior to 1.32f-5-09Mar04 due to a bug, you will not be able to
1418 restore hard linked files that were backed up twice.
1420 If you have used Bacula prior to version 1.34.3, you will note three things in
1421 the new FileSet syntax:
1424 \item There is no equal sign (=) after the include and before the opening
1426 \item Each directory (or filename) to be backed up is preceded by a {\bf File
1427 =}. Previously they were simply listed on separate lines.
1428 \item The options that previously appeared on the Include line now must be
1429 specified within their own Options resource.
1432 The Options resource is optional, but when specified, it will contain a list
1433 of {\bf keyword=value} options to be applied to the file-list. Multiple
1434 Options resources may be specified one after another. As the files are found
1435 in the specified directories, the Options will applied to the filenames to
1436 determine if and how the file should be backed up. The Options resources are
1437 applied in the order they are specified in the FileSet until the first one
1438 that matches. An Options resource that does not contain a {\bf wild} directive
1439 (wild-card specification, see below) is assumed to match any filename. This is
1440 important to understand, because once Bacula determine that the Options
1441 matches the file under consideration, that file will be saved without looking
1442 at any other Options resources that may be present. This means that any wild
1443 cards must appear before an Option resource without wild cards.
1445 If for some reason, Bacula applies all the Options resources to a file under
1446 consideration for backup, but there are no matches (generally because of wild
1447 cards that don't match), Bacula as a default will then backup the file. This
1448 is quite logical if you consider the case of no Options, where you want
1449 everything to be backed up. However, one additional point is that in the case
1450 that no match was found, Bacula will use the options found in the last Options
1451 resource. As a consequence, if you want a particular set of ``default''
1452 options, you should put them in an Options resource after any other Options.
1454 The directives within an Options resource may be one of the following:
1458 \item [compression=GZIP]
1459 \index[fd]{compression }
1460 All files saved will be software compressed using the GNU ZIP compression
1461 format. The compression is done on a file by file basis by the File daemon.
1462 If there is a problem reading the tape in a single record of a file, it will
1463 at most affect that file and none of the other files on the tape. Normally
1464 this option is {\bf not} needed if you have a modern tape drive as the drive
1465 will do its own compression. In fact, if you specify software compression at
1466 the same time you have hardware compression turned on, your files may
1467 actually take more space on the volume.
1469 Software compression is very important if you are writing your Volumes to a
1470 file, and it can also be helpful if you have a fast computer but a slow
1473 Specifying {\bf GZIP} uses the default compression level six (i.e. {\bf GZIP}
1474 is identical to {\bf GZIP6}). If you want a different compression level (1
1475 through 9), you can specify it by appending the level number with no
1476 intervening spaces to {\bf GZIP}. Thus {\bf compression=GZIP1} would give
1477 minimum compression but the fastest algorithm, and {\bf compression=GZIP9}
1478 would give the highest level of compression, but requires more computation.
1479 According to the GZIP documentation, compression levels greater than 6
1480 generally give very little extra compression and are rather CPU intensive.
1482 \item [signature=SHA1]
1483 \index[fd]{signature }
1484 An SHA1 signature will be computed for all The SHA1 algorithm is purported to
1485 be some what slower than the MD5 algorithm, but at the same time is
1486 significantly better from a cryptographic point of view (i.e. much fewer
1487 collisions, much lower probability of being hacked.) It adds four more bytes
1488 than the MD5 signature. We strongly recommend that either this option or MD5
1489 be specified as a default for all files. Note, only one of the two options
1490 MD5 or SHA1 can be computed for any file.
1492 \item [signature=MD5]
1493 \index[fd]{signature }
1494 An MD5 signature will be computed for all files saved. Adding this option
1495 generates about 5\% extra overhead for each file saved. In addition to the
1496 additional CPU time, the MD5 signature adds 16 more bytes per file to your
1497 catalog. We strongly recommend that this option or the SHA1 option be
1498 specified as a default for all files.
1500 \item [verify=\lt{}options\gt{}]
1502 The options letters specified are used when running a {\bf Verify
1503 Level=Catalog} as well as the {\bf DiskToCatalog} level job. The options
1504 letters may be any combination of the following:
1512 compare the permission bits
1515 compare the number of links
1521 compare the group id
1527 compare the access time
1530 compare the modification time (st\_mtime)
1533 compare the change time (st\_ctime)
1536 report file size decreases
1539 compare the MD5 signature
1542 compare the SHA1 signature
1545 A useful set of general options on the {\bf Level=Catalog} or {\bf
1546 Level=DiskToCatalog} verify is {\bf pins5} i.e. compare permission bits,
1547 inodes, number of links, size, and MD5 changes.
1549 \item {\bf onefs=yes|no}
1551 If set to {\bf yes} (the default), {\bf Bacula} will remain on a single file
1552 system. That is it will not backup file systems that are mounted on a
1553 subdirectory. If you wish to backup multiple filesystems, you can explicitly
1554 list each file system you want saved. Otherwise, if you set the onefs option
1555 to {\bf no}, Bacula will backup all mounted file systems (i.e. traverse mount
1556 points) that are found within the {\bf FileSet}. Thus if you have NFS or
1557 Samba file systems mounted on a directory listed in your FileSet, they will
1558 also be backed up. Normally, it is preferable to set {\bf onefs=yes} and to
1559 explicitly name each filesystem you want backed up. Explicitly naming the
1560 filesystems you want backed up avoids the possibility of getting into a
1561 infinite loop recursing filesystems. See the example below for more details.
1564 \item {\bf portable=yes|no}
1565 \index[dir]{portable }
1566 If set to {\bf yes} (default is {\bf no}), the Bacula File daemon will backup
1567 Win32 files in a portable format, but not all Win32 file attributes will be
1568 saved and restored. By default, this option is set to {\bf no}, which means
1569 that on Win32 systems, the data will be backed up using Windows API calls and
1570 on WinNT/2K/XP, all the security and ownership attributes will be properly
1571 backed up (and restored). However this format is not portable to other
1572 systems -- e.g. Unix, Win95/98/Me. When backing up Unix systems, this option
1573 is ignored, and unless you have a specific need to have portable backups, we
1574 recommend accept the default ({\bf no}) so that the maximum information
1575 concerning your files is saved.
1577 \item {\bf recurse=yes|no}
1578 \index[fd]{recurse }
1579 If set to {\bf yes} (the default), Bacula will recurse (or descend) into all
1580 subdirectories found unless the directory is explicitly excluded using an
1581 {\bf exclude} definition. If you set {\bf recurse=no}, Bacula will save the
1582 subdirectory entries, but not descend into the subdirectories, and thus will
1583 not save the files or directories contained in the subdirectories. Normally,
1584 you will want the default ({\bf yes}).
1586 \item {\bf sparse=yes|no}
1587 \index[dir]{sparse }
1588 Enable special code that checks for sparse files such as created by ndbm. The
1589 default is {\bf no}, so no checks are made for sparse files. You may specify
1590 {\bf sparse=yes} even on files that are not sparse file. No harm will be
1591 done, but there will be a small additional overhead to check for buffers of
1592 all zero, and a small additional amount of space on the output archive will
1593 be used to save the seek address of each non-zero record read.
1595 {\bf Restrictions:} Bacula reads files in 32K buffers. If the whole buffer is
1596 zero, it will be treated as a sparse block and not written to tape. However,
1597 if any part of the buffer is non-zero, the whole buffer will be written to
1598 tape, possibly including some disk sectors (generally 4098 bytes) that are
1599 all zero. As a consequence, Bacula's detection of sparse blocks is in 32K
1600 increments rather than the system block size. If anyone considers this to be
1601 a real problem, please send in a request for change with the reason. The
1602 sparse code was first implemented in version 1.27.
1604 If you are not familiar with sparse files, an example is say a file where you
1605 wrote 512 bytes at address zero, then 512 bytes at address 1 million. The
1606 operating system will allocate only two blocks, and the empty space or hole
1607 will have nothing allocated. However, when you read the sparse file and read
1608 the addresses where nothing was written, the OS will return all zeros as if
1609 the space were allocated, and if you backup such a file, a lot of space will
1610 be used to write zeros to the volume. Worse yet, when you restore the file,
1611 all the previously empty space will now be allocated using much more disk
1612 space. By turning on the {\bf sparse} option, Bacula will specifically look
1613 for empty space in the file, and any empty space will not be written to the
1614 Volume, nor will it be restored. The price to pay for this is that Bacula
1615 must search each block it reads before writing it. On a slow system, this may
1616 be important. If you suspect you have sparse files, you should benchmark the
1617 difference or set sparse for only those files that are really sparse.
1620 \item {\bf readfifo=yes|no}
1621 \index[fd]{readfifo }
1622 If enabled, tells the Client to read the data on a backup and write the data
1623 on a restore to any FIFO (pipe) that is explicitly mentioned in the FileSet.
1624 In this case, you must have a program already running that writes into the
1625 FIFO for a backup or reads from the FIFO on a restore. This can be
1626 accomplished with the {\bf RunBeforeJob} directive. If this is not the case,
1627 Bacula will hang indefinitely on reading/writing the FIFO. When this is not
1628 enabled (default), the Client simply saves the directory entry for the FIFO.
1630 \item {\bf mtimeonly=yes|no}
1631 \index[dir]{mtimeonly }
1632 If enabled, tells the Client that the selection of files during Incremental
1633 and Differential backups should based only on the st\_mtime value in the
1634 stat() packet. The default is {\bf no} which means that the selection of
1635 files to be backed up will be based on both the st\_mtime and the st\_ctime
1636 values. In general, it is not recommended to use this option.
1638 \item {\bf keepatime=yes|no}
1639 \index[dir]{keepatime }
1640 The default is {\bf no}. When enabled, Bacula will reset the st\_atime
1641 (access time) field of files that it backs up to their value prior to the
1642 backup. This option is not generally recommended as there are very few
1643 programs that use st\_atime, and the backup overhead is increased because of
1644 the additional system call necessary to reset the times. (I'm not sure this
1647 \item {\bf wild=\lt{}string\gt{}}
1649 Specifies a wild-card string to be applied to the Files. Note, if {\bf
1650 Exclude} is not enabled, the wild-card will select which files are to be
1651 included. If {\bf Exclude=yes} is specified, the wild-card will select which
1652 files are to be excluded. Multiple wild-card directives may be specified, and
1653 they will be applied in turn until the first one that matches.
1655 \item {\bf regex=\lt{}string\gt{}}
1657 Specifies a POSIX extended regular expression to be applied to the Files.
1658 This directive is available in version 1.35 and later. If {\bf Exclude} is
1659 not enabled, the regex will select which files are to be included. If {\bf
1660 Exclude=yes} is specified, the regex will select which files are to be
1661 excluded. Multiple regex directives may be specified within an Options
1662 resource, and they will be applied in turn until the first one that matches.
1665 \item {\bf exclude=yes|no}
1666 \index[dir]{exclude }
1667 The default is {\bf no}. When enabled, any files matched within the Options
1668 will be excluded from the backup.
1671 \item {\bf aclsupport=yes|no}
1672 \index[dir]{aclsupport }
1673 The default is {\bf no}. If this option is set to yes, and you have the POSIX
1674 {\bf libacl} installed on your system, Bacula will backup the file and
1675 directory UNIX Access Control Lists (ACL) as defined in IEEE Std 1003.1e
1676 draft 17 and ``POSIX.1e'' (abandoned). This feature is available on UNIX only
1677 and depends on the ACL library. Bacula is automatically compiled with ACL
1678 support if the {\bf libacl} library is installed on your system (shown in
1679 config.out). While restoring the files Bacula will try to restore the ACLs,
1680 if there is no ACL support available on the system, Bacula restores the files
1681 and directories but not the ACL information. Please note, if you backup an
1682 EXT3 or XFS filesystem with ACLs, then you restore them to a different
1683 filesystem (perhaps reiserfs) that does not have ACLs, the ACLs will be
1687 {\bf \lt{}file-list\gt{}} is a list of directory and/or filename names
1688 specified with a {\bf File =} directive. To include names containing spaces,
1689 enclose the name between double-quotes.
1691 There are a number of special cases when specifying directories and files in a
1692 {\bf file-list}. They are:
1695 \item Any name preceded by an at-sign (@) is assumed to be the name of a
1696 file, which contains a list of files each preceded by a ``File =''. The named
1697 file is read once when the configuration file is parsed during the Director
1698 startup. Note, that the file is read on the Director's machine and not on
1699 the Client's. In fact, the @filename can appear anywhere within the conf file
1700 where a token would be read, and the contents of the named file will be
1701 logically inserted in the place of the @filename. What must be in the file
1702 depends on the location the @filename is specified in the conf file.
1703 \item Any name beginning with a vertical bar (|) is assumed to be the name of
1704 a program. This program will be executed on the Director's machine at the
1705 time the Job starts (not when the Director reads the configuration file), and
1706 any output from that program will be assumed to be a list of files or
1707 directories, one per line, to be included. This allows you to have a job that
1708 for example includes all the local partitions even if you change the
1709 partitioning by adding a disk. In general, you will need to prefix your
1710 command or commands with a {\bf sh -c} so that they are invoked by a shell.
1711 This will not be the case if you are invoking a script as in the second
1712 example below. Also, you must take care to escape (precede with a
1713 \textbackslash{}) wild-cards, shell character, and to ensure that any spaces
1714 in your command are escaped as well. If you use a single quotes (') within a
1715 double quote (``), Bacula will treat everything between the single quotes as
1716 one field so it will not be necessary to escape the spaces. In general,
1717 getting all the quotes and escapes correct is a real pain as you can see by
1718 the next example. As a consequence, it is often easier to put everything in a
1719 file and simply use the file name within Bacula. In that case the {\bf sh
1720 -c} will not be necessary providing the first line of the file is {\bf
1729 Options { signature = SHA1 }
1730 File = "|sh -c 'df -l | grep \"^/dev/hd[ab]\" | grep -v \".*/tmp\" \
1731 | awk \"{print \\$6}\"'"
1736 will produce a list of all the local partitions on a RedHat Linux system.
1737 Note, the above line was split, but should normally be written on one line.
1738 Quoting is a real problem because you must quote for Bacula which consists of
1739 preceding every \textbackslash{} and every '' with a \textbackslash{}, and
1740 you must also quote for the shell command. In the end, it is probably easier
1741 just to execute a small file with:
1749 File = "|my_partitions"
1754 where my\_partitions has:
1759 df -l | grep "^/dev/hd[ab]" | grep -v ".*/tmp" \
1764 If the vertical bar (|) in front of my\_partitions is preceded by a backslash
1765 as in \textbackslash{}|, the program will be executed on the Client's machine
1766 instead of on the Director's machine -- (this is implemented but not
1767 thoroughly tested, and is reported to work on Windows). Please note that if
1768 the filename is given within quotes, you will need to use two slashes. An
1769 example, provided by John Donagher, that backs up all the local UFS
1770 partitions on a remote system is:
1775 Name = "All local partitions"
1777 Options { signature=SHA1; onefs=yes; }
1778 File = "\\|bash -c \"df -klF ufs | tail +2 | awk '{print \$6}'\""
1784 Note, it requires two backslash characters after the double quote (one
1785 preserves the next one). If you are a Linux user, just change the {\bf ufs}
1786 to {\bf ext3} (or your preferred filesystem type) and you will be in
1788 \item Any file-list item preceded by a less-than sign (\lt{}) will be taken
1789 to be a file. This file will be read on the Director's machine at the time
1790 the Job starts, and the data will be assumed to be a list of directories or
1791 files, one per line, to be included. The names should not be quoted even if
1792 they contain spaces. This feature allows you to modify the external file and
1793 change what will be saved without stopping and restarting Bacula as would be
1794 necessary if using the @ modifier noted above.
1796 If you precede the less-than sign (\lt{}) with a backslash as in
1797 \textbackslash{}\lt{}, the file-list will be read on the Client machine
1798 instead of on the Director's machine. Please note that if the filename is
1799 given within quotes, you will need to use two slashes.
1800 \item If you explicitly specify a block device such as {\bf /dev/hda1}, then
1801 Bacula (starting with version 1.28) will assume that this is a raw partition
1802 to be backed up. In this case, you are strongly urged to specify a {\bf
1803 sparse=yes} include option, otherwise, you will save the whole partition
1804 rather than just the actual data that the partition contains. For example:
1809 Options { signature=MD5; sparse=yes }
1815 will backup the data in device /dev/hd6.
1817 Ludovic Strappazon has pointed out that this feature can be used to backup a
1818 full Microsoft Windows disk. Simply boot into the system using a Linux Rescue
1819 disk, then load a statically linked Bacula as described in the
1820 \ilink{ Disaster Recovery Using Bacula}{_ChapterStart38} chapter of
1821 this manual. Then save the whole disk partition. In the case of a disaster,
1822 you can then restore the desired partition by again booting with the rescue
1823 disk and doing a restore of the partition.
1824 \item If you explicitly specify a FIFO device name (created with mkfifo), and
1825 you add the option {\bf readfifo=yes} as an option, Bacula will read the FIFO
1826 and back its data up to the Volume. For example:
1835 File = /home/abc/fifo
1840 if {\bf /home/abc/fifo} is a fifo device, Bacula will open the fifo, read it,
1841 and store all data thus obtained on the Volume. Please note, you must have a
1842 process on the system that is writing into the fifo, or Bacula will hang,
1843 and after one minute of waiting, Bacula will give up and go on to the next
1844 file. The data read can be anything since Bacula treats it as a stream.
1846 This feature can be an excellent way to do a ``hot'' backup of a very large
1847 database. You can use the {\bf RunBeforeJob} to create the fifo and to start
1848 a program that dynamically reads your database and writes it to the fifo.
1849 Bacula will then write it to the Volume.
1851 During the restore operation, the inverse is true, after Bacula creates the
1852 fifo if there was any data stored with it (no need to explicitly list it or
1853 add any options), that data will be written back to the fifo. As a
1854 consequence, if any such FIFOs exist in the fileset to be restored, you must
1855 ensure that there is a reader program or Bacula will block, and after one
1856 minute, Bacula will time out the write to the fifo and move on to the next
1862 The following is an example of a valid FileSet resource definition. Note, the
1863 first Include pulls in the contents of the file {\bf /etc/backup.list} when
1864 Bacula is started (i.e. the @).
1876 File = @/etc/backup.list
1884 File = /usr/lib/another_file
1890 Note, in the above example, all the files contained in /etc/backup.list will
1891 be compressed with GZIP compression, an SHA1 signature will be computed on the
1892 file's contents (its data), and sparse file handling will apply.
1894 The two directories /root/myfile and /usr/lib/another\_file will also be saved
1895 without any options, but all files in those directories with the extension
1896 {\bf .o} will be excluded.
1898 Suppose you want to save everything except {\bf /tmp} on your system. Doing a
1899 {\bf df} command, you get the following output:
1904 Filesystem 1k-blocks Used Available Use% Mounted on
1905 /dev/hda5 5044156 439232 4348692 10% /
1906 /dev/hda1 62193 4935 54047 9% /boot
1907 /dev/hda9 20161172 5524660 13612372 29% /home
1908 /dev/hda2 62217 6843 52161 12% /rescue
1909 /dev/hda8 5044156 42548 4745376 1% /tmp
1910 /dev/hda6 5044156 2613132 2174792 55% /usr
1911 none 127708 0 127708 0% /dev/shm
1912 //minimatou/c$ 14099200 9895424 4203776 71% /mnt/mmatou
1913 lmatou:/ 1554264 215884 1258056 15% /mnt/matou
1914 lmatou:/home 2478140 1589952 760072 68% /mnt/matou/home
1915 lmatou:/usr 1981000 1199960 678628 64% /mnt/matou/usr
1916 lpmatou:/ 995116 484112 459596 52% /mnt/pmatou
1917 lpmatou:/home 19222656 2787880 15458228 16% /mnt/pmatou/home
1918 lpmatou:/usr 2478140 2038764 311260 87% /mnt/pmatou/usr
1919 deuter:/ 4806936 97684 4465064 3% /mnt/deuter
1920 deuter:/home 4806904 280100 4282620 7% /mnt/deuter/home
1921 deuter:/files 44133352 27652876 14238608 67% /mnt/deuter/files
1925 If you specify only {\bf /} in your Include list, Bacula will only save the
1926 Filesystem {\bf /dev/hda5}. To save all file systems except {\bf /tmp} with
1927 out including any of the Samba or NFS mounted systems, and explicitly
1928 excluding a /tmp, /proc, .journal, and .autofsck, which you will not want to
1929 be saved and restored, you can use the following:
1934 Name = Include_example
1953 Since /tmp is on its own filesystem and it was not explicitly named in the
1954 Include list, it is not really needed in the exclude list. It is better to
1955 list it in the Exclude list for clarity, and in case the disks are changed so
1956 that it is no longer in its own partition.
1958 Please be aware that allowing Bacula to traverse or change file systems can be
1959 {\bf very} dangerous. For example, with the following:
1964 Name = "Bad example"
1966 Options { onefs=no }
1973 you will be backing up an NFS mounted partition ({\bf /mnt/matou}), and since
1974 {\bf onefs} is set to {\bf no}, Bacula will traverse file systems. Now if {\bf
1975 /mnt/matou} has the current machine's file systems mounted, as is often the
1976 case, you will get yourself into a recursive loop and the backup will never
1979 The following FileSet definition will backup a raw partition:
1984 Name = "RawPartition"
1986 Options { sparse=yes }
1993 While backing up and restoring a raw partition, you should ensure that no
1994 other process including the system is writing to that partition. As a
1995 precaution, you are strongly urged to ensure that the raw partition is not
1996 mounted or is mounted read-only. If necessary, this can be done using the {\bf
1997 RunBeforeJob} directive.
2000 \subsection*{Windows Considerations for FileSets}
2001 \index[general]{FileSets!Windows Considerations for }
2002 \index[general]{Windows Considerations for FileSets }
2003 \addcontentsline{toc}{subsection}{Windows Considerations for FileSets}
2005 If you are entering Windows file names, the directory path may be preceded by
2006 the drive and a colon (as in c:). However, the path separators must be
2007 specified in Unix convention (i.e. forward slash (/)). If you wish to include
2008 a quote in a file name, precede the quote with a backslash
2009 (\textbackslash{}\textbackslash{}). For example you might use the following
2010 for a Windows machine to backup the ``My Documents'' directory:
2015 Name = "Windows Set"
2022 File = "c:/My Documents"
2028 For exclude lists to work correctly on Windows, you must observe the following
2032 \item Filenames are case sensitive, so you must use the correct case.
2033 \item To exclude a directory, you must not have a trailing slash on the
2035 \item If you have spaces in your filename, you must enclose the entire name
2036 in double-quote characters (``). Trying to use a backslash before the space
2038 \item If you are using the old Exclude syntax (noted below), you may not
2039 specify a drive letter in the exclude. The new syntax noted above should work
2040 fine including driver letters.
2043 Thanks to Thiago Lima for summarizing the above items for us. If you are
2044 having difficulties getting includes or excludes to work, you might want to
2045 try using the {\bf estimate job=xxx listing} command documented in the
2046 \ilink{Console chapter}{estimate} of this manual.
2048 On Win32 systems, if you move a directory or file or rename a file into the
2049 set of files being backed up, and a Full backup has already been made, Bacula
2050 will not know there are new files to be saved during an Incremental or
2051 Differential backup (blame Microsoft, not me). To avoid this problem, please
2052 {\bf copy} any new directory or files into the backup area. If you do not have
2053 enough disk to copy the directory or files, move them, but then initiate a
2056 \subsubsection*{Excluding Files and Directories}
2057 \index[general]{Directories!Excluding Files and }
2058 \index[general]{Excluding Files and Directories }
2059 \addcontentsline{toc}{subsubsection}{Excluding Files and Directories}
2061 You may also include full filenames or directory names in addition to using
2062 wild-cards and {\bf Exclude=yes} in the Options resource as specified above by
2063 simply including the files to be excluded in an Exclude resource within the
2064 FileSet. For example:
2069 Name = Exclusion_example
2090 \subsection*{A Windows Example FileSet}
2091 \index[general]{FileSet!Windows Example }
2092 \index[general]{Windows Example FileSet }
2093 \addcontentsline{toc}{subsection}{Windows Example FileSet}
2095 The following example was contributed by Phil Stracchino:
2099 This is my Windows 2000 fileset:
2101 Name = "Windows 2000 Full Set"
2109 # Most of these files are excluded not because we don't want
2110 # them, but because Win2K won't allow them to be backed up
2111 # except via proprietary Win32 API calls.
2112 File = "/Documents and Settings/*/Application Data/*/Profiles/
2114 File = "/Documents and Settings/*/Local Settings/Application Data/
2115 Microsoft/Windows/[Uu][Ss][Rr][Cc][Ll][Aa][Ss][Ss].*"
2116 File = "/Documents and Settings/*/[Nn][Tt][Uu][Ss][Ee][Rr].*"
2117 File = "/Documents and Settings/*/Cookies/*"
2118 File = "/Documents and Settings/*/Local Settings/History/*"
2119 File = "/Documents and Settings/*/Local Settings/
2120 Temporary Internet Files/*"
2121 File = "/Documents and Settings/*/Local Settings/Temp/*"
2123 File = "/WINNT/security/logs/scepol.log"
2124 File = "/WINNT/system32/config/*"
2125 File = "/WINNT/msdownld.tmp/*"
2126 File = "/WINNT/Internet Logs/*"
2127 File = "/WINNT/$Nt*Uninstall*"
2128 File = "/WINNT/Temp/*"
2131 File = "/pagefile.sys"
2137 Note, the three line of the above Exclude were split to fit on the document
2138 page, they should be written on a single line in real use.
2140 \subsection*{The Old FileSet Resource}
2141 \index[general]{Resource!Old FileSet }
2142 \index[general]{Old FileSet Resource }
2143 \addcontentsline{toc}{subsection}{Old FileSet Resource}
2145 The old pre-version 1.34.3 FileSet Resource has been deprecated but will still
2146 work. You are encouraged to convert to using the new form since the old code
2147 will be removed in version 1.37.
2149 \subsection*{Testing Your FileSet}
2150 \index[general]{FileSet!Testing Your }
2151 \index[general]{Testing Your FileSet }
2152 \addcontentsline{toc}{subsection}{Testing Your FileSet}
2154 If you wish to get an idea of what your FileSet will really backup or if your
2155 exclusion rules will work correctly, you can test it by using the {\bf
2156 estimate} command in the Console program. See the
2157 \ilink{estimate command}{estimate} in the Console chapter of this
2160 \subsection*{Windows NTFS Naming Considerations}
2161 \index[general]{Windows NTFS Naming Considerations }
2162 \index[general]{Considerations!Windows NTFS Naming }
2163 \addcontentsline{toc}{subsection}{Windows NTFS Naming Considerations}
2165 NTFS filenames containing Unicode characters (i.e. \gt{} 0xFF) cannot be
2166 explicitly named at the moment. You must include such names by naming a higher
2167 level directory or a drive letter that does not contain Unicode characters.
2169 \section*{The Client Resource}
2170 \label{ClientResource2}
2171 \index[general]{Resource!Client }
2172 \index[general]{Client Resource }
2173 \addcontentsline{toc}{section}{Client Resource}
2175 The Client resource defines the attributes of the Clients that are served by
2176 this Director; that is the machines that are to be backed up. You will need
2177 one Client resource definition for each machine to be backed up.
2181 \item [Client (or FileDaemon)]
2182 \index[dir]{Client (or FileDaemon) }
2183 Start of the Client directives.
2185 \item [Name = \lt{}name\gt{}]
2187 The client name which will be used in the Job resource directive or in the
2188 console run command. This directive is required.
2190 \item [Address = \lt{}address\gt{}]
2191 \index[console]{Address }
2192 Where the address is a host name, a fully qualified domain name, or a network
2193 address in dotted quad notation for a Bacula File server daemon. This
2194 directive is required.
2196 \item [FD Port = \lt{}port-number\gt{}]
2197 \index[console]{FD Port }
2198 Where the port is a port number at which the Bacula File server daemon can be
2199 contacted. The default is 9102.
2201 \item [Catalog = \lt{}Catalog-resource-name\gt{}]
2202 \index[console]{Catalog }
2203 This specifies the name of the catalog resource to be used for this Client.
2204 This directive is required.
2206 \item [Password = \lt{}password\gt{}]
2207 \index[console]{Password }
2208 This is the password to be used when establishing a connection with the File
2209 services, so the Client configuration file on the machine to be backed up
2210 must have the same password defined for this Director. This directive is
2211 required. If you have either {\bf /dev/random} {\bf bc} on your machine,
2212 Bacula will generate a random password during the configuration process,
2213 otherwise it will be left blank.
2214 \label{FileRetention}
2216 \item [File Retention = \lt{}time-period-specification\gt{} ]
2217 \index[fd]{File Retention }
2218 The File Retention directive defines the length of time that Bacula will keep
2219 File records in the Catalog database. When this time period expires, and if
2220 {\bf AutoPrune} is set to {\bf yes} Bacula will prune (remove) File records
2221 that are older than the specified File Retention period. Note, this affects
2222 only records in the catalog database. It does not effect your archive
2225 File records may actually be retained for a shorter period than you specify
2226 on this directive if you specify either a shorter {\bf Job Retention} or
2227 shorter {\bf Volume Retention} period. The shortest retention period of the
2228 three takes precedence. The time may be expressed in seconds, minutes,
2229 hours, days, weeks, months, quarters, or years. See the
2230 \ilink{ Configuration chapter}{Time} of this manual for
2231 additional details of time specification.
2233 The default is 60 days.
2234 \label{JobRetention}
2236 \item [Job Retention = \lt{}time-period-specification\gt{} ]
2237 \index[fd]{Job Retention }
2238 The Job Retention directive defines the length of time that Bacula will keep
2239 Job records in the Catalog database. When this time period expires, and if
2240 {\bf AutoPrune} is set to {\bf yes} Bacula will prune (remove) Job records
2241 that are older than the specified File Retention period. As with the other
2242 retention periods, this affects only records in the catalog and not data in
2243 your archive backup.
2245 If a Job record is selected for pruning, all associated File and JobMedia
2246 records will also be pruned regardless of the File Retention period set. As a
2247 consequence, you normally will set the File retention period to be less than
2248 the Job retention period. The Job retention period can actually be less than
2249 the value you specify here if you set the {\bf Volume Retention} directive in
2250 the Pool resource to a smaller duration. This is because the Job retention
2251 period and the Volume retention period are independently applied, so the
2252 smaller of the two takes precedence.
2254 The Job retention period is specified as seconds, minutes, hours, days,
2255 weeks, months, quarters, or years. See the
2256 \ilink{ Configuration chapter}{Time} of this manual for
2257 additional details of time specification.
2259 The default is 180 days.
2262 \item [AutoPrune = \lt{}yes|no\gt{}]
2263 \index[fd]{AutoPrune }
2264 If AutoPrune is set to {\bf yes} (default), Bacula (version 1.20 or greater)
2265 will automatically apply the File retention period and the Job retention
2266 period for the Client at the end of the Job. If you set {\bf AutoPrune = no},
2267 pruning will not be done, and your Catalog will grow in size each time you
2268 run a Job. Pruning affects only information in the catalog and not data
2269 stored in the backup archives (on Volumes).
2271 \item [Maximum Concurrent Jobs = \lt{}number\gt{}]
2272 \index[fd]{Maximum Concurrent Jobs }
2273 where \lt{}number\gt{} is the maximum number of Jobs with the current Client
2274 that can run concurrently. Note, this directive limits only Jobs for Clients
2275 with the same name as the resource in which it appears. Any other
2276 restrictions on the maximum concurrent jobs such as in the Director, Job, or
2277 Storage resources will also apply in addition to any limit specified here.
2278 The default is set to 1, but you may set it to a larger number. We strongly
2279 recommend that you read the WARNING documented under
2280 \ilink{ Maximum Concurrent Jobs}{DirMaxConJobs} in the Director's
2283 \item [*Priority = \lt{}number\gt{}]
2284 \index[fd]{*Priority }
2285 The number specifies the priority of this client relative to other clients
2286 that the Director is processing simultaneously. The priority can range from
2287 1 to 1000. The clients are ordered such that the smaller number priorities
2288 are performed first (not currently implemented).
2291 The following is an example of a valid Client resource definition:
2299 Password = very_good
2304 \section*{The Storage Resource}
2305 \label{StorageResource2}
2306 \index[general]{Resource!Storage }
2307 \index[general]{Storage Resource }
2308 \addcontentsline{toc}{section}{Storage Resource}
2310 The Storage resource defines which Storage daemons are available for use by
2316 \index[fd]{Storage }
2317 Start of the Storage resources. At least one storage resource must be
2320 \item [Name = \lt{}name\gt{}]
2322 The name of the storage resource. This name appears on the Storage directive
2323 specified in the Job directive and is required.
2325 \item [Address = \lt{}address\gt{}]
2326 \index[sd]{Address }
2327 Where the address is a host name, a {\bf fully qualified domain name}, or an
2328 {\bf IP address}. Please note that the \lt{}address\gt{} as specified here
2329 will be transmitted to the File daemon who will then use it to contact the
2330 Storage daemon. Hence, it is {\bf not}, a good idea to use {\bf localhost} as
2331 the name but rather a fully qualified machine name or an IP address. This
2332 directive is required.
2334 \item [SD Port = \lt{}port\gt{}]
2335 \index[sd]{SD Port }
2336 Where port is the port to use to contact the storage daemon for information
2337 and to start jobs. This same port number must appear in the Storage resource
2338 of the Storage daemon's configuration file. The default is 9103.
2340 \item [Password = \lt{}password\gt{}]
2341 \index[sd]{Password }
2342 This is the password to be used when establishing a connection with the
2343 Storage services. This same password also must appear in the Director
2344 resource of the Storage daemon's configuration file. This directive is
2345 required. If you have either {\bf /dev/random} {\bf bc} on your machine,
2346 Bacula will generate a random password during the configuration process,
2347 otherwise it will be left blank.
2349 \item [Device = \lt{}device-name\gt{}]
2351 This directive specifies the name of the device to be used to for the
2352 storage. This name is not the physical device name, but the logical device
2353 name as defined on the {\bf Name} directive contained in the {\bf Device}
2354 resource definition of the {\bf Storage daemon} configuration file. You can
2355 specify any name you would like (even the device name if you prefer) up to a
2356 maximum of 127 characters in length. The physical device name associated with
2357 this device is specified in the {\bf Storage daemon} configuration file (as
2358 {\bf Archive Device}). Please take care not to define two different Storage
2359 resource directives in the Director that point to the same Device in the
2360 Storage daemon. Doing so may cause the Storage daemon to block (or hang)
2361 attempting to open the same device that is already open. This directive is
2364 \item [Media Type = \lt{}MediaType\gt{}]
2365 \index[fd]{Media Type }
2366 This directive specifies the Media Type to be used to store the data. This is
2367 an arbitrary string of characters up to 127 maximum that you define. It can
2368 be anything you want. However, it is best to make it descriptive of the
2369 storage media (e.g. File, DAT, ''HP DLT8000``, 8mm, ...). In addition, it is
2370 essential that you make the {\bf Media Type} specification unique for each
2371 storage media type. If you have two DDS-4 drives that have incompatible
2372 formats, or if you have a DDS-4 drive and a DDS-4 autochanger, you almost
2373 certainly should specify different {\bf Media Types}. During a restore,
2374 assuming a {\bf DDS-4} Media Type is associated with the Job, Bacula can
2375 decide to use any Storage daemon that support Media Type {\bf DDS-4} and on
2376 any drive supports it. If you want to tie Bacula to using a single Storage
2377 daemon or drive, you must specify a unique Media Type for that drive. This is
2378 an important point that should be carefully understood. You can find more on
2380 \ilink{Basic Volume Management}{_ChapterStart39} chapter of this
2383 The {\bf MediaType} specified here, {\bf must} correspond to the {\bf Media
2384 Type} specified in the {\bf Device} resource of the {\bf Storage daemon}
2385 configuration file. This directive is required, and it is used by the
2386 Director and the Storage daemon to ensure that a Volume automatically
2387 selected from the Pool corresponds to the physical device. If a Storage
2388 daemon handles multiple devices (e.g. will write to various file Volumes on
2389 different partitions), this directive allows you to specify exactly which
2392 As mentioned above, the value specified in the Director's Storage resource
2393 must agree with the value specified in the Device resource in the {\bf
2394 Storage daemon's} configuration file. It is also an additional check so that
2395 you don't try to write data for a DLT onto an 8mm device.
2396 \label{Autochanger1}
2398 \item [Autochanger = \lt{}yes|no\gt{} ]
2399 \index[fd]{Autochanger }
2400 If you specify {\bf yes} for this command (the default is {\bf no}), when you
2401 use the {\bf label} command or the {\bf add} command to create a new Volume,
2402 {\bf Bacula} will also request the Autochanger Slot number. This simplifies
2403 creating database entries for Volumes in an autochanger. If you forget to
2404 specify the Slot, the autochanger will not be used. However, you may modify
2405 the Slot associated with a Volume at any time by using the {\bf update
2406 volume} command in the console program. When {\bf autochanger} is enabled,
2407 the algorithm used by Bacula to search for available volumes will be modified
2408 to consider only Volumes that are known to be in the autochanger's magazine.
2409 If no {\bf in changer} volume is found, Bacula will attempt recycling,
2410 pruning, ..., and if still no volume is found, Bacula will search for any
2411 volume whether or not in the magazine. By privileging in changer volumes,
2412 this procedure minimizes operator intervention. The default is {\bf no}.
2414 For the autochanger to be used, you must also specify {\bf Autochanger = yes}
2416 \ilink{Device Resource}{Autochanger} in the Storage daemon's
2417 configuration file as well as other important Storage daemon configuration
2418 information. Please consult the
2419 \ilink{ Using Autochangers}{_ChapterStart18} manual of this
2420 chapter for the details of using autochangers.
2422 \item [Maximum Concurrent Jobs = \lt{}number\gt{}]
2423 \index[fd]{Maximum Concurrent Jobs }
2424 where \lt{}number\gt{} is the maximum number of Jobs with the current Storage
2425 resource that can run concurrently. Note, this directive limits only Jobs
2426 for Jobs using this Storage daemon. Any other restrictions on the maximum
2427 concurrent jobs such as in the Director, Job, or Client resources will also
2428 apply in addition to any limit specified here. The default is set to 1, but
2429 you may set it to a larger number. We strongly recommend that you read the
2430 WARNING documented under
2431 \ilink{ Maximum Concurrent Jobs}{DirMaxConJobs} in the Director's
2434 While it is possible to set the Director's, Job's, or Client's maximum
2435 concurrent jobs greater than one, you should take great care in setting the
2436 Storage daemon's greater than one. By keeping this directive set to one, you
2437 will avoid having two jobs simultaneously write to the same Volume. Although
2438 this is supported, it is not currently recommended.
2441 The following is an example of a valid Storage resource definition:
2445 # Definition of tape storage device
2449 Password = storage_password # password for Storage daemon
2450 Device = "HP DLT 80" # same as Device in Storage daemon
2451 Media Type = DLT8000 # same as MediaType in Storage daemon
2456 \section*{The Pool Resource}
2457 \label{PoolResource}
2458 \index[general]{Resource!Pool }
2459 \index[general]{Pool Resource }
2460 \addcontentsline{toc}{section}{Pool Resource}
2462 The Pool resource defines the set of storage Volumes (tapes or files) to be
2463 used by Bacula to write the data. By configuring different Pools, you can
2464 determine which set of Volumes (media) receives the backup data. This permits,
2465 for example, to store all full backup data on one set of Volumes and all
2466 incremental backups on another set of Volumes. Alternatively, you could assign
2467 a different set of Volumes to each machine that you backup. This is most
2468 easily done by defining multiple Pools.
2470 Another important aspect of a Pool is that it contains the default attributes
2471 (Maximum Jobs, Retention Period, Recycle flag, ...) that will be given to a
2472 Volume when it is created. This avoids the need for you to answer a large
2473 number of questions when labeling a new Volume. Each of these attributes can
2474 later be changed on a Volume by Volume basis using the {\bf update} command in
2475 the console program. Note that you must explicitly specify which Pool Bacula
2476 is to use with each Job. Bacula will not automatically search for the correct
2479 Most often in Bacula installations all backups for all machines (Clients) go
2480 to a single set of Volumes. In this case, you will probably only use the {\bf
2481 Default} Pool. If your backup strategy calls for you to mount a different tape
2482 each day, you will probably want to define a separate Pool for each day. For
2483 more information on this subject, please see the
2484 \ilink{Backup Strategies}{_ChapterStart3} chapter of this
2487 To use a Pool, there are three distinct steps. First the Pool must be defined
2488 in the Director's configuration file. Then the Pool must be written to the
2489 Catalog database. This is done automatically by the Director each time that it
2490 starts, or alternatively can be done using the {\bf create} command in the
2491 console program. Finally, if you change the Pool definition in the Director's
2492 configuration file and restart Bacula, the pool will be updated alternatively
2493 you can use the {\bf update pool} console command to refresh the database
2494 image. It is this database image rather than the Director's resource image
2495 that is used for the default Volume attributes. Note, for the pool to be
2496 automatically created or updated, it must be explicitly referenced by a Job
2499 Next the physical media must be labeled. The labeling can either be done with
2500 the {\bf label} command in the {\bf console} program or using the {\bf btape}
2501 program. The preferred method is to use the {\bf label} command in the {\bf
2504 Finally, you must add Volume names (and their attributes) to the Pool. For
2505 Volumes to be used by Bacula they must be of the same {\bf Media Type} as the
2506 archive device specified for the job (i.e. if you are going to back up to a
2507 DLT device, the Pool must have DLT volumes defined since 8mm volumes cannot be
2508 mounted on a DLT drive). The {\bf Media Type} has particular importance if you
2509 are backing up to files. When running a Job, you must explicitly specify which
2510 Pool to use. Bacula will then automatically select the next Volume to use from
2511 the Pool, but it will ensure that the {\bf Media Type} of any Volume selected
2512 from the Pool is identical to that required by the Storage resource you have
2513 specified for the Job.
2515 If you use the {\bf label} command in the console program to label the
2516 Volumes, they will automatically be added to the Pool, so this last step is
2517 not normally required.
2519 It is also possible to add Volumes to the database without explicitly labeling
2520 the physical volume. This is done with the {\bf add} console command.
2522 As previously mentioned, each time Bacula starts, it scans all the Pools
2523 associated with each Catalog, and if the database record does not already
2524 exist, it will be created from the Pool Resource definition. {\bf Bacula}
2525 probably should do an {\bf update pool} if you change the Pool definition, but
2526 currently, you must do this manually using the {\bf update pool} command in
2527 the Console program.
2529 The Pool Resource defined in the Director's configuration file
2530 (bacula-dir.conf) may contain the following directives:
2536 Start of the Pool resource. There must be at least one Pool resource defined.
2539 \item [Name = \lt{}name\gt{}]
2541 The name of the pool. For most applications, you will use the default pool
2542 name {\bf Default}. This directive is required.
2544 \item [Number of Volumes = \lt{}number\gt{}]
2545 \index[dir]{Number of Volumes }
2546 This directive specifies the number of volumes (tapes or files) contained in
2547 the pool. Normally, it is defined and updated automatically by the Bacula
2548 catalog handling routines.
2551 \item [Maximum Volumes = \lt{}number\gt{}]
2552 \index[dir]{Maximum Volumes }
2553 This directive specifies the maximum number of volumes (tapes or files)
2554 contained in the pool. This directive is optional, if omitted or set to zero,
2555 any number of volumes will be permitted. In general, this directive is useful
2556 for Autochangers where there is a fixed number of Volumes, or for File
2557 storage where you wish to ensure that the backups made to disk files do not
2558 become too numerous or consume too much space.
2560 \item [Pool Type = \lt{}type\gt{}]
2561 \index[dir]{Pool Type }
2562 This directive defines the pool type, which corresponds to the type of Job
2563 being run. It is required and may be one of the following:
2574 \item [Use Volume Once = \lt{}yes|no\gt{}]
2575 \index[dir]{Use Volume Once }
2576 This directive if set to {\bf yes} specifies that each volume is to be used
2577 only once. This is most useful when the Media is a file and you want a new
2578 file for each backup that is done. The default is {\bf no} (i.e. use volume
2579 any number of times). This directive will most likely be phased out
2580 (deprecated), so you are recommended to use {\bf Maximum Volume Jobs = 1}
2583 Please note that the value defined by this directive in the bacula-dir.conf
2584 file is the default value used when a Volume is created. Once the volume is
2585 created, changing the value in the bacula-dir.conf file will not change what
2586 is stored for the Volume. To change the value for an existing Volume you
2587 must use the {\bf update} command in the Console.
2589 \item [Maximum Volume Jobs = \lt{}positive-integer\gt{}]
2590 \index[fd]{Maximum Volume Jobs }
2591 This directive specifies the maximum number of Jobs that can be written to
2592 the Volume. If you specify zero (the default), there is no limit. Otherwise,
2593 when the number of Jobs backed up to the Volume equals {\bf positive-integer}
2594 the Volume will be marked {\bf Used}. When the Volume is marked {\bf Used} it
2595 can no longer be used for appending Jobs, much like the {\bf Full} status but
2596 it can be recycled if recycling is enabled. By setting {\bf
2597 MaximumVolumeJobs} to one, you get the same effect as setting {\bf
2598 UseVolumeOnce = yes}.
2600 Please note that the value defined by this directive in the bacula-dir.conf
2601 file is the default value used when a Volume is created. Once the volume is
2602 created, changing the value in the bacula-dir.conf file will not change what
2603 is stored for the Volume. To change the value for an existing Volume you
2604 must use the {\bf update} command in the Console.
2606 \item [Maximum Volume Files = \lt{}positive-integer\gt{}]
2607 \index[fd]{Maximum Volume Files }
2608 This directive specifies the maximum number of files that can be written to
2609 the Volume. If you specify zero (the default), there is no limit. Otherwise,
2610 when the number of files written to the Volume equals {\bf positive-integer}
2611 the Volume will be marked {\bf Used}. When the Volume is marked {\bf Used} it
2612 can no longer be used for appending Jobs, much like the {\bf Full} status but
2613 it can be recycled if recycling is enabled. This value is checked and the
2614 {\bf Used} status is set only at the end of a job that writes to the
2617 Please note that the value defined by this directive in the bacula-dir.conf
2618 file is the default value used when a Volume is created. Once the volume is
2619 created, changing the value in the bacula-dir.conf file will not change what
2620 is stored for the Volume. To change the value for an existing Volume you
2621 must use the {\bf update} command in the Console.
2623 \item [Maximum Volume Bytes = \lt{}size\gt{}]
2624 \index[fd]{Maximum Volume Bytes }
2625 This directive specifies the maximum number of bytes that can be written to
2626 the Volume. If you specify zero (the default), there is no limit except the
2627 physical size of the Volume. Otherwise, when the number of bytes written to
2628 the Volume equals {\bf size} the Volume will be marked {\bf Used}. When the
2629 Volume is marked {\bf Used} it can no longer be used for appending Jobs, much
2630 like the {\bf Full} status but it can be recycled if recycling is enabled.
2631 This value is checked and the {\bf Used} status set while the job is writing
2632 to the particular volume.
2634 Please note that the value defined by this directive in the bacula-dir.conf
2635 file is the default value used when a Volume is created. Once the volume is
2636 created, changing the value in the bacula-dir.conf file will not change what
2637 is stored for the Volume. To change the value for an existing Volume you
2638 must use the {\bf update} command in the Console.
2640 \item [Volume Use Duration = \lt{}time-period-specification\gt{}]
2641 \index[fd]{Volume Use Duration }
2642 The Volume Use Duration directive defines the time period that the Volume can
2643 be written beginning from the time of first data write to the Volume. If the
2644 time-period specified is zero (the default), the Volume can be written
2645 indefinitely. Otherwise, when the time period from the first write to the
2646 volume (the first Job written) exceeds the time-period-specification, the
2647 Volume will be marked {\bf Used}, which means that no more Jobs can be
2648 appended to the Volume, but it may be recycled if recycling is enabled.
2650 You might use this directive, for example, if you have a Volume used for
2651 Incremental backups, and Volumes used for Weekly Full backups. Once the Full
2652 backup is done, you will want to use a different Incremental Volume. This can
2653 be accomplished by setting the Volume Use Duration for the Incremental Volume
2654 to six days. I.e. it will be used for the 6 days following a Full save, then
2655 a different Incremental volume will be used.
2657 This value is checked and the {\bf Used} status is set only at the end of a
2658 job that writes to the particular volume, which means that even though the
2659 use duration may have expired, the catalog entry will not be updated until
2660 the next job that uses this volume is run.
2662 Please note that the value defined by this directive in the bacula-dir.conf
2663 file is the default value used when a Volume is created. Once the volume is
2664 created, changing the value in the bacula-dir.conf file will not change what
2665 is stored for the Volume. To change the value for an existing Volume you
2666 must use the {\bf update} command in the Console.
2668 \item [Catalog Files = \lt{}yes|no\gt{}]
2669 \index[fd]{Catalog Files }
2670 This directive defines whether or not you want the names of the files that
2671 were saved to be put into the catalog. The default is {\bf yes}. The
2672 advantage of specifying {\bf Catalog Files = No} is that you will have a
2673 significantly smaller Catalog database. The disadvantage is that you will not
2674 be able to produce a Catalog listing of the files backed up for each Job
2675 (this is often called Browsing). Also, without the File entries in the
2676 catalog, you will not be able to use the Console {\bf restore} command nor
2677 any other command that references File entries.
2678 \label{PoolAutoPrune}
2680 \item [AutoPrune = \lt{}yes|no\gt{}]
2681 \index[fd]{AutoPrune }
2682 If AutoPrune is set to {\bf yes} (default), Bacula (version 1.20 or greater)
2683 will automatically apply the Volume Retention period when new Volume is
2684 needed and no appendable Volumes exist in the Pool. Volume pruning causes
2685 expired Jobs (older than the {\bf Volume Retention} period) to be deleted
2686 from the Catalog and permits possible recycling of the Volume.
2687 \label{VolRetention}
2689 \item [Volume Retention = \lt{}time-period-specification\gt{}]
2690 \index[fd]{Volume Retention }
2691 The Volume Retention directive defines the length of time that {\bf Bacula}
2692 will keep Job records associated with the Volume in the Catalog database.
2693 When this time period expires, and if {\bf AutoPrune} is set to {\bf yes}
2694 Bacula will prune (remove) Job records that are older than the specified
2695 Volume Retention period. All File records associated with pruned Jobs are
2696 also pruned. The time may be specified as seconds, minutes, hours, days,
2697 weeks, months, quarters, or years. The {\bf Volume Retention} applied
2698 independently to the {\bf Job Retention} and the {\bf File Retention} periods
2699 defined in the Client resource. This means that the shorter period is the
2700 one that applies. Note, that when the {\bf Volume Retention} period has been
2701 reached, it will prune both the Job and the File records.
2703 The default is 365 days. Note, this directive sets the default value for each
2704 Volume entry in the Catalog when the Volume is created. The value in the
2705 catalog may be later individually changed for each Volume using the Console
2708 By defining multiple Pools with different Volume Retention periods, you may
2709 effectively have a set of tapes that is recycled weekly, another Pool of
2710 tapes that is recycled monthly and so on. However, one must keep in mind that
2711 if your {\bf Volume Retention} period is too short, it may prune the last
2712 valid Full backup, and hence until the next Full backup is done, you will not
2713 have a complete backup of your system, and in addition, the next Incremental
2714 or Differential backup will be promoted to a Full backup. As a consequence,
2715 the minimum {\bf Volume Retention} period should be at twice the interval of
2716 your Full backups. This means that if you do a Full backup once a month, the
2717 minimum Volume retention period should be two months.
2719 Please note that the value defined by this directive in the bacula-dir.conf
2720 file is the default value used when a Volume is created. Once the volume is
2721 created, changing the value in the bacula-dir.conf file will not change what
2722 is stored for the Volume. To change the value for an existing Volume you
2723 must use the {\bf update} command in the Console.
2726 \item [Recycle = \lt{}yes|no\gt{}]
2727 \index[fd]{Recycle }
2728 This directive specifies the default for recycling Purged Volumes. If it is
2729 set to {\bf yes} and Bacula needs a volume but finds none that are
2730 appendable, it will search for Purged Volumes (i.e. volumes with all the Jobs
2731 and Files expired and thus deleted from the Catalog). If the Volume is
2732 recycled, all previous data written to that Volume will be overwritten.
2734 Please note that the value defined by this directive in the bacula-dir.conf
2735 file is the default value used when a Volume is created. Once the volume is
2736 created, changing the value in the bacula-dir.conf file will not change what
2737 is stored for the Volume. To change the value for an existing Volume you
2738 must use the {\bf update} command in the Console.
2739 \label{RecycleOldest}
2741 \item [Recycle Oldest Volume = \lt{}yes|no\gt{}]
2742 \index[fd]{Recycle Oldest Volume }
2743 This directive instructs the Director to search for the oldest used Volume
2744 in the Pool when another Volume is requested by the Storage daemon and none
2745 are available. The catalog is then {\bf pruned} respecting the retention
2746 periods of all Files and Jobs written to this Volume. If all Jobs are pruned
2747 (i.e. the volume is Purged), then the Volume is recycled and will be used as
2748 the next Volume to be written. This directive respects any Job, File, or
2749 Volume retention periods that you may have specified, and as such it is {\bf
2750 much} better to use this directive than the Purge Oldest Volume.
2752 This directive can be useful if you have a fixed number of Volumes in the
2753 Pool and you want to cycle through them and you have specified the correct
2755 \label{RecycleCurrent}
2757 \item [Recycle Current Volume = \lt{}yes|no\gt{}]
2758 \index[fd]{Recycle Current Volume }
2759 If Bacula needs a new Volume, this directive instructs Bacula to Prune the
2760 volume respecting the Job and File retention periods. If all Jobs are pruned
2761 (i.e. the volume is Purged), then the Volume is recycled and will be used as
2762 the next Volume to be written. This directive respects any Job, File, or
2763 Volume retention periods that you may have specified, and thus it is {\bf
2764 much} better to use it rather than the Purge Oldest Volume directive.
2766 This directive can be useful if you have: a fixed number of Volumes in the
2767 Pool, you want to cycle through them, and you have specified retention
2768 periods that prune Volumes before you have cycled through the Volume in the
2772 \item [Purge Oldest Volume = \lt{}yes|no\gt{}]
2773 \index[fd]{Purge Oldest Volume }
2774 This directive instructs the Director to search for the oldest used Volume
2775 in the Pool when another Volume is requested by the Storage daemon and none
2776 are available. The catalog is then {\bf purged} irrespective of retention
2777 periods of all Files and Jobs written to this Volume. The Volume is then
2778 recycled and will be used as the next Volume to be written. This directive
2779 overrides any Job, File, or Volume retention periods that you may have
2782 This directive can be useful if you have a fixed number of Volumes in the
2783 Pool and you want to cycle through them and when all Volumes are full, but
2784 you don't want to worry about setting proper retention periods. However, by
2785 using this option you risk losing valuable data.
2787 {\bf Please be aware that {\bf Purge Oldest Volume} disregards all retention
2788 periods.} If you have only a single Volume defined and you turn this variable
2789 on, that Volume will always be immediately overwritten when it fills! So at a
2790 minimum, ensure that you have a decent number of Volumes in your Pool before
2791 running any jobs. If you want retention periods to apply do not use this
2792 directive. To specify a retention period, use the {\bf Volume Retention}
2793 directive (see above).
2795 I highly recommend against using this directive, because it is sure that some
2796 day, Bacula will recycle a Volume that contains current data.
2798 \item [Accept Any Volume = \lt{}yes|no\gt{}]
2799 \index[fd]{Accept Any Volume }
2800 This directive specifies whether or not any volume from the Pool may be used
2801 for backup. The default is {\bf yes} as of version 1.27 and later. If it is
2802 {\bf no} then only the first writable volume in the Pool will be accepted for
2803 writing backup data, thus Bacula will fill each Volume sequentially in turn
2804 before using any other appendable volume in the Pool. If this is {\bf no} and
2805 you mount a volume out of order, Bacula will not accept it. If this is {\bf
2806 yes} any appendable volume from the pool mounted will be accepted.
2808 If your tape backup procedure dictates that you manually mount the next
2809 volume, you will almost certainly want to be sure this directive is turned
2812 If you are going on vacation and you think the current volume may not have
2813 enough room on it, you can simply label a new tape and leave it in the drive,
2814 and assuming that {\bf Accept Any Volume} is {\bf yes} Bacula will begin
2815 writing on it. When you return from vacation, simply remount the last tape,
2816 and Bacula will continue writing on it until it is full. Then you can remount
2817 your vacation tape and Bacula will fill it in turn.
2819 \item [Cleaning Prefix = \lt{}string\gt{}]
2820 \index[fd]{Cleaning Prefix }
2821 This directive defines a prefix string, which if it matches the beginning of
2822 a Volume name during labeling of a Volume, the Volume will be defined with
2823 the VolStatus set to {\bf Cleaning} and thus Bacula will never attempt to use
2824 this tape. This is primarily for use with autochangers that accept barcodes
2825 where the convention is that barcodes beginning with {\bf CLN} are treated as
2829 \item [Label Format = \lt{}format\gt{}]
2830 \index[fd]{Label Format }
2831 This directive specifies the format of the labels contained in this pool. The
2832 format directive is used as a sort of template to create new Volume names
2833 during automatic Volume labeling.
2835 The {\bf format} should be specified in double quotes, and consists of
2836 letters, numbers and the special characters hyphen ({\bf -}), underscore
2837 ({\bf \_}), colon ({\bf :}), and period ({\bf .}), which are the legal
2838 characters for a Volume name. The {\bf format} should be enclosed in double
2841 In addition, the format may contain a number of variable expansion characters
2842 which will be expanded by a complex algorithm allowing you to create Volume
2843 names of many different formats. In all cases, the expansion process must
2844 resolve to the set of characters noted above that are legal Volume names.
2845 Generally, these variable expansion characters begin with a dollar sign ({\bf
2846 \$}) or a left bracket ({\bf [}). If you specify variable expansion
2847 characters, you should always enclose the format with double quote characters
2848 ({\bf ``}). For more details on variable expansion, please see the
2849 \ilink{Variable Expansion}{_ChapterStart50} Chapter of this manual.
2851 If no variable expansion characters are found in the string, the Volume name
2852 will be formed from the {\bf format} string appended with the number of
2853 volumes in the pool plus one, which will be edited as four digits with
2854 leading zeros. For example, with a {\bf Label Format = ''File-``}, the first
2855 volumes will be named {\bf File-0001}, {\bf File-0002}, ...
2857 With the exception of Job specific variables, you can test your {\bf
2858 LabelFormat} by using the
2859 \ilink{ var command}{var} the Console Chapter of this manual.
2861 In almost all cases, you should enclose the format specification (part after
2862 the equal sign) in double quotes.
2865 In order for a Pool to be used during a Backup Job, the Pool must have at
2866 least one Volume associated with it. Volumes are created for a Pool using the
2867 {\bf label} or the {\bf add} commands in the {\bf Bacula Console}, program. In
2868 addition to adding Volumes to the Pool (i.e. putting the Volume names in the
2869 Catalog database), the physical Volume must be labeled with valid Bacula
2870 software volume label before {\bf Bacula} will accept the Volume. This will be
2871 automatically done if you use the {\bf label} command. Bacula can
2872 automatically label Volumes if instructed to do so, but this feature is not
2873 yet fully implemented.
2875 The following is an example of a valid Pool resource definition:
2887 \section*{The Catalog Resource}
2888 \label{CatalogResource}
2889 \index[general]{Resource!Catalog }
2890 \index[general]{Catalog Resource }
2891 \addcontentsline{toc}{section}{Catalog Resource}
2893 The Catalog Resource defines what catalog to use for the current job.
2894 Currently, Bacula can only handle a single database server (SQLite, MySQL,
2895 built-in) that is defined when configuring {\bf Bacula}. However, there may be
2896 as many Catalogs (databases) defined as you wish. For example, you may want
2897 each Client to have its own Catalog database, or you may want backup jobs to
2898 use one database and verify or restore jobs to use another database.
2903 \index[console]{Catalog }
2904 Start of the Catalog resource. At least one Catalog resource must be defined.
2907 \item [Name = \lt{}name\gt{}]
2908 \index[console]{Name }
2909 The name of the Catalog. No necessary relation to the database server name.
2910 This name will be specified in the Client resource directive indicating that
2911 all catalog data for that Client is maintained in this Catalog. This
2912 directive is required.
2914 \item [password = \lt{}password\gt{}]
2915 \index[console]{password }
2916 This specifies the password to use when logging into the database. This
2917 directive is required.
2919 \item [DB Name = \lt{}name\gt{}]
2920 \index[console]{DB Name }
2921 This specifies the name of the database. If you use multiple catalogs
2922 (databases), you specify which one here. If you are using an external
2923 database server rather than the internal one, you must specify a name that
2924 is known to the server (i.e. you explicitly created the Bacula tables using
2925 this name. This directive is required.
2927 \item [user = \lt{}user\gt{}]
2928 \index[console]{user }
2929 This specifies what user name to use to log into the database. This directive
2932 \item [DB Socket = \lt{}socket-name\gt{}]
2933 \index[console]{DB Socket }
2934 This is the name of a socket to use on the local host to connect to the
2935 database. This directive is used only by MySQL and is ignored by SQLite.
2936 Normally, if neither {\bf DB Socket} or {\bf DB Address} are specified, MySQL
2937 will use the default socket.
2939 \item [DB Address = \lt{}address\gt{}]
2940 \index[console]{DB Address }
2941 This is the host address of the database server. Normally, you would specify
2942 this instead of {\bf DB Socket} if the database server is on another machine.
2943 In that case, you will also specify {\bf DB Port}. This directive is used
2944 only by MySQL and is ignored by SQLite if provided. This directive is
2947 \item [DB Port = \lt{}port\gt{}]
2948 \index[console]{DB Port }
2949 This defines the port to be used in conjunction with {\bf DB Address} to
2950 access the database if it is on another machine. This directive is used only
2951 by MySQL and is ignored by SQLite if provided. This directive is optional.
2953 \item [Multiple Connections = \lt{}yes|no\gt{}]
2954 \index[console]{Multiple Connections }
2955 By default, this directive is set to no. In that case, each job that uses the
2956 same Catalog will use a single connection to the catalog. It will be shared,
2957 and Bacula will allow only one Job at a time to communicate. If you set this
2958 directive to yes, Bacula will permit multiple connections to the database,
2959 and the database must be multi-thread capable. For SQLite and PostgreSQL,
2960 this is no problem. For MySQL, you must be *very* careful to have the
2961 multi-thread version of the client library loaded on your system. When this
2962 directive is set yes, each Job will have a separate connection to the
2963 database, and the database will control the interaction between the different
2964 Jobs. This can significantly speed up the database operations if you are
2965 running multiple simultaneous jobs. In addition, for SQLite and PostgreSQL,
2966 Bacula will automatically enable transactions. This can significantly speed
2967 up insertion of attributes in the database either for a single Job or
2968 multiple simultaneous Jobs.
2970 This directive has not been tested. Please test carefully before running it
2971 in production and report back your results.
2974 The following is an example of a valid Catalog resource definition:
2983 password = "" # no password = no security
2988 or for a Catalog on another machine:
2998 DB Address = remote.acme.com
3004 \section*{The Messages Resource}
3005 \label{MessagesResource2}
3006 \index[general]{Resource!Messages }
3007 \index[general]{Messages Resource }
3008 \addcontentsline{toc}{section}{Messages Resource}
3010 For the details of the Messages Resource, please see the
3011 \ilink{Messages Resource Chapter}{_ChapterStart15} of this
3014 \section*{The Console Resource}
3015 \label{ConsoleResource1}
3016 \index[general]{Console Resource }
3017 \index[general]{Resource!Console }
3018 \addcontentsline{toc}{section}{Console Resource}
3020 As of Bacula version 1.33 and higher, there are three different kinds of
3021 consoles, which the administrator or user can use to interact with the
3022 Director. These three kinds of consoles comprise three different security
3026 \item The first console type is an {\bf anonymous} or {\bf default} console,
3027 which has full privileges. There is no console resource necessary for this
3028 type since the password is specified in the Director's resource and
3029 consequently such consoles do not have an name as defined on a {\bf Name =}
3030 directive. This is the kind of console that was initially implemented in
3031 versions prior to 1.33 and remains valid. Typically you would use it only for
3033 \item The second type of console, and new to version 1.33 and higher is a
3034 ''named`` console defined within a Console resource in both the Director's
3035 configuration file and in the Console's configuration file. Both the names
3036 and the passwords in these two entries must match much as is the case for
3039 This second type of console begins with absolutely no privileges except those
3040 explicitly specified in the Director's Console resource. Thus you can have
3041 multiple Consoles with different names and passwords, sort of like multiple
3042 users, each with different privileges. As a default, these consoles can do
3043 absolutely nothing -- no commands what so ever. You give them privileges or
3044 rather access to commands and resources by specifying access control lists
3045 in the Director's Console resource. The ACLs are specified by a directive
3046 followed by a list of access names. Examples of this are shown below.
3047 \item The third type of console is similar to the above mentioned one in that
3048 it requires a Console resource definition in both the Director and the
3049 Console. In addition, if the console name, provided on the {\bf Name =}
3050 directive, is the same as a Client name, that console is permitted to use the
3051 {\bf SetIP} command to change the Address directive in the Director's client
3052 resource to the IP address of the Console. This permits portables or other
3053 machines using DHCP (non-fixed IP addresses) to ''notify`` the Director of
3054 their current IP address.
3057 The Console resource is optional and need not be specified. The following
3058 directives are permited within the Director's configuration resource:
3062 \item [Name = \lt{}name\gt{}]
3063 \index[console]{Name }
3064 The name of the console. This name must match the name specified in the
3065 Console's configuration resource (much as is the case with Client
3068 \item [Password = \lt{}password\gt{}]
3069 \index[console]{Password }
3070 Specifies the password that must be supplied for a named Bacula Console to be
3071 authorized. The same password must appear in the {\bf Console} resource of
3072 the Console configuration file. For added security, the password is never
3073 actually passed across the network but rather a challenge response hash code
3074 created with the password. This directive is required. If you have either
3075 {\bf /dev/random} {\bf bc} on your machine, Bacula will generate a random
3076 password during the configuration process, otherwise it will be left blank.
3078 \item [JobACL = \lt{}name-list\gt{}]
3079 \index[console]{JobACL }
3080 This directive is used to specify a list of Job resource names that can be
3081 accessed by the console. Without this directive, the console cannot access
3082 any of the Director's Job resources. Multiple Job resource names may be
3083 specified by separating them with commas, and/or by specifying multiple
3084 JobACL directives. For example, the directive may be specified as:
3088 JobACL = kernsave, "Backup client 1", "Backup client 2"
3089 JobACL = "RestoreFiles"
3094 With the above specification, the console can access the Director's resources
3095 for the four jobs named on the JobACL directives, but for no others.
3097 \item [ClientACL = \lt{}name-list\gt{}]
3098 \index[console]{ClientACL }
3099 This directive is used to specify a list of Client resource names that can be
3100 accessed by the console.
3102 \item [StorageACL = \lt{}name-list\gt{}]
3103 \index[console]{StorageACL }
3104 This directive is used to specify a list of Storage resource names that can
3105 be accessed by the console.
3107 \item [ScheduleACL = \lt{}name-list\gt{}]
3108 \index[console]{ScheduleACL }
3109 This directive is used to specify a list of Schedule resource names that can
3110 be accessed by the console.
3112 \item [PoolACL = \lt{}name-list\gt{}]
3113 \index[console]{PoolACL }
3114 This directive is used to specify a list of Pool resource names that can be
3115 accessed by the console.
3117 \item [FileSetACL = \lt{}name-list\gt{}]
3118 \index[console]{FileSetACL }
3119 This directive is used to specify a list of FileSet resource names that can
3120 be accessed by the console.
3122 \item [CatalogACL = \lt{}name-list\gt{}]
3123 \index[console]{CatalogACL }
3124 This directive is used to specify a list of Catalog resource names that can
3125 be accessed by the console.
3127 \item [CommandACL = \lt{}name-list\gt{}]
3128 \index[console]{CommandACL }
3129 This directive is used to specify a list of of console commands that can be
3130 executed by the console.
3133 Aside from Director resource names and console command names, the special
3134 keyword {\bf *all*} can be specified in any of the above access control lists.
3135 When this keyword is present, any resource or command name (which ever is
3136 appropriate) will be accepted. For an example configuration file, please see
3138 \ilink{Console Configuration}{_ChapterStart36} chapter of this
3141 \section*{The Counter Resource}
3142 \label{CounterResource}
3143 \index[general]{Resource!Counter }
3144 \index[general]{Counter Resource }
3145 \addcontentsline{toc}{section}{Counter Resource}
3147 The Counter Resource defines a counter variable that can be accessed by
3148 variable expansion used for creating Volume labels with the {\bf LabelFormat}
3150 \ilink{LabelFormat}{Label} directive in this chapter for more
3156 \index[console]{Counter }
3157 Start of the Counter resource. Counter directives are optional.
3159 \item [Name = \lt{}name\gt{}]
3160 \index[console]{Name }
3161 The name of the Counter. This is the name you will use in the variable
3162 expansion to reference the counter value.
3164 \item [Minimum = \lt{}integer\gt{}]
3165 \index[console]{Minimum }
3166 This specifies the minimum value that the counter can have. It also becomes
3167 the default. If not supplied, zero is assumed.
3169 \item [Maximum = \lt{}integer\gt{}]
3170 \index[console]{Maximum }
3171 This is the maximum value value that the counter can have. If not specified
3172 or set to zero, the counter can have a maximum value of 2,147,483,648 (2 to
3173 the 31 power). When the counter is incremented past this value, it is reset
3176 \item [*WrapCounter = \lt{}counter-name\gt{}]
3177 \index[console]{*WrapCounter }
3178 If this value is specified, when the counter is incremented past the maximum
3179 and thus reset to the minimum, the counter specified on the {\bf WrapCounter}
3180 is incremented. (This is not currently implemented).
3182 \item [Catalog = \lt{}catalog-name\gt{}]
3183 \index[console]{Catalog }
3184 If this directive is specified, the counter and its values will be saved in
3185 the specified catalog. If this directive is not present, the counter will be
3186 redefined each time that Bacula is started.
3189 \section*{ A Complete Example Director Configuration File}
3190 \label{SampleDirectorConfiguration}
3191 \index[general]{File!Complete Example Director Configuration }
3192 \index[general]{Complete Example Director Configuration File }
3193 \addcontentsline{toc}{section}{Complete Example Director Configuration File}
3195 An example Director configuration file might be the following:
3200 # Default Bacula Director Configuration file
3202 # The only thing that MUST be changed is to add one or more
3203 # file or directory names in the Include directive of the
3206 # For Bacula release 1.15 (5 March 2002) -- redhat
3208 # You might also want to change the default email address
3209 # from root to your address. See the "mail" and "operator"
3210 # directives in the Messages resource.
3212 Director { # define myself
3214 QueryFile = "/home/kern/bacula/bin/query.sql"
3215 WorkingDirectory = "/home/kern/bacula/bin/working"
3216 PidDirectory = "/home/kern/bacula/bin/working"
3217 Password = "XkSfzu/Cf/wX4L8Zh4G4/yhCbpLcz3YVdmVoQvU3EyF/"
3219 # Define the backup Job
3221 Name = "NightlySave"
3223 Level = Incremental # default
3226 Schedule = "WeeklyCycle"
3236 Where = /tmp/bacula-restores
3242 # List of files to be backed up
3246 Options { signature=SHA1 }
3248 # Put your list of files here, one per line or include an
3249 # external list with:
3253 # Note: / backs up everything
3258 # When to do the backups
3260 Name = "WeeklyCycle"
3261 Run = Full sun at 1:05
3262 Run = Incremental mon-sat at 1:05
3264 # Client (File Services) to backup
3269 Password = "MQk6lVinz4GG2hdIZk1dsKE/LxMZGo6znMHiD7t7vzF+"
3270 File Retention = 60d # sixty day file retention
3271 Job Retention = 1y # 1 year Job retention
3272 AutoPrune = yes # Auto apply retention periods
3274 # Definition of DLT tape storage device
3278 Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
3279 Device = "HP DLT 80" # same as Device in Storage daemon
3280 Media Type = DLT8000 # same as MediaType in Storage daemon
3282 # Definition of DDS tape storage device
3286 Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
3287 Device = SDT-10000 # same as Device in Storage daemon
3288 Media Type = DDS-4 # same as MediaType in Storage daemon
3290 # Definition of 8mm tape storage device
3294 Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
3295 Device = "Exabyte 8mm"
3298 # Definition of file storage device
3302 Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
3303 Device = FileStorage
3306 # Generic catalog service
3309 dbname = bacula; user = bacula; password = ""
3311 # Reasonable message delivery -- send most everything to
3312 # the email address and to the console
3315 mail = root@localhost = all, !skipped, !terminate
3316 operator = root@localhost = mount
3317 console = all, !skipped, !saved
3320 # Default pool definition
3328 # Restricted console used by tray-monitor to get the status of the director
3332 Password = "GN0uRo7PTUmlMbqrJ2Gr1p0fk0HQJTxwnFyE4WSST3MWZseR"
3333 CommandACL = status, .status