]> git.sur5r.net Git - bacula/docs/blob - docs/manual-de/dirdconf.tex
- Create French and Italian translation files (fr.po, it.po).
[bacula/docs] / docs / manual-de / dirdconf.tex
1 %%
2 %%
3
4 \section*{Configuring the Director}
5 \label{_ChapterStart40}
6 \index[general]{Director!Configuring the }
7 \index[general]{Configuring the Director }
8 \addcontentsline{toc}{section}{Configuring the Director}
9
10 Of all the configuration files needed to run {\bf Bacula}, the Director's is
11 the most complicated, and the one that you will need to modify the most often
12 as you add clients or modify the FileSets. 
13
14 For a general discussion of configuration file and resources including the
15 data types recognized by {\bf Bacula}. Please see the 
16 \ilink{Configuration}{_ChapterStart16} chapter of this manual. 
17
18 \subsection*{Director Resource Types}
19 \index[general]{Types!Director Resource }
20 \index[general]{Director Resource Types }
21 \addcontentsline{toc}{subsection}{Director Resource Types}
22
23 Director resource type may be one of the following: 
24
25 Job, JobDefs, Client, Storage, Catalog, Schedule, FileSet, Pool, Director,  or
26 Messages. We present them here in the most logical order for defining them: 
27
28 \begin{itemize}
29 \item 
30    \ilink{Director}{DirectorResource4} -- to  define the Director's
31    name and its access password used for  authenticating the Console program.
32 Only a single  Director resource definition may appear in the Director's 
33 configuration file.  If you have either {\bf /dev/random} or  {\bf bc} on your
34 machine, Bacula will generate a random  password during the configuration
35 process, otherwise it will  be left blank. 
36 \item 
37    \ilink{Job}{JobResource} -- to define the backup/restore Jobs 
38    and to tie together the Client, FileSet and Schedule resources to  be used for
39 each Job.  
40 \item 
41    \ilink{JobDefs}{JobDefsResource} -- optional resource for 
42    providing defaults for Job resources.  
43 \item 
44    \ilink{Schedule}{ScheduleResource} -- to define when a Job is to 
45    be automatically run by {\bf Bacula's} internal scheduler.  
46 \item 
47    \ilink{FileSet}{FileSetResource} -- to define the set of files 
48    to be backed up for each Client. 
49 \item 
50    \ilink{Client}{ClientResource2} -- to define what Client is  to be
51    backed up.  
52 \item 
53    \ilink{Storage}{StorageResource2} -- to define on what  physical
54    device the Volumes should be mounted. 
55 \item 
56    \ilink{Pool}{PoolResource} -- to define the pool of Volumes
57    that can be used for a particular Job. 
58 \item 
59    \ilink{Catalog}{CatalogResource} -- to define in what database to
60  keep the list of files and the Volume names where they are backed up.  
61 \item 
62    \ilink{Messages}{_ChapterStart15} -- to define where error  and
63    information messages are to be sent or logged. 
64 \end{itemize}
65
66 \subsection*{The Director Resource}
67 \label{DirectorResource4}
68 \index[general]{Director Resource }
69 \index[general]{Resource!Director }
70 \addcontentsline{toc}{subsection}{Director Resource}
71
72 The Director resource defines the attributes of the Directors running on the
73 network. In the current implementation, there is only a single Director
74 resource, but the final design will contain multiple Directors to maintain
75 index and media database redundancy. 
76
77 \begin{description}
78
79 \item [Director]
80    \index[dir]{Director }
81    Start of the Director resource. One and only one  director resource must be
82 supplied.  
83
84 \item [Name = \lt{}name\gt{}]
85    \index[dir]{Name  }
86    The director name used by the system  administrator. This directive is
87 required.  
88
89 \item [Description = \lt{}text\gt{}]
90    \index[dir]{Description  }
91    The text field contains a  description of the Director that will be displayed
92 in the  graphical user interface. This directive is optional.  
93
94 \item [Password = \lt{}UA-password\gt{}]
95    \index[dir]{Password  }
96    Specifies the password that  must be supplied for the default Bacula Console
97 to be  authorized. The same password must appear in the  {\bf Director}
98 resource of the Console configuration file.  For added security, the password
99 is never actually passed  across the network but rather a challenge response
100 hash code  created with the password. This directive is required. If you  have
101 either {\bf /dev/random} {\bf bc} on your machine,  Bacula will generate a
102 random password during the  configuration process, otherwise it will be left
103 blank and  you must manually supply it.  
104
105 \item [Messages = \lt{}Messages-resource-name\gt{}]
106    \index[dir]{Messages  }
107    The messages resource  specifies where to deliver Director messages that are
108 not associated  with a specific Job. Most messages are specific to a job and
109 will  be directed to the Messages resource specified by the job. However, 
110 there are a few messages that can occur when no job is running.  This
111 directive is required.  
112
113 \item [Working Directory = \lt{}Directory\gt{}]
114    \index[dir]{Working Directory  }
115    This directive  is mandatory and specifies a directory in which the Director 
116 may put its status files. This directory should be used only  by Bacula but
117 may be shared by other Bacula daemons.  Standard shell expansion of the {\bf
118 Directory}  is done when the configuration file is read so that values such 
119 as {\bf \$HOME} will be properly expanded. This directive is required.  
120
121 \item [Pid Directory = \lt{}Directory\gt{}]
122    \index[dir]{Pid Directory  }
123    This directive  is mandatory and specifies a directory in which the Director 
124 may put its process Id file files. The process Id file is used to  shutdown
125 Bacula and to prevent multiple copies of  Bacula from running simultaneously. 
126 Standard shell expansion of the {\bf Directory}  is done when the
127 configuration file is read so that values such  as {\bf \$HOME} will be
128 properly expanded.  
129
130 Typically on Linux systems, you will set this to:  {\bf /var/run}. If you are
131 not installing Bacula in the  system directories, you can use the {\bf Working
132 Directory} as  defined above.  This directive is required.  
133
134 \item [QueryFile = \lt{}Path\gt{}]
135    \index[dir]{QueryFile  }
136    This directive  is mandatory and specifies a directory and file in which the
137 Director  can find the canned SQL statements for the {\bf Query} command of 
138 the Console. Standard shell expansion of the {\bf Path} is done  when the
139 configuration file is read so that values such as  {\bf \$HOME} will be
140 properly expanded. This directive is required.  
141 \label{DirMaxConJobs}
142
143 \item [Maximum Concurrent Jobs = \lt{}number\gt{}]
144    \index[dir]{Maximum Concurrent Jobs  }
145    where \lt{}number\gt{}  is the maximum number of total Director Jobs that
146 should run  concurrently. The default is set to 1, but you may set it to a 
147 larger number.  
148
149 Please  note that the Volume format becomes much more complicated with 
150 multiple simultaneous jobs, consequently, restores can take much  longer if
151 Bacula must sort through interleaved volume blocks from  multiple simultaneous
152 jobs. This can be avoided by having each  simultaneously running job write to
153 a different volume or  by using data spooling, which will first spool the data
154 to disk simultaneously, then write each spool file to the  volume in
155 sequence.  
156
157 There may also still be some cases where directives such as  {\bf Maximum
158 Volume Jobs} are not properly synchronized with  multiple simultaneous jobs
159 (subtle timing issues can arise),  so careful testing is recommended. 
160
161 At the current time,  there is no configuration parameter set to limit the
162 number of console connections. A maximum of five simultaneous console 
163 connections are permitted.  
164
165 For more details on getting concurrent jobs to run, please  see 
166 \ilink{Running Concurrent Jobs}{ConcurrentJobs} in the Tips chapter
167 of this manual.  
168
169 \item [FD Connect Timeout = \lt{}time\gt{}]
170    \index[dir]{FD Connect Timeout  }
171    where {\bf time}  is the time that the Director should continue attempting  to
172 contact the File daemon to start a job, and after which the  Director will
173 cancel the job. The default is 30 minutes. 
174
175 \item [SD Connect Timeout = \lt{}time\gt{}]
176    \index[dir]{SD Connect Timeout  }
177    where {\bf time}  is the time that the Director should continue attempting  to
178 contact the Storage daemon to start a job, and after which the  Director will
179 cancel the job. The default is 30 minutes. 
180
181 \item [DirAddresses = \lt{}IP-address-specification\gt{}]
182    \index[dir]{DirAddresses  }
183    Specify the ports and addresses on which the Director daemon will  listen for
184 Bacula Console connections. Probably the simplest way  to explain this is to show
185 an example: 
186
187 \footnotesize
188 \begin{verbatim}
189  DirAddresses  = { ip = {
190         addr = 1.2.3.4; port = 1205; }
191     ipv4 = {
192         addr = 1.2.3.4; port = http; }
193     ipv6 = {
194         addr = 1.2.3.4;
195         port = 1205;
196     }
197     ip = {
198         addr = 1.2.3.4
199         port = 1205
200     }
201     ip = {
202         addr = 1.2.3.4
203     }
204     ip = {
205         addr = 201:220:222::2
206     }
207     ip = {
208         addr = bluedot.thun.net
209     }
210  }
211 \end{verbatim}
212 \normalsize
213
214 where ip, ip4, ip6, addr, and port are all keywords. Note, that  the address
215 can be specified as either a dotted quadruple, or  IPv6 colon notation, or as
216 a symbolic name (only in the ip specification).  Also, port can be specified
217 as a number or as the mnemonic value from  the /etc/services file.  If a port
218 is not specified, the default will be used. If an ip  section is specified,
219 the resolution can be made either by IPv4 or  IPv6. If ip4 is specified, then
220 only IPv4 resolutions will be permitted,  and likewise with ip6. 
221
222 \item [DIRport = \lt{}port-number\gt{}]
223    \index[dir]{DIRport  }
224    Specify the port (a positive  integer) on which the  Director daemon will
225 listen for Bacula Console connections.  This same port number must be
226 specified in the Director resource  of the Console configuration file. The
227 default is 9101, so  normally this directive need not be specified.  This
228 directive is not needed if you specify DirAddresses. 
229
230 \item [DirAddress = \lt{}IP-Address\gt{}]
231    \index[dir]{DirAddress  }
232    This directive is optional,  but if it is specified, it will cause the
233 Director server (for  the Console program) to bind to the specified {\bf
234 IP-Address},  which is either a domain name or an IP address specified as a 
235 dotted quadruple in string or quoted string format.  If this directive is not
236 specified, the Director  will bind to any available address (the default). 
237 Note, unlike the DirAddresses specification noted above, this  directive only
238 permits a single address to be specified.  This directive is not needed if you
239 specify a DirAddresses  (not plural). 
240 \end{description}
241
242 The following is an example of a valid Director resource definition: 
243
244 \footnotesize
245 \begin{verbatim}
246 Director {
247   Name = HeadMan
248   WorkingDirectory = "$HOME/bacula/bin/working"
249   Password = UA_password
250   PidDirectory = "$HOME/bacula/bin/working"
251   QueryFile = "$HOME/bacula/bin/query.sql"
252   Messages = Standard
253 }
254 \end{verbatim}
255 \normalsize
256
257 \subsection*{The Job Resource}
258 \label{JobResource}
259 \index[general]{Resource!Job }
260 \index[general]{Job Resource }
261 \addcontentsline{toc}{subsection}{Job Resource}
262
263 The Job resource defines a Job (Backup, Restore, ...) that Bacula must
264 perform. Each Job resource definition contains the names of the Clients and
265 their FileSets to backup or restore, the Schedule for the Job, where the data
266 are to be stored, and what media Pool can be used. In effect, each Job
267 resource must specify What, Where, How, and When or FileSet, Storage,
268 Backup/Restore/Level, and Schedule respectively. 
269
270 Only a single type ({\bf Backup}, {\bf Restore}, ...) can be specified for any
271 job. If you want to backup multiple FileSets on the same Client or multiple
272 Clients, you must define a Job for each one. 
273
274 \begin{description}
275
276 \item [Job]
277    \index[dir]{Job }
278    Start of the Job resource. At least one Job  resource is required. 
279
280 \item [Name = \lt{}name\gt{}]
281    \index[dir]{Name  }
282    The Job name. This name can be specified  on the {\bf Run} command in the
283    console program to start a job. If the  name contains spaces, it must be
284    specified between quotes. It is  generally a good idea to give your job the
285    same name as the Client  that it will backup. This permits easy identification
286    of jobs.  
287
288    When the job actually runs, the unique Job Name will consist  of the name you
289    specify here followed by the date and time the  job was scheduled for
290    execution. This directive is required. 
291
292 \item [Type = \lt{}job-type\gt{}]
293    \index[dir]{Type  }
294    The {\bf Type} directive specifies  the Job type, which may be one of the
295 following: {\bf Backup},  {\bf Restore}, {\bf Verify}, or {\bf Admin}. This
296 directive  is required. Within a particular Job Type, there are also Levels 
297 as discussed in the next item.  
298
299 \begin{description}
300
301 \item [Backup]
302    \index[dir]{Backup }
303    Run a backup Job. Normally you will  have at least one Backup job for each
304 client you want  to save. Normally, unless you turn off cataloging,  most all
305 the important statistics and data concerning  files backed up will be placed
306 in the catalog. 
307
308 \item [Restore]
309    \index[dir]{Restore }
310    Run a restore Job. Normally, you will  specify only one Restore job which acts
311 as a sort  of prototype that you will modify using the console  program in
312 order to perform restores. Although certain  basic information from a Restore
313 job is saved in the  catalog, it is very minimal compared to the information 
314 stored for a Backup job -- for example, no File database  entries are
315 generated since no Files are saved.  
316
317 \item [Verify]
318    \index[dir]{Verify }
319    Run a verify Job. In general, {\bf verify}  jobs permit you to compare the
320 contents of the catalog  to the file system, or to what was backed up. In
321 addition,  to verifying that a tape that was written can be read,  you can
322 also use {\bf verify} as a sort of tripwire  intrusion detection.  
323
324 \item [Admin]
325    \index[dir]{Admin }
326    Run an admin Job. An {\bf Admin} job can  be used to periodically run catalog
327 pruning, if you  do not want to do it at the end of each {\bf Backup}  Job.
328 Although an Admin job is recorded in the  catalog, very little data is saved. 
329 \end{description}
330
331 \label{Level}
332
333 \item [Level = \lt{}job-level\gt{}]
334    \index[dir]{Level  }
335    The Level directive specifies  the default Job level to be run. Each different
336 Job Type (Backup, Restore, ...) has a different set of Levels  that can be
337 specified. The Level is normally overridden  by a different value that is
338 specified in the {\bf Schedule}  resource. This directive is not required, but
339 must be specified either  by a {\bf Level} directive or as a override
340 specified in the  {\bf Schedule} resource.  
341
342 For a {\bf Backup} Job, the Level may be one of the  following:  
343
344 \begin{description}
345
346 \item [Full]
347    \index[dir]{Full }
348    is all files in the FileSet whether or not they  have changed.  
349
350 \item [Incremental]
351    \index[dir]{Incremental }
352    is all files that have changed since the  last successful backup of the
353 specified FileSet. If the  Director cannot find a previous Full backup then
354 the job will be  upgraded into a Full backup. When the Director looks for a 
355 ``suitable'' backup record in the catalog database, it  looks for a previous
356 Job with:  
357
358 \begin{itemize}
359 \item The same Job name.  
360 \item The same Client name.  
361 \item The same FileSet (any change to the definition of  the FileSet such as
362    adding or deleting a file in the  Include or Exclude sections constitutes a
363    different FileSet.  
364 \item The Job was a Full, Differential, or Incremental backup.  
365 \item The Job terminated normally (i.e. did not fail or was not  canceled).  
366    \end{itemize}
367
368 If all the above conditions do not hold, the Director will upgrade  the
369 Incremental to a Full save. Otherwise, the Incremental  backup will be
370 performed as requested.  
371
372 The File daemon (Client) decides which files to backup for an  Incremental
373 backup by comparing start time of the prior Job  (Full, Differential, or
374 Incremental) against the time each file  was last ``modified'' (st\_mtime) and
375 the time its  attributes were last ``changed''(st\_ctime). If the  file was
376 modified or its attributes changed on or after this  start time, it will then
377 be backed up.  
378
379 Please note that some  virus scanning software may change st\_ctime while
380 doing the  scan. For exaple, if the the virus scanning program attempts  to
381 reset the access time (st\_atime), which Bacula does not use,  it will cause
382 st\_ctime to change and hence Bacula will backup  the file during an
383 Incremental or Differential backup. In the  case of Sophos virus scanning, you
384 can prevent it from  resetting the access time (st\_atime) and hence changing 
385 st\_ctime by using the {\bf \verb{--{no-reset-atime} option. For  other software,
386 please see their manual.  
387
388 When Bacula does an Incremental backup, all modified  files that are still on
389 the system are backed up.  However, any file that has been deleted since the
390 last  Full backup remains in the Bacula catalog, which means  that if between
391 a Full save and the time you do a  restore, some files are deleted, those
392 deleted files  will also be restored. The deleted files will no longer  appear
393 in the catalog after doing another Full save.  However, to remove deleted
394 files from the catalog during an Incremental backup is quite a time consuming
395 process  and not currently implemented in Bacula. 
396
397 \item [Differential]
398    \index[dir]{Differential }
399    is all files that have changed since the  last successful Full backup of the
400 specified FileSet.  If the Director cannot find a previous Full backup or a 
401 suitable Full backup, then the Differential job will be  upgraded into a Full
402 backup. When the Director looks for  a ``suitable'' Full backup record in the
403 catalog  database, it looks for a previous Job with:  
404
405 \begin{itemize}
406 \item The same Job name.  
407 \item The same Client name.  
408 \item The same FileSet (any change to the definition of  the FileSet such as
409    adding or deleting a file in the  Include or Exclude sections constitutes a
410    different FileSet.  
411 \item The Job was a FULL backup.  
412 \item The Job terminated normally (i.e. did not fail or was not  canceled).  
413    \end{itemize}
414
415 If all the above conditions do not hold, the Director will  upgrade the
416 Differential to a Full save. Otherwise, the  Differential backup will be
417 performed as requested.  
418
419 The File daemon (Client) decides which files to backup for a  differential
420 backup by comparing the start time of the prior  Full backup Job against the
421 time each file was last  ``modified'' (st\_mtime) and the time its attributes
422 were  last ``changed''(st\_ctime). If the file was modified or  its attributs
423 were changed on or after this start time, it will  then be backed up. The
424 start time used is displayed after the  {\bf Since} on the Job report. In rare
425 cases, using the start  time of the prior backup may cause some files to be
426 backed up  twice, but it ensures that no change is missed. As with the 
427 Incremental option, you should ensure that the clocks on your  server and
428 client are synchronized or as close as possible to  avoid the possibility of a
429 file being skipped. Note, on  versions 1.33 or greater Bacula automatically
430 makes the  necessary adjustments to the time between the server and the  client
431 so that the times Bacula uses are synchronized.  
432
433 When Bacula does a Differential backup, all modified  files that are still on
434 the system are backed up.  However, any file that has been deleted since the
435 last  Full backup remains in the Bacula catalog, which means  that if between
436 a Full save and the time you do a  restore, some files are deleted, those
437 deleted files  will also be restored. The deleted files will no longer  appear
438 in the catalog after doing another Full save.  However, to remove deleted
439 files from the catalog during  a Differential backup is quite a time consuming
440 process  and not currently implemented in Bacula. 
441 \end{description}
442
443 For a {\bf Restore} Job, no level needs to be specified.  
444
445 For a {\bf Verify} Job, the Level may be one of the  following:  
446
447 \begin{description}
448
449 \item [InitCatalog]
450    \index[dir]{InitCatalog }
451    does a scan of the specified {\bf FileSet} and stores the file
452    attributes in the Catalog database.  Since no file data is saved, you
453    might ask why you would want to do this.  It turns out to be a very
454    simple and easy way to have a {\bf Tripwire} like feature using {\bf
455    Bacula}.  In other words, it allows you to save the state of a set of
456    files defined by the {\bf FileSet} and later check to see if those files
457    have been modified or deleted and if any new files have been added.
458    This can be used to detect system intrusion.  Typically you would
459    specify a {\bf FileSet} that contains the set of system files that
460    should not change (e.g.  /sbin, /boot, /lib, /bin, ...).  Normally, you
461    run the {\bf InitCatalog} level verify one time when your system is
462    first setup, and then once again after each modification (upgrade) to
463    your system.  Thereafter, when your want to check the state of your
464    system files, you use a {\bf Verify} {\bf level = Catalog}.  This
465    compares the results of your {\bf InitCatalog} with the current state of
466    the files.
467
468 \item [Catalog]
469    \index[dir]{Catalog }
470    Compares the current state of the files against the state previously
471    saved during an {\bf InitCatalog}.  Any discrepancies are reported.  The
472    items reported are determined by the {\bf verify} options specified on
473    the {\bf Include} directive in the specified {\bf FileSet} (see the {\bf
474    FileSet} resource below for more details).  Typically this command will
475    be run once a day (or night) to check for any changes to your system
476    files.
477
478    Please note!  If you run two Verify Catalog jobs on the same client at
479    the same time, the results will certainly be incorrect.  This is because
480    Verify Catalog modifies the Catalog database while running in order to
481    track new files.
482
483 \item [VolumeToCatalog]
484    \index[dir]{VolumeToCatalog }
485    This level causes Bacula to read  the file attribute data written to the
486 Volume from the last Job.  The file attribute data are compared to the values
487 saved in the  Catalog database and any differences are reported. This is 
488 similar to the {\bf Catalog} level except that instead of  comparing the disk
489 file attributes to the catalog database, the  attribute data written to the
490 Volume is read and compared to the  catalog database. Although the attribute
491 data including the  signatures (MD5 or SHA1) are compared the actual file data
492 is not  compared (it is not in the catalog). 
493
494 Please note! If you  run two Verify VolumeToCatalog jobs on the same client at
495 the  same time, the results will certainly be incorrect. This is  because the
496 Verify VolumeToCatalog modifies the Catalog database  while running. 
497
498 \item [DiskToCatalog]
499    \index[dir]{DiskToCatalog }
500    This level causes Bacula to read the  files as they currently are on disk, and
501 to compare the  current file attributes with the attributes saved in the 
502 catalog from the last backup for the job specified on  the {\bf VerifyJob}
503 directive. This level differs from the  {\bf Catalog} level described above by
504 the fact that it  doesn't compare against a previous Verify job but against a 
505 previous backup. When you run this level, you must supply the  verify options
506 on your Include statements. Those options  determine what attribute fields are
507 compared.  
508
509 This command can be very useful if you have disk problems  because it will
510 compare the current state of your disk against  the last successful backup,
511 which may be several jobs.  
512
513 Note, the current implementation (1.32c) does not  identify files that have
514 been deleted.  
515 \end{description}
516
517 \item [Verify Job = \lt{}Job-Resource-Name\gt{}]
518    \index[dir]{Verify Job  }
519    If you run  a verify job without this directive, the last job run will  be
520 compared with the catalog, which means that you must  immediately follow a
521 backup by a verify command. If you  specify a {\bf Verify Job} Bacula will
522 find the last  job with that name that ran. This permits you to run  all your
523 backups, then run Verify jobs on those that  you wish to be verified (most
524 often a {\bf VolumeToCatalog})  so that the tape just written is re-read. 
525
526 \item [JobDefs = \lt{}JobDefs-Resource-Name\gt{}]
527    \index[dir]{JobDefs  }
528    If a JobDefs-Resource-Name  is specified, all the values contained in the
529 named JobDefs resource  will be used as the defaults for the current Job. Any
530 value that  you explicitly define in the current Job resource, will override 
531 any defaults specified in the JobDefs resource. The use of this  directive
532 permits writing much more compact Job resources where the  bulk of the
533 directives are defined in one or more JobDefs. This  is particularly useful if
534 you have many similar Jobs but with  minor variations such as different
535 Clients. A simple example  of the use of JobDefs is provided in the default
536 bacula-dir.conf  file. 
537
538 \item [Bootstrap = \lt{}bootstrap-file\gt{}]
539    \index[dir]{Bootstrap  }
540    The Bootstrap  directive specifies a bootstrap file that, if provided, will 
541 be used during {\bf Restore} Jobs and is ignored in other  Job types. The {\bf
542 bootstrap}  file contains the list of tapes to be used in a restore  Job as
543 well as which files are to be restored. Specification  of this directive is
544 optional, and  if specified, it is used only for a restore job. In addition, 
545 when running a Restore job from the console, this value can  be changed.  
546
547 If you use the {\bf Restore} command in the Console program,  to start a
548 restore job, the {\bf bootstrap}  file will be created automatically from the
549 files you  select to be restored.  
550
551 For additional details of the {\bf bootstrap} file, please see  
552 \ilink{Restoring Files with the Bootstrap File}{_ChapterStart43} 
553 chapter of this manual. 
554
555 \label{writebootstrap}
556 \item [Write Bootstrap =  \lt{}bootstrap-file-specification\gt{}]
557    \index[dir]{a name }
558    The  {\bf writebootstrap} directive specifies a file name where  Bacula will
559 write a {\bf bootstrap} file for each Backup job  run. Thus this directive
560 applies only to Backup Jobs. If the Backup  job is a Full save, Bacula will
561 erase any current contents of  the specified file before writing the bootstrap
562 records. If the Job  is an Incremental save, Bacula will append the current 
563 bootstrap record to the end of the file.  
564
565 Using this feature,  permits you to constantly have a bootstrap file that can
566 recover the  current state of your system. Normally, the file specified should
567 be a mounted drive on another machine, so that if your hard disk is  lost,
568 you will immediately have a bootstrap record available.  Alternatively, you
569 should copy the bootstrap file to another machine  after it is updated.  
570
571 If the {\bf bootstrap-file-specification} begins with a  vertical bar (|),
572 Bacula will use the specification as the  name of a program to which it will
573 pipe the bootstrap record.  It could for example be a shell script that emails
574 you the  bootstrap record. 
575
576 For more details on using this file,  please see the chapter entitled 
577 \ilink{The Bootstrap File}{_ChapterStart43} of this manual. 
578
579 \item [Client = \lt{}client-resource-name\gt{}]
580    \index[dir]{Client  }
581    The Client directive  specifies the Client (File daemon) that will be used in
582    the  current Job. Only a single Client may be specified in any one Job.  The
583    Client runs on the machine to be backed up,  and sends the requested files to
584    the Storage daemon for backup,  or receives them when restoring. For
585    additional details, see the  
586    \ilink{Client Resource section}{ClientResource2} of this chapter.
587    This directive is required. 
588
589 \item [FileSet = \lt{}FileSet-resource-name\gt{}]
590    \index[dir]{FileSet  }
591    The FileSet directive  specifies the FileSet that will be used in the  current
592    Job. The FileSet specifies which directories (or files)  are to be backed up,
593    and what options to use (e.g. compression, ...).  Only a single FileSet
594    resource may be specified in any one Job.  For additional details, see the  
595    \ilink{FileSet Resource section}{FileSetResource} of this
596    chapter. This directive is required. 
597
598 \item [Messages = \lt{}messages-resource-name\gt{}]
599    \index[dir]{Messages  }
600    The Messages directive  defines what Messages resource should be used for this
601    job, and thus  how and where the various messages are to be delivered. For
602    example,  you can direct some messages to a log file, and others can be  sent
603    by email. For additional details, see the  
604    \ilink{Messages Resource}{_ChapterStart15} Chapter of this 
605    manual. This directive is required. 
606
607 \item [Pool = \lt{}pool-resource-name\gt{}]
608    \index[dir]{Pool  }
609    The Pool directive defines  the pool of Volumes where your data can be backed
610    up. Many Bacula  installations will use only the {\bf Default} pool. However,
611    if  you want to specify a different set of Volumes for different  Clients or
612    different Jobs, you will probably want to use Pools.  For additional details,
613    see the 
614    \ilink{Pool Resource section}{PoolResource} of this chapter. This
615    resource is required. 
616
617 \item [Full Backup Pool = \lt{}pool-resource-name\gt{}]
618    \index[dir]{Full Backup Pool  }
619    The {\it Full Backup Pool} specifies a Pool to be used for  Full backups. It
620    will override any Pool specification during a  Full backup. This resource is
621    optional. 
622    
623 \item [Differential Backup Pool = \lt{}pool-resource-name\gt{}]  
624    \index[dir]{Differential Backup Pool  }
625    The {\it Differential Backup Pool} specifies a Pool to be used for 
626    Differential backups. It will override any Pool specification during a 
627    Differential backup. This resource is optional. 
628    
629 \item [Incremental Backup Pool = \lt{}pool-resource-name\gt{}]  
630    \index[dir]{Incremental Backup Pool  }
631    The {\it Incremental Backup Pool} specifies a Pool to be used for  Incremental
632    backups. It will override any Pool specification during an  Incremental backup.
633    This resource is optional. 
634
635 \item [Schedule = \lt{}schedule-name\gt{}]
636    \index[dir]{Schedule  }
637    The Schedule directive defines  what schedule is to be used for the Job. The
638    schedule determines  when the Job will be automatically started and what Job
639    level (i.e.  Full, Incremental, ...) is to be run. This directive is optional,
640    and  if left out, the Job can only be started manually. For additional 
641    details, see the 
642    \ilink{Schedule Resource Chapter}{ScheduleResource} of this
643    manual.  If a Schedule resource is specified, the job will be run according to
644    the schedule specified. If no Schedule resource is specified for the  Job,
645    the job must be manually started using the Console program.  Although you may
646    specify only a single Schedule resource for any one  job, the Schedule
647    resource may contain multiple {\bf Run} directives,  which allow you to run
648    the Job at many different times, and each  {\bf run} directive permits
649    overriding the default Job Level Pool,  Storage, and Messages resources. This
650    gives considerable flexibility  in what can be done with a single Job. 
651
652 \item [Storage = \lt{}storage-resource-name\gt{}]
653    \index[dir]{Storage  }
654    The Storage directive  defines the name of the storage services where you want
655    to backup  the FileSet data. For additional details, see the 
656    \ilink{Storage Resource Chapter}{StorageResource2} of this manual.
657     This directive is required.  
658
659 \item [Max Start Delay = \lt{}time\gt{}]
660    \index[dir]{Max Start Delay  }
661    The time specifies the maximum delay between the scheduled time and the
662    actual start time for the Job.  For example, a job can be scheduled to
663    run at 1:00am, but because other jobs are running, it may wait to run.
664    If the delay is set to 3600 (one hour) and the job has not begun to run
665    by 2:00am, the job will be canceled.  This can be useful, for example,
666    to prevent jobs from running during day time hours.  The default is 0
667    which indicates no limit.
668
669 \item [Max Run Time = \lt{}time\gt{}]
670    \index[dir]{Max Run Time  }
671    The time specifies the maximum allowed time that a job may run, counted
672    from when the job starts, ({\bf not} necessarily the same as when the
673    job was scheduled).  This directive is implemented in version 1.33 and
674    later.
675
676 \item [Max Wait Time = \lt{}time\gt{}]
677    \index[dir]{Max Wait Time  }
678    The time specifies the maximum allowed time that a job may block waiting
679    for a resource (such as waiting for a tape to be mounted, or waiting for
680    the storage or file daemons to perform their duties), counted from the
681    when the job starts, ({\bf not} necessarily the same as when the job was
682    scheduled).  This directive is implemented only in version 1.33 and
683    later.
684
685
686
687 \item [Incremental Max Wait Time = \lt{}time\gt{}]
688    \index[dir]{Incremental Max Wait Time  }
689    The time specifies the maximum allowed time that an Incremental backup
690    job may block waiting for a resource (such as waiting for a tape to be
691    mounted, or waiting for the storage or file daemons to perform their
692    duties), counted from the when the job starts, ({\bf not} necessarily
693    the same as when the job was scheduled).  Please note that if there is a
694    {\bf Max Wait Time} it may also be applied to the job.
695
696 \item [Differential Max Wait Time = \lt{}time\gt{}]
697    \index[dir]{Differential Max Wait Time  }
698    The time specifies the maximum allowed time that a Differential backup
699    job may block waiting for a resource (such as waiting for a tape to be
700    mounted, or waiting for the storage or file daemons to perform their
701    duties), counted from the when the job starts, ({\bf not} necessarily
702    the same as when the job was scheduled).  Please note that if there is a
703    {\bf Max Wait Time} it may also be applied to the job.
704
705 \item [Prune Jobs = \lt{}yes|no\gt{}]
706    \index[dir]{Prune Jobs  }
707    Normally, pruning of Jobs from the Catalog is specified on a Client by
708    Client basis in the Client resource with the {\bf AutoPrune} directive.
709    If this directive is specified (not normally) and the value is {\bf
710    yes}, it will override the value specified in the Client resource.  The
711    default is {\bf no}.
712
713
714 \item [Prune Files = \lt{}yes|no\gt{}]
715    \index[dir]{Prune Files  }
716    Normally, pruning of Files from the Catalog is specified on a Client by
717    Client basis in the Client resource with the {\bf AutoPrune} directive.
718    If this directive is specified (not normally) and the value is {\bf
719    yes}, it will override the value specified in the Client resource.  The
720    default is {\bf no}.
721
722 \item [Prune Volumes = \lt{}yes|no\gt{}]
723    \index[dir]{Prune Volumes  }
724    Normally, pruning of Volumes from the Catalog is specified on a Client
725    by Client basis in the Client resource with the {\bf AutoPrune}
726    directive.  If this directive is specified (not normally) and the value
727    is {\bf yes}, it will override the value specified in the Client
728    resource.  The default is {\bf no}.
729
730 \item [Run Before Job = \lt{}command\gt{}]
731    \index[dir]{Run Before Job  }
732    The specified {\bf command} is run as an external program prior to
733    running the current Job.  Any output sent by the job to standard output
734    will be included in the Bacula job report.  The command string must be a
735    valid program name or name of a shell script.  This directive is not
736    required, but if it is defined, and if the exit code of the program run
737    is non-zero, the current Bacula job will be canceled.  In addition, the
738    command string is parsed then fed to the execvp() function, which means
739    that the path will be searched to execute your specified command, but
740    there is no shell interpretation, as a consequence, if you invoke
741    complicated commands or want any shell features such as redirection or
742    piping, you must call a shell script and do it inside that script.
743  
744    Before submitting the specified command to the operating system, Bacula
745    performs character substitution of the following characters:
746   
747 \footnotesize
748 \begin{verbatim}
749     %% = %
750     %c = Client's name
751     %d = Director's name
752     %i = JobId
753     %e = Job Exit Status
754     %j = Unique Job name
755     %l = Job Level
756     %n = Job name
757     %t = Job type
758     %v = Volume name
759     
760 \end{verbatim}
761 \normalsize
762
763 The Job Exit Status code \%e edits the following values:
764
765 \index[dir]{Exit Status}
766 \begin{itemize}
767 \item OK
768 \item Error
769 \item Fatal Error
770 \item Canceled
771 \item Differences
772 \item Unknown term code
773 \end{itemize}
774
775    Thus if you edit it on a command line, you will need to enclose 
776    it within some sort of quotes.
777    
778    Bacula checks the exit status of the RunBeforeJob 
779    program. If it is non-zero, the job will be error terminated.  Lutz Kittler
780    has pointed out that this can be a simple way to modify  your schedules during
781    a holiday. For example, suppose that you normally  do Full backups on Fridays,
782    but Thursday and Friday are holidays. To avoid  having to change tapes between
783    Thursday and Friday when no one is in the  office, you can create a
784    RunBeforeJob that returns a non-zero status on  Thursday and zero on all other
785    days. That way, the Thursday job will not  run, and on Friday the tape you
786    inserted on Wednesday before leaving will  be used.  
787
788 \item [Run After Job = \lt{}command\gt{}]
789    \index[dir]{Run After Job  }
790    The specified {\bf command}  is run as an external program after the current
791    job terminates.  This directive is not required. The  command string must be a
792    valid program name or name of a shell script.  If the exit code of the program
793    run is non-zero, the current  Bacula job will terminate in error.  Before
794    submitting the specified command to the operating system,  Bacula performs
795    character substitution as described above  for the {\bf Run Before Job}
796    directive.  
797    
798    An example of the use of this command is given in the  
799    \ilink{Tips Chapter}{JobNotification} of this manual.  As of version
800    1.30, Bacula checks the exit status of the RunAfter  program. If it is
801    non-zero, the job will be terminated in error.  
802
803 \item [Client Run Before Job = \lt{}command\gt{}]
804    \index[dir]{Client Run Before Job  }
805    This command  is the same as {\bf Run Before Job} except that it is  run on
806    the client machine. The same restrictions apply to  Unix systems as noted
807    above for the {\bf Run Before Job}. In  addition, for a Windows client on
808    version 1.33 and above, please  take careful note that you must ensure a
809    correct path to your  script. The script or program can be a .com, .exe or
810    a .bat  file. However, if you specify a path, you must also specify  the full
811    extension. Unix like commands will not work unless you  have installed and
812    properly configured Cygwin in addition to  and separately from Bacula.  
813    
814    {\bf Special Windows Considerations}
815    The command can be anything that cmd.exe or command.com will  recognize as an
816    executable file. Specifiying the executable's  extension is optional, unless
817    there is an ambiguity. (i.e.  ls.bat, ls.exe)  
818    
819    The System \%Path\% will be searched for the command. (under  the envrionment
820    variable dialog you have have both System  Environment and User Environment,
821    we believe that only the  System environment will be available to bacula-fd,
822    if it is  running as a service.)  
823    
824    System environment variables can be called out using the \%var\%  syntax and
825    used as either part of the command name or  arguments.  
826    
827    When specifiying a full path to an executable if the path or  executable name
828    contains whitespace or special characters they  will need to be quoted.
829    Arguments containing whitespace or  special characters will also have to be
830    quoted. 
831
832 \footnotesize
833 \begin{verbatim}
834 ClientRunBeforeJob = "\"C:/Program Files/Software
835      Vendor/Executable\" /arg1 /arg2 \"foo bar\""
836 \end{verbatim}
837 \normalsize
838
839    The special characters \&()[]\{\}\^{}=;!'+,`\~{} will need to be quoted  if
840    they are part of a filename or argument.  
841    
842    If someone is logged in, a blank ``command'' window running the  commands will
843    be present during the execution of the command.  
844    
845    Some Suggestions from Phil Stracchino for running on Win32 machines  with the
846    native Win32 File daemon: 
847
848    \begin{enumerate}
849    \item You might want the ClientRunBeforeJob directive to specify a .bat file
850       which  runs the actual client-side commands, rather than trying to run (for 
851       example) regedit /e directly.  
852    \item The batch file should explicitly 'exit 0' on successful completion.  
853    \item The path to the batch file should be specified in Unix form:  
854    
855       ClientRunBeforeJob = ``c:/bacula/bin/systemstate.bat''  
856    
857    rather than DOS/Windows form:  
858    
859    ClientRunBeforeJob =
860    ``c:\textbackslash{}bacula\textbackslash{}bin\textbackslash{}systemstate.bat''
861    INCORRECT 
862    \end{enumerate}
863    
864 The following example of the use of the Client Run Before Job directive was 
865 submitted by a user:\\
866 You could write a shell script to back up a DB2 database to a FIFO. The shell script is:
867
868 \footnotesize
869 \begin{verbatim}
870  #!/bin/sh
871  # ===== backupdb.sh
872  DIR=/u01/mercuryd
873  
874  mkfifo $DIR/dbpipe
875  db2 BACKUP DATABASE mercuryd TO $DIR/dbpipe WITHOUT PROMPTING &
876  sleep 1
877 \end{verbatim}
878 \normalsize
879  
880 The following line in the Job resoure in the bacula-dir.conf file:
881 \footnotesize
882 \begin{verbatim}
883  Client Run Before Job = "su - mercuryd -c \"/u01/mercuryd/backupdb.sh '%t' '%l'\""
884 \end{verbatim}
885 \normalsize
886  When the job is run, you will get messages from the output of the script stating 
887  that the backup has started. Even though the command being run is 
888  backgrounded with \&, the job will block until the "db2 BACKUP DATABASE" command,
889  thus the backup stalls.
890  
891  To remedy this situation, the "db2 BACKUP DATABASE" line should be changed to the following:
892  
893 \footnotesize
894 \begin{verbatim} 
895  db2 BACKUP DATABASE mercuryd TO $DIR/dbpipe WITHOUT PROMPTING > $DIR/backup.log 2>&1 < /dev/null &
896 \end{verbatim}
897 \normalsize
898
899 It is important to redirect the input and outputs of a backgrounded command to
900 /dev/null to prevent the script from blocking.
901
902
903 \item [Client Run After Job = \lt{}command\gt{}]
904    \index[dir]{Client Run After Job  }
905    This command  is the same as {\bf Run After Job} except that it is  run on the
906    client machine. Note, please see the notes above  in {\bf Client Run Before
907    Job} concerning Windows clients. 
908
909 \item [Rerun Failed Levels = \lt{}yes|no\gt{}]
910    \index[dir]{Rerun Failed Levels  }
911    If this directive  is set to {\bf yes} (default no), and Bacula detects that a
912    previous job at a higher level (i.e. Full or Differential)  has failed, the
913    current job level will be upgraded to the  higher level. This is particularly
914    useful for Laptops where  they may often be unreachable, and if a prior Full
915    save has  failed, you wish the very next backup to be a Full save  rather than
916    whatever level it is started as. 
917
918 \item [Spool Data = \lt{}yes|no\gt{}]
919    \index[dir]{Spool Data  }
920    If this directive is set  to {\bf yes} (default no), the Storage daemon will
921 be requested  to spool the data for this Job to disk rather than write it 
922 directly to tape. Once all the data arrives or the spool files' maximum sizes
923 are reached, the data will be despooled and written  to tape. When this
924 directive is set to yes, the Spool Attributes  is also automatically set to
925 yes. Spooling data prevents tape  shoe-shine (start and stop) during
926 Incremental saves. This option  should not be used if you are writing to a
927 disk file. 
928
929 \item [Spool Attributes = \lt{}yes|no\gt{}]
930    \index[dir]{Spool Attributes  }
931    The default is set to  {\bf no}, which means that the File attributes are sent
932 by the  Storage daemon to the Director as they are stored on tape. However, 
933 if you want to avoid the possibility that database updates will  slow down
934 writing to the tape, you may want to set the value to  {\bf yes}, in which
935 case the Storage daemon will buffer the  File attributes and Storage
936 coordinates to a temporary file  in the Working Directory, then when writing
937 the Job data to the tape is  completed, the attributes and storage coordinates
938 will be  sent to the Director. The default is {\bf no}. 
939
940 \item [Where = \lt{}directory\gt{}]
941    \index[dir]{Where  }
942    This directive applies only  to a Restore job and specifies a prefix to the
943 directory name  of all files being restored. This permits files to be restored
944 in a different location from which they were saved. If {\bf Where}  is not
945 specified or is set to backslash ({\bf /}), the files  will be restored to
946 their original location. By default, we  have set {\bf Where} in the example
947 configuration files to be  {\bf /tmp/bacula-restores}. This is to prevent
948 accidental overwriting  of your files. 
949
950 \item [Replace = \lt{}replace-option\gt{}]
951    \index[dir]{Replace  }
952    This directive applies only  to a Restore job and specifies what happens when
953 Bacula wants to  restore a file or directory that already exists. You have the
954  following options for {\bf replace-option}:  
955
956 \begin{description}
957
958 \item [always]
959    \index[dir]{always }
960   when the file to be restored already exists,  it is deleted and then replaced by
961   the copy that was backed up.  
962
963 \item [ifnewer]
964    \index[dir]{ifnewer }
965   if the backed up file (on tape) is newer than the  existing file, the existing
966   file is deleted and replaced by  the back up.  
967
968 \item [ifolder]
969    \index[dir]{ifolder }
970   if the backed up file (on tape) is older than the  existing file, the existing
971   file is deleted and replaced by  the back up.  
972
973 \item [never]
974    \index[dir]{never }
975   if the backed up file already exists, Bacula skips  restoring this file.  
976 \end{description}
977
978 \item [Prefix Links=\lt{}yes|no\gt{}]
979    \index[dir]{Prefix Links }
980    If a {\bf Where} path prefix is specified for a recovery job, apply it
981    to absolute links as well.  The default is {\bf No}.  When set to {\bf
982    Yes} then while restoring files to an alternate directory, any absolute
983    soft links will also be modified to point to the new alternate
984    directory.  Normally this is what is desired -- i.e.  everything is self
985    consistent.  However, if you wish to later move the files to their
986    original locations, all files linked with absolute names will be broken.
987
988 \item [Maximum Concurrent Jobs = \lt{}number\gt{}]
989    \index[dir]{Maximum Concurrent Jobs  }
990    where \lt{}number\gt{} is the maximum number of Jobs from the current
991    Job resource that can run concurrently.  Note, this directive limits
992    only Jobs with the same name as the resource in which it appears.  Any
993    other restrictions on the maximum concurrent jobs such as in the
994    Director, Client, or Storage resources will also apply in addition to
995    the limit specified here.  The default is set to 1, but you may set it
996    to a larger number.  We strongly recommend that you read the WARNING
997    documented under \ilink{ Maximum Concurrent Jobs}{DirMaxConJobs} in the
998    Director's resource.
999
1000 \item [Reschedule On Error = \lt{}yes|no\gt{}]
1001    \index[dir]{Reschedule On Error  }
1002    If this directive is enabled, and the job terminates in error, the job
1003    will be rescheduled as determined by the {\bf Reschedule Interval} and
1004    {\bf Reschedule Times} directives.  If you cancel the job, it will not
1005    be rescheduled.  The default is {\bf no} (i.e.  the job will not be
1006    rescheduled).
1007
1008
1009    This specification can be useful for portables, laptops, or other
1010    machines that are not always connected to the network or switched on.
1011
1012 \item [Reschedule Interval = \lt{}time-specification\gt{}]
1013    \index[dir]{Reschedule Interval  }
1014    If you have specified {\bf Reschedule On Error = yes} and the job
1015    terminates in error, it will be rescheduled after the interval of time
1016    specified by {\bf time-specification}.  See \ilink{ the time
1017    specification formats}{Time} in the Configure chapter for details of
1018    time specifications.  If no interval is specified, the job will not be
1019    rescheduled on error.
1020
1021 \item [Reschedule Times = \lt{}count\gt{}]
1022    \index[dir]{Reschedule Times  }
1023    This directive specifies the maximum number of times to reschedule the
1024    job.  If it is set to zero (the default) the job will be rescheduled an
1025    indefinite number of times.
1026
1027 \label{Priority}
1028 \item [Priority = \lt{}number\gt{}]
1029    \index[dir]{Priority  }
1030    This directive permits you to control the order in which your jobs run
1031    by specifying a positive non-zero number.  The higher the number, the
1032    lower the job priority.  Assuming you are not running concurrent jobs,
1033    all queued jobs of priority 1 will run before queued jobs of priority 2
1034    and so on, regardless of the original scheduling order.
1035
1036    The priority only affects waiting jobs that are queued to run, not jobs
1037    that are already running.  If one or more jobs of priority 2 are already
1038    running, and a new job is scheduled with priority 1, the currently
1039    running priority 2 jobs must complete before the priority 1 job is run.
1040
1041    The default priority is 10.  
1042
1043    If you want to run concurrent jobs, which is not recommended, you should  keep
1044    these points in mind:  
1045
1046 \begin{itemize}
1047 \item To run concurrent jobs,  you must set Maximum Concurrent Jobs = 2 in 5
1048    or 6 distinct places:  in bacula-dir.conf in the Director, the Job, the
1049    Client, the Storage  resources; in bacula-fd in the FileDaemon (or Client)
1050    resource,  and in bacula-sd.conf in the Storage resource. If any one  is
1051    missing, it will throttle the jobs to one at a time.  
1052 \item Bacula concurrently runs jobs of only one priority at a time. It will 
1053    not simultaneously run a priority 1 and a priority 2 job.  
1054 \item If Bacula is running a priority 2 job and a new priority 1  job is
1055    scheduled, it will wait until the running priority 2 job  terminates even if
1056    the Maximum Concurrent Jobs settings  would otherwise allow two jobs to run
1057    simultaneously.  
1058 \item Suppose that bacula is running a priority 2 job and a new priority 1  job
1059    is scheduled and queued waiting for the running priority  2 job to terminate.
1060    If you then start a second priority 2 job,  the waiting priority 1 job  will
1061    prevent the new priority 2 job from running concurrently  with the running
1062    priority 2 job.  That is: as long as there is a higher priority job waiting to
1063    run, no new lower priority jobs will start even if  the Maximum Concurrent
1064    Jobs settings would normally allow  them to run. This ensures that higher
1065    priority jobs will  be run as soon as possible. 
1066 \end{itemize}
1067
1068 If you have several jobs of different priority, it is best  not to start them
1069 at exactly the same time, because Bacula  must examine them one at a time. If
1070 by chance Bacula treats  a lower priority first, then it will run before your
1071 high  priority jobs. To avoid this, start any higher priority  a few seconds
1072 before lower ones. This insures that Bacula  will examine the jobs in the
1073 correct order, and that your  priority scheme will be respected.  
1074
1075 \label{WritePartAfterJob}
1076 \item [Write Part After Job = \lt{}yes|no\gt{}]
1077    \index[dir]{Write Part After Job  }
1078    This directive is only implemented in version 1.37 and later.
1079    If this directive is set to {\bf yes} (default {\bf no}), a new part file
1080    will be created after the job is finished.  
1081
1082    It should be set to {\bf yes} when writing to devices that require mount
1083    (for example DVD), so you are sure that the current part, containing
1084    this job's data, is written to the device, and that no data is left in
1085    the temporary file on the hard disk.  However, on some media, like DVD+R
1086    and DVD-R, a lot of space (about 10Mb) is lost everytime a part is
1087    written.  So, if you run several jobs each after another, you could set
1088    this directive to {\bf no} for all jobs, except the last one, to avoid
1089    wasting too much space, but to ensure that the data is written to the
1090    medium when all jobs are finished.
1091
1092    It is ignored with tape and FIFO devices.  
1093 \end{description}
1094
1095 The following is an example of a valid Job resource definition: 
1096
1097 \footnotesize
1098 \begin{verbatim}
1099 Job {
1100   Name = "Minou"
1101   Type = Backup
1102   Level = Incremental                 # default
1103   Client = Minou
1104   FileSet="Minou Full Set"
1105   Storage = DLTDrive
1106   Pool = Default
1107   Schedule = "MinouWeeklyCycle"
1108   Messages = Standard
1109 }
1110 \end{verbatim}
1111 \normalsize
1112
1113 \subsection*{The JobDefs Resource}
1114 \label{JobDefsResource}
1115 \index[general]{JobDefs Resource }
1116 \index[general]{Resource!JobDefs }
1117 \addcontentsline{toc}{subsection}{JobDefs Resource}
1118
1119 The JobDefs resource permits all the same directives that can appear in a Job
1120 resource. However, a JobDefs resource does not create a Job, rather it can be
1121 referenced within a Job to provide defaults for that Job. This permits you to
1122 concisely define several nearly identical Jobs, each one referencing a JobDefs
1123 resource which contains the defaults. Only the changes from the defaults need to
1124 be mentioned in each Job. 
1125
1126 \subsection*{The Schedule Resource}
1127 \label{ScheduleResource}
1128 \index[general]{Resource!Schedule }
1129 \index[general]{Schedule Resource }
1130 \addcontentsline{toc}{subsection}{Schedule Resource}
1131
1132 The Schedule resource provides a means of automatically scheduling a Job as
1133 well as the ability to override the default Level, Pool, Storage and Messages
1134 resources. If a Schedule resource is not referenced in a Job, the Job can only
1135 be run manually. In general, you specify an action to be taken and when. 
1136
1137 \begin{description}
1138
1139 \item [Schedule]
1140    \index[dir]{Schedule }
1141    Start of the Schedule directives. No {\bf Schedule}  resource is required, but
1142 you will need at least one if you want  Jobs to be automatically started. 
1143
1144 \item [Name = \lt{}name\gt{}]
1145    \index[dir]{Name  }
1146    The name of the schedule being defined.  The Name directive is required. 
1147
1148 \item [Run = \lt{}Job-overrides\gt{} \lt{}Date-time-specification\gt{}]
1149    \index[dir]{Run  }
1150    The Run directive defines when a Job is to be run,  and what overrides if any
1151 to apply. You may specify multiple  {\bf run} directives within a {\bf
1152 Schedule} resource. If you  do, they will all be applied (i.e. multiple
1153 schedules). If you  have two {\bf Run} directives that start at the same time,
1154 two  Jobs will start at the same time (well, within one second of  each
1155 other).  
1156
1157 The {\bf Job-overrides} permit overriding the Level, the  Storage, the
1158 Messages, and the Pool specifications  provided in the Job resource. In
1159 addition, the  FullPool, the IncrementalPool, and the  DifferentialPool
1160 specifications permit overriding the  Pool specification according to what
1161 backup Job Level is  in effect.  
1162
1163 By the use of overrides, you  may customize a particular Job. For example, you
1164 may specify a  Messages override for your Incremental backups that  outputs
1165 messages to a log file, but for your weekly or monthly  Full backups, you may
1166 send the output by email by using  a different Messages override.  
1167
1168 {\bf Job-overrides} are specified as:  {\bf keyword=value} where the keyword
1169 is Level, Storage,  Messages, Pool, FullPool, DifferentialPool, or
1170 IncrementalPool, and  the {\bf value} is as defined on the respective
1171 directive formats for  the Job resource. You may specify multiple {\bf
1172 Job-overrides} on  one {\bf Run} directive by separating them with one or more
1173 spaces or  by separating them with a trailing comma.  For example:  
1174
1175 \begin{description}
1176
1177 \item [Level=Full]
1178    \index[dir]{Level }
1179    is all files in the FileSet whether or not  they have changed.  
1180
1181 \item [Level=Incremental]
1182    \index[dir]{Level }
1183    is all files that have changed since  the last backup.  
1184
1185 \item [Pool=Weekly]
1186    \index[dir]{Pool }
1187    specifies to use the Pool named {\bf Weekly}.  
1188
1189 \item [Storage=DLT\_Drive]
1190    \index[dir]{Storage }
1191    specifies to use {\bf DLT\_Drive} for  the storage device.  
1192
1193 \item [Messages=Verbose]
1194    \index[dir]{Messages }
1195    specifies to use the {\bf Verbose}  message resource for the Job.  
1196
1197 \item [FullPool=Full]
1198    \index[dir]{FullPool }
1199    specifies to use the Pool named {\bf Full}  if the job is a full backup, or is
1200 upgraded from another type  to a full backup.  
1201
1202 \item [DifferentialPool=Differential]
1203    \index[dir]{DifferentialPool }
1204    specifies to use the Pool  named {\bf Differential} if the job is a
1205 differential  backup.  
1206
1207 \item [IncrementalPool=Incremental]
1208    \index[dir]{IncrementalPool }
1209    specifies to use the Pool  named {\bf Incremental} if the job is an
1210 incremental  backup.  
1211
1212 \item [SpoolData=yes|no]
1213    \index[dir]{SpoolData }
1214    tells Bacula to request the Storage  daemon to spool data to a disk file
1215 before putting it on  tape.  
1216
1217 \item [WritePartAfterJob=yes|no]
1218    \index[dir]{WritePartAfterJob }
1219    tells Bacula to request the Storage  daemon to write the current part file to
1220    the device when the job  is finished (see 
1221    \ilink{Write Part After Job directive in the Job
1222    resource}{WritePartAfterJob}). Please note, this directive is implemented 
1223    only in version 1.37 and later.
1224
1225 \end{description}
1226
1227 {\bf Date-time-specification} determines when the  Job is to be run. The
1228 specification is a repetition, and as  a default Bacula is set to run a job at
1229 the beginning of the  hour of every hour of every day of every week of every
1230 month  of every year. This is not normally what you want, so you  must specify
1231 or limit when you want the job to run. Any  specification given is assumed to
1232 be repetitive in nature and  will serve to override or limit the default
1233 repetition. This  is done by specifying masks or times for the hour, day of the
1234 month, day of the week, week of the month, week of the year,  and month when
1235 you want the job to run. By specifying one or  more of the above, you can
1236 define a schedule to repeat at  almost any frequency you want.  
1237
1238 Basically, you must supply a {\bf month}, {\bf day}, {\bf hour}, and  {\bf
1239 minute} the Job is to be run. Of these four items to be specified,  {\bf day}
1240 is special in that you may either specify a day of the month  such as 1, 2,
1241 ... 31, or you may specify a day of the week such  as Monday, Tuesday, ...
1242 Sunday. Finally, you may also specify a  week qualifier to restrict the
1243 schedule to the first, second, third,  fourth, or fifth week of the month.  
1244
1245 For example, if you specify only a day of the week, such as {\bf Tuesday}  the
1246 Job will be run every hour of every Tuesday of every Month. That  is the {\bf
1247 month} and {\bf hour} remain set to the defaults of  every month and all
1248 hours.  
1249
1250 Note, by default with no other specification, your job will run  at the
1251 beginning of every hour. If you wish your job to run more than  once in any
1252 given hour, you will need to specify multiple {\bf run}  specifications each
1253 with a different minute.  
1254
1255 The date/time to run the Job can be specified in the following way  in
1256 pseudo-BNF:  
1257
1258 \footnotesize
1259 \begin{verbatim}
1260 <void-keyword>    = on
1261 <at-keyword>      = at
1262 <week-keyword>    = 1st | 2nd | 3rd | 4th | 5th | first |
1263                     second | third | forth | fifth
1264 <wday-keyword>    = sun | mon | tue | wed | thu | fri | sat |
1265                     sunday | monday | tuesday | wednesday |
1266                     thursday | friday
1267 <week-of-year-keyword> = w00 | w01 | ... w52 | w53
1268 <month-keyword>   = jan | feb | mar | apr | may | jun | jul |
1269                     aug | sep | oct | nov | dec | january |
1270                     february | ... | december
1271 <daily-keyword>   = daily
1272 <weekly-keyword>  = weekly
1273 <monthly-keyword> = monthly
1274 <hourly-keyword>  = hourly
1275 <digit>           = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0
1276 <number>          = <digit> | <digit><number>
1277 <12hour>          = 0 | 1 | 2 | ... 12
1278 <hour>            = 0 | 1 | 2 | ... 23
1279 <minute>          = 0 | 1 | 2 | ... 59
1280 <day>             = 1 | 2 | ... 31
1281 <time>            = <hour>:<minute> |
1282                     <12hour>:<minute>am |
1283                     <12hour>:<minute>pm
1284 <time-spec>       = <at-keyword> <time> |
1285                     <hourly-keyword>
1286 <date-keyword>    = <void-keyword>  <weekly-keyword>
1287 <day-range>       = <day>-<day>
1288 <month-range>     = <month-keyword>-<month-keyword>
1289 <wday-range>      = <wday-keyword>-<wday-keyword>
1290 <range>           = <day-range> | <month-range> |
1291                           <wday-range>
1292 <date>            = <date-keyword> | <day> | <range>
1293 <date-spec>       = <date> | <date-spec>
1294 <day-spec>        = <day> | <wday-keyword> |
1295                     <day-range> | <wday-range> |
1296                     <daily-keyword>
1297 <day-spec>        = <day> | <wday-keyword> |
1298                     <week-keyword> <wday-keyword>
1299 <month-spec>      = <month-keyword> | <month-range> |
1300                     <monthly-keyword>
1301 <date-time-spec>  = <month-spec> <day-spec> <time-spec>
1302 \end{verbatim}
1303 \normalsize
1304
1305 \end{description}
1306
1307 Note, the Week of Year specification wnn follows the ISO standard definition
1308 of the week of the year, where Week 1 is the week in which the first Thursday
1309 of the year occurs, or alternatively, the week which contains the 4th of
1310 January. Weeks are numbered w01 to w53. w00 for Bacula is the week that
1311 precedes the first ISO week (i.e. has the first few days of the year if any
1312 occur before Thursday). w00 is not defined by the ISO specification. A week
1313 starts with Monday and ends with Sunday. 
1314
1315 An example schedule resource that is named {\bf WeeklyCycle} and runs a job
1316 with level full each Sunday at 1:05am and an incremental job Monday through
1317 Saturday at 1:05am is: 
1318
1319 \footnotesize
1320 \begin{verbatim}
1321 Schedule {
1322   Name = "WeeklyCycle"
1323   Run = Level=Full sun at 1:05
1324   Run = Level=Incremental mon-sat at 1:05
1325 }
1326 \end{verbatim}
1327 \normalsize
1328
1329 An example of a possible monthly cycle is as follows: 
1330
1331 \footnotesize
1332 \begin{verbatim}
1333 Schedule {
1334   Name = "MonthlyCycle"
1335   Run = Level=Full Pool=Monthly 1st sun at 1:05
1336   Run = Level=Differential 2nd-5th sun at 1:05
1337   Run = Level=Incremental Pool=Daily mon-sat at 1:05
1338 }
1339 \end{verbatim}
1340 \normalsize
1341
1342 The first of every month: 
1343
1344 \footnotesize
1345 \begin{verbatim}
1346 Schedule {
1347   Name = "First"
1348   Run = Level=Full on 1 at 1:05
1349   Run = Level=Incremental on 2-31 at 1:05
1350 }
1351 \end{verbatim}
1352 \normalsize
1353
1354 Every 10 minutes: 
1355
1356 \footnotesize
1357 \begin{verbatim}
1358 Schedule {
1359   Name = "TenMinutes"
1360   Run = Level=Full hourly at 0:05
1361   Run = Level=Full hourly at 0:15
1362   Run = Level=Full hourly at 0:25
1363   Run = Level=Full hourly at 0:35
1364   Run = Level=Full hourly at 0:45
1365   Run = Level=Full hourly at 0:55
1366 }
1367 \end{verbatim}
1368 \normalsize
1369
1370 \subsection*{Technical Notes on Schedules}
1371 \index[general]{Schedules!Technical Notes on }
1372 \index[general]{Technical Notes on Schedules }
1373 \addcontentsline{toc}{subsection}{Technical Notes on Schedules}
1374
1375 Internally Bacula keeps a schedule as a bit mask. There are six masks and a
1376 minute field to each schedule. The masks are hour, day of the month (mday),
1377 month, day of the week (wday), week of the month (wom), and week of the year
1378 (woy). The schedule is initialized to have the bits of each of these masks
1379 set, which means that at the beginning of every hour, the job will run. When
1380 you specify a month for the first time, the mask will be cleared and the bit
1381 corresponding to your selected month will be selected. If you specify a second
1382 month, the bit corresponding to it will also be added to the mask. Thus when
1383 Bacula checks the masks to see if the bits are set corresponding to the
1384 current time, your job will run only in the two months you have set. Likewise,
1385 if you set a time (hour), the hour mask will be cleared, and the hour you
1386 specify will be set in the bit mask and the minutes will be stored in the
1387 minute field. 
1388
1389 For any schedule you have defined, you can see how these bits are set by doing
1390 a {\bf show schedules} command in the Console program. Please note that the
1391 bit mask is zero based, and Sunday is the first day of the week (bit zero). 
1392
1393 \input{fileset}
1394
1395 \subsection*{The Client Resource}
1396 \label{ClientResource2}
1397 \index[general]{Resource!Client }
1398 \index[general]{Client Resource }
1399 \addcontentsline{toc}{subsection}{Client Resource}
1400
1401 The Client resource defines the attributes of the Clients that are served by
1402 this Director; that is the machines that are to be backed up. You will need
1403 one Client resource definition for each machine to be backed up. 
1404
1405 \begin{description}
1406
1407 \item [Client (or FileDaemon)]
1408    \index[dir]{Client (or FileDaemon) }
1409    Start of the Client directives.  
1410
1411 \item [Name = \lt{}name\gt{}]
1412    \index[dir]{Name  }
1413    The client name which will be used in the  Job resource directive or in the
1414 console run command.  This directive is required.  
1415
1416 \item [Address = \lt{}address\gt{}]
1417    \index[dir]{Address  }
1418    Where the address is a host  name, a fully qualified domain name, or a network
1419 address in  dotted quad notation for a Bacula File server daemon.  This
1420 directive is required. 
1421
1422 \item [FD Port = \lt{}port-number\gt{}]
1423    \index[dir]{FD Port  }
1424    Where the port is a port  number at which the Bacula File server daemon can be
1425 contacted.  The default is 9102. 
1426
1427 \item [Catalog = \lt{}Catalog-resource-name\gt{}]
1428    \index[dir]{Catalog  }
1429    This specifies the  name of the catalog resource to be used for this Client. 
1430 This directive is required.  
1431
1432 \item [Password = \lt{}password\gt{}]
1433    \index[dir]{Password  }
1434    This is the password to be  used when establishing a connection with the File
1435 services, so  the Client configuration file on the machine to be backed up
1436 must  have the same password defined for this Director. This directive is 
1437 required.  If you have either {\bf /dev/random}  {\bf bc} on your machine,
1438 Bacula will generate a random  password during the configuration process,
1439 otherwise it will  be left blank. 
1440 \label{FileRetention}
1441
1442 \item [File Retention = \lt{}time-period-specification\gt{}]
1443    \index[dir]{File Retention  }
1444    The File Retention directive defines the length of time that  Bacula will keep
1445 File records in the Catalog database.  When this time period expires, and if
1446 {\bf AutoPrune} is set to  {\bf yes} Bacula will prune (remove) File records
1447 that  are older than the specified File Retention period. Note, this  affects
1448 only records in the catalog database. It does not  affect your archive
1449 backups.  
1450
1451 File records  may actually be retained for a shorter period than you specify
1452 on  this directive if you specify either a shorter {\bf Job Retention}  or a
1453 shorter {\bf Volume Retention} period. The shortest  retention period of the
1454 three takes precedence.  The time may be expressed in seconds, minutes, 
1455 hours, days, weeks, months, quarters, or years. See the 
1456 \ilink{ Configuration chapter}{Time} of this  manual for
1457 additional details of time specification. 
1458
1459 The  default is 60 days. 
1460 \label{JobRetention}
1461
1462 \item [Job Retention = \lt{}time-period-specification\gt{}]
1463    \index[dir]{Job Retention  }
1464    The Job Retention directive defines the length of time that  Bacula will keep
1465 Job records in the Catalog database.  When this time period expires, and if
1466 {\bf AutoPrune} is set to  {\bf yes} Bacula will prune (remove) Job records
1467 that are  older than the specified File Retention period. As with the other 
1468 retention periods, this affects only records in the catalog and  not data in
1469 your archive backup.  
1470
1471 If a Job  record is selected for pruning, all associated File and JobMedia 
1472 records will also be pruned regardless of the File Retention  period set. As a
1473 consequence, you normally will set the File  retention period to be less than
1474 the Job retention period. The  Job retention period can actually be less than
1475 the value you  specify here if you set the {\bf Volume Retention} directive in
1476 the  Pool resource to a smaller duration. This is because the Job  retention
1477 period and the Volume retention period are  independently applied, so the
1478 smaller of the two takes  precedence.  
1479
1480 The Job retention period is specified as seconds,  minutes, hours, days,
1481 weeks, months,  quarters, or years.  See the 
1482 \ilink{ Configuration chapter}{Time} of this manual for
1483 additional details of  time specification.  
1484
1485 The default is 180 days.  
1486 \label{AutoPrune}
1487
1488 \item [AutoPrune = \lt{}yes|no\gt{}]
1489    \index[dir]{AutoPrune  }
1490    If AutoPrune is set to  {\bf yes} (default), Bacula (version 1.20 or greater)
1491 will  automatically apply the File retention period and the Job  retention
1492 period for the Client at the end of the Job.  If you set {\bf AutoPrune = no},
1493 pruning will not be done,  and your Catalog will grow in size each time you
1494 run a Job.  Pruning affects only information in the catalog and not data 
1495 stored in the backup archives (on Volumes).  
1496
1497 \item [Maximum Concurrent Jobs = \lt{}number\gt{}]
1498    \index[dir]{Maximum Concurrent Jobs  }
1499    where \lt{}number\gt{}  is the maximum number of Jobs with the current Client
1500 that  can run concurrently. Note, this directive limits only Jobs  for Clients
1501 with the same name as the resource in which it appears. Any  other
1502 restrictions on the maximum concurrent jobs such as in  the Director, Job, or
1503 Storage resources will also apply in addition to  any limit specified here.
1504 The  default is set to 1, but you may set it to a larger number.  We strongly
1505 recommend that you read the WARNING documented under  
1506 \ilink{ Maximum Concurrent Jobs}{DirMaxConJobs} in the Director's
1507 resource.  
1508
1509 \item [*Priority = \lt{}number\gt{}]
1510    \index[dir]{*Priority  }
1511    The number specifies the  priority of this client relative to other clients
1512 that the  Director is processing simultaneously. The priority can range  from
1513 1 to 1000. The clients are ordered such that the smaller  number priorities
1514 are performed first (not currently  implemented). 
1515 \end{description}
1516
1517 The following is an example of a valid Client resource definition: 
1518
1519 \footnotesize
1520 \begin{verbatim}
1521 Client {
1522   Name = Minimatou
1523   Address = minimatou
1524   Catalog = MySQL
1525   Password = very_good
1526 }
1527 \end{verbatim}
1528 \normalsize
1529
1530 \subsection*{The Storage Resource}
1531 \label{StorageResource2}
1532 \index[general]{Resource!Storage }
1533 \index[general]{Storage Resource }
1534 \addcontentsline{toc}{subsection}{Storage Resource}
1535
1536 The Storage resource defines which Storage daemons are available for use by
1537 the Director. 
1538
1539 \begin{description}
1540
1541 \item [Storage]
1542    \index[dir]{Storage }
1543    Start of the Storage resources. At least one  storage resource must be
1544 specified. 
1545
1546 \item [Name = \lt{}name\gt{}]
1547    \index[dir]{Name  }
1548    The name of the storage resource. This  name appears on the Storage directive
1549 specified in the Job directive and  is required. 
1550
1551 \item [Address = \lt{}address\gt{}]
1552    \index[dir]{Address  }
1553    Where the address is a host name,  a {\bf fully qualified domain name}, or an
1554 {\bf IP address}. Please note  that the \lt{}address\gt{} as specified here
1555 will be transmitted to  the File daemon who will then use it to contact the
1556 Storage daemon. Hence,  it is {\bf not}, a good idea to use {\bf localhost} as
1557 the  name but rather a fully qualified machine name or an IP address.  This
1558 directive is required. 
1559
1560 \item [SD Port = \lt{}port\gt{}]
1561    \index[dir]{SD Port  }
1562    Where port is the port to use to  contact the storage daemon for information
1563 and to start jobs.  This same port number must appear in the Storage resource
1564 of the  Storage daemon's configuration file. The default is 9103. 
1565
1566 \item [Password = \lt{}password\gt{}]
1567    \index[dir]{Password  }
1568    This is the password to be used  when establishing a connection with the
1569 Storage services. This  same password also must appear in the Director
1570 resource of the Storage  daemon's configuration file. This directive is
1571 required.  If you have either {\bf /dev/random}  {\bf bc} on your machine,
1572 Bacula will generate a random  password during the configuration process,
1573 otherwise it will  be left blank. 
1574
1575 \item [Device = \lt{}device-name\gt{}]
1576    \index[dir]{Device  }
1577    This directive specifies the name  of the device to be used for the
1578 storage. This name is not the  physical device name, but the logical device
1579 name as defined on the  {\bf Name} directive contained in the {\bf Device}
1580 resource  definition of the {\bf Storage daemon} configuration file.  You can
1581 specify any name you would like (even the device name if  you prefer) up to a
1582 maximum of 127 characters in length.  The physical device name associated with
1583 this device is specified in  the {\bf Storage daemon} configuration file (as
1584 {\bf Archive  Device}). Please take care not to define two different  Storage
1585 resource directives in the Director that point to the  same Device in the
1586 Storage daemon. Doing so may cause the  Storage daemon to block (or hang)
1587 attempting to open the  same device that is already open. This directive is
1588 required. 
1589
1590 \item [Media Type = \lt{}MediaType\gt{}]
1591    \index[dir]{Media Type  }
1592    This directive specifies the  Media Type to be used to store the data. This is
1593 an arbitrary  string of characters up to 127 maximum that you define. It can 
1594 be anything you want. However, it is best to  make it descriptive of the
1595 storage media (e.g. File, DAT, ''HP  DLT8000``, 8mm, ...). In addition, it is
1596 essential that you  make the {\bf Media Type} specification unique for each
1597 storage  media type. If you have two DDS-4 drives that have incompatible 
1598 formats, or if you have a DDS-4 drive and a DDS-4 autochanger,  you almost
1599 certainly should specify different {\bf Media Types}.  During a restore,
1600 assuming a {\bf DDS-4} Media Type is associated  with the Job, Bacula can
1601 decide to use any Storage  daemon that support Media Type {\bf DDS-4} and on
1602 any drive that supports it. If you want to tie Bacula to using a single Storage 
1603 daemon or drive, you must specify a unique Media Type for that drive.  This is
1604 an important point that should be carefully understood. You  can find more on
1605 this subject in the 
1606 \ilink{Basic Volume Management}{_ChapterStart39} chapter of this
1607 manual.  
1608
1609 The {\bf MediaType} specified here, {\bf must}  correspond to the {\bf Media
1610 Type} specified in the {\bf Device}  resource of the {\bf Storage daemon}
1611 configuration file.  This directive is required, and it is used by the
1612 Director and the  Storage daemon to ensure that a Volume automatically
1613 selected from  the Pool corresponds to the physical device. If a Storage
1614 daemon  handles multiple devices (e.g. will write to various file Volumes  on
1615 different partitions), this directive allows you to specify exactly  which
1616 device.  
1617
1618 As mentioned above, the value specified in the Director's Storage  resource
1619 must agree with the value specified in the Device resource in  the {\bf
1620 Storage daemon's} configuration file. It is also an  additional check so  that
1621 you don't try to write data for a DLT onto an 8mm device. 
1622
1623 \label{Autochanger1}
1624 \item [Autochanger = \lt{}yes|no\gt{}]  
1625    \index[dir]{Autochanger  }
1626    If you specify {\bf yes}  for this command (the default is {\bf no}), when you
1627 use the {\bf label}  command or the {\bf add} command to create a new Volume,
1628 {\bf Bacula}  will also request the Autochanger Slot number. This simplifies 
1629 creating database entries for Volumes in an autochanger. If you forget  to
1630 specify the Slot, the autochanger will not be used. However, you  may modify
1631 the Slot associated with a Volume at any time  by using the {\bf update
1632 volume} command in the console program.  When {\bf autochanger} is enabled,
1633 the algorithm used by  Bacula to search for available volumes will be modified
1634 to  consider only Volumes that are known to be in the autochanger's  magazine.
1635 If no {\bf in changer} volume is found, Bacula will  attempt recycling,
1636 pruning, ..., and if still no volume is found,  Bacula will search for any
1637 volume whether or not in the magazine.  By privileging in changer volumes,
1638 this procedure minimizes  operator intervention.  The default is {\bf no}.  
1639
1640 For the autochanger to be  used, you must also specify {\bf Autochanger = yes}
1641 in the  
1642 \ilink{Device Resource}{Autochanger}  in the Storage daemon's
1643 configuration file as well as other  important Storage daemon configuration
1644 information.  Please consult the 
1645 \ilink{Using Autochangers}{_ChapterStart18} manual of this
1646 chapter for the details of  using autochangers. 
1647
1648 \item [Maximum Concurrent Jobs = \lt{}number\gt{}]
1649    \index[dir]{Maximum Concurrent Jobs  }
1650    where \lt{}number\gt{}  is the maximum number of Jobs with the current Storage
1651 resource that  can run concurrently. Note, this directive limits only Jobs 
1652 for Jobs using this Storage daemon. Any  other restrictions on the maximum
1653 concurrent jobs such as in  the Director, Job, or Client resources will also
1654 apply in addition to  any limit specified here. The  default is set to 1, but
1655 you may set it to a larger number.  We strongly recommend that you read the
1656 WARNING documented under  
1657 \ilink{ Maximum Concurrent Jobs}{DirMaxConJobs} in the Director's
1658 resource.  
1659
1660 While it is possible to set the Director's, Job's, or Client's  maximum
1661 concurrent jobs greater than one, you should take great  care in setting the
1662 Storage daemon's greater than one. By keeping  this directive set to one, you
1663 will avoid having two jobs simultaneously  write to the same Volume. Although
1664 this is supported, it is not  currently recommended.  
1665 \end{description}
1666
1667 The following is an example of a valid Storage resource definition: 
1668
1669 \footnotesize
1670 \begin{verbatim}
1671 # Definition of tape storage device
1672 Storage {
1673   Name = DLTDrive
1674   Address = lpmatou
1675   Password = storage_password # password for Storage daemon
1676   Device = "HP DLT 80"    # same as Device in Storage daemon
1677   Media Type = DLT8000    # same as MediaType in Storage daemon
1678 }
1679 \end{verbatim}
1680 \normalsize
1681
1682 \subsection*{The Pool Resource}
1683 \label{PoolResource}
1684 \index[general]{Resource!Pool }
1685 \index[general]{Pool Resource }
1686 \addcontentsline{toc}{subsection}{Pool Resource}
1687
1688 The Pool resource defines the set of storage Volumes (tapes or files) to be
1689 used by Bacula to write the data. By configuring different Pools, you can
1690 determine which set of Volumes (media) receives the backup data. This permits,
1691 for example, to store all full backup data on one set of Volumes and all
1692 incremental backups on another set of Volumes. Alternatively, you could assign
1693 a different set of Volumes to each machine that you backup. This is most
1694 easily done by defining multiple Pools. 
1695
1696 Another important aspect of a Pool is that it contains the default attributes
1697 (Maximum Jobs, Retention Period, Recycle flag, ...) that will be given to a
1698 Volume when it is created. This avoids the need for you to answer a large
1699 number of questions when labeling a new Volume. Each of these attributes can
1700 later be changed on a Volume by Volume basis using the {\bf update} command in
1701 the console program. Note that you must explicitly specify which Pool Bacula
1702 is to use with each Job. Bacula will not automatically search for the correct
1703 Pool. 
1704
1705 Most often in Bacula installations all backups for all machines (Clients) go
1706 to a single set of Volumes. In this case, you will probably only use the {\bf
1707 Default} Pool. If your backup strategy calls for you to mount a different tape
1708 each day, you will probably want to define a separate Pool for each day. For
1709 more information on this subject, please see the 
1710 \ilink{Backup Strategies}{_ChapterStart3} chapter of this
1711 manual. 
1712
1713 To use a Pool, there are three distinct steps. First the Pool must be defined
1714 in the Director's configuration file. Then the Pool must be written to the
1715 Catalog database. This is done automatically by the Director each time that it
1716 starts, or alternatively can be done using the {\bf create} command in the
1717 console program. Finally, if you change the Pool definition in the Director's
1718 configuration file and restart Bacula, the pool will be updated alternatively
1719 you can use the {\bf update pool} console command to refresh the database
1720 image. It is this database image rather than the Director's resource image
1721 that is used for the default Volume attributes. Note, for the pool to be
1722 automatically created or updated, it must be explicitly referenced by a Job
1723 resource. 
1724
1725 Next the physical media must be labeled. The labeling can either be done with
1726 the {\bf label} command in the {\bf console} program or using the {\bf btape}
1727 program. The preferred method is to use the {\bf label} command in the {\bf
1728 console} program. 
1729
1730 Finally, you must add Volume names (and their attributes) to the Pool. For
1731 Volumes to be used by Bacula they must be of the same {\bf Media Type} as the
1732 archive device specified for the job (i.e. if you are going to back up to a
1733 DLT device, the Pool must have DLT volumes defined since 8mm volumes cannot be
1734 mounted on a DLT drive). The {\bf Media Type} has particular importance if you
1735 are backing up to files. When running a Job, you must explicitly specify which
1736 Pool to use. Bacula will then automatically select the next Volume to use from
1737 the Pool, but it will ensure that the {\bf Media Type} of any Volume selected
1738 from the Pool is identical to that required by the Storage resource you have
1739 specified for the Job. 
1740
1741 If you use the {\bf label} command in the console program to label the
1742 Volumes, they will automatically be added to the Pool, so this last step is
1743 not normally required. 
1744
1745 It is also possible to add Volumes to the database without explicitly labeling
1746 the physical volume. This is done with the {\bf add} console command. 
1747
1748 As previously mentioned, each time Bacula starts, it scans all the Pools
1749 associated with each Catalog, and if the database record does not already
1750 exist, it will be created from the Pool Resource definition. {\bf Bacula}
1751 probably should do an {\bf update pool} if you change the Pool definition, but
1752 currently, you must do this manually using the {\bf update pool} command in
1753 the Console program. 
1754
1755 The Pool Resource defined in the Director's configuration file
1756 (bacula-dir.conf) may contain the following directives: 
1757
1758 \begin{description}
1759
1760 \item [Pool]
1761    \index[dir]{Pool }
1762    Start of the Pool resource. There must  be at least one Pool resource defined.
1763
1764
1765 \item [Name = \lt{}name\gt{}]
1766    \index[dir]{Name  }
1767    The name of the pool.  For most applications, you will use the default pool 
1768 name {\bf Default}. This directive is required.  
1769
1770 \item [Number of Volumes = \lt{}number\gt{}]
1771    \index[dir]{Number of Volumes  }
1772    This directive specifies  the number of volumes (tapes or files) contained in
1773 the pool.  Normally, it is defined and updated automatically by the  Bacula
1774 catalog handling routines. 
1775 \label{MaxVolumes}
1776
1777 \item [Maximum Volumes = \lt{}number\gt{}]
1778    \index[dir]{Maximum Volumes  }
1779    This directive specifies the  maximum number of volumes (tapes or files)
1780 contained in the pool.  This directive is optional, if omitted or set to zero,
1781 any number  of volumes will be permitted. In general, this directive is useful
1782 for Autochangers where there is a fixed number of Volumes, or  for File
1783 storage where you wish to ensure that the backups made to  disk files do not
1784 become too numerous or consume too much space.  
1785
1786 \item [Pool Type = \lt{}type\gt{}]
1787    \index[dir]{Pool Type  }
1788    This directive defines the pool  type, which corresponds to the type of Job
1789 being run. It is  required and may be one of the following:  
1790
1791 \begin{itemize}
1792 \item [Backup]  
1793 \item [*Archive]  
1794 \item [*Cloned]  
1795 \item [*Migration]  
1796 \item [*Copy]  
1797 \item [*Save]  
1798    \end{itemize}
1799
1800 \item [Use Volume Once = \lt{}yes|no\gt{}]
1801    \index[dir]{Use Volume Once  }
1802    This directive  if set to {\bf yes} specifies that each volume is to be  used
1803 only once. This is most useful when the Media is a  file and you want a new
1804 file for each backup that is  done. The default is {\bf no} (i.e. use volume
1805 any  number of times). This directive will most likely be phased out 
1806 (deprecated), so you are recommended to use {\bf Maximum Volume Jobs = 1} 
1807 instead.  
1808
1809 Please note that the value defined by this directive in the  bacula-dir.conf
1810 file is the default value used when a Volume  is created. Once the volume is
1811 created, changing the value  in the bacula-dir.conf file will not change what
1812 is stored  for the Volume. To change the value for an existing Volume  you
1813 must use the {\bf update} command in the Console.  
1814
1815 \item [Maximum Volume Jobs = \lt{}positive-integer\gt{}]
1816    \index[dir]{Maximum Volume Jobs  }
1817    This directive specifies  the maximum number of Jobs that can be written to
1818 the Volume. If  you specify zero (the default), there is no limit. Otherwise, 
1819 when the number of Jobs backed up to the Volume equals {\bf positive-integer} 
1820 the Volume will be marked {\bf Used}. When the Volume is marked  {\bf Used} it
1821 can no longer be used for appending Jobs, much like  the {\bf Full} status but
1822 it can be recycled if recycling is enabled.  By setting {\bf
1823 MaximumVolumeJobs} to one, you get the same  effect as setting {\bf
1824 UseVolumeOnce = yes}.  
1825
1826 Please note that the value defined by this directive in the  bacula-dir.conf
1827 file is the default value used when a Volume  is created. Once the volume is
1828 created, changing the value  in the bacula-dir.conf file will not change what
1829 is stored  for the Volume. To change the value for an existing Volume  you
1830 must use the {\bf update} command in the Console.  
1831
1832 \item [Maximum Volume Files = \lt{}positive-integer\gt{}]
1833    \index[dir]{Maximum Volume Files  }
1834    This directive specifies  the maximum number of files that can be written to
1835 the Volume. If  you specify zero (the default), there is no limit. Otherwise, 
1836 when the number of files written to the Volume equals {\bf positive-integer} 
1837 the Volume will be marked {\bf Used}. When the Volume is marked  {\bf Used} it
1838 can no longer be used for appending Jobs, much like  the {\bf Full} status but
1839 it can be recycled if recycling is enabled.  This value is checked and the
1840 {\bf Used} status is set only  at the end of a job that writes to the
1841 particular volume.  
1842
1843 Please note that the value defined by this directive in the  bacula-dir.conf
1844 file is the default value used when a Volume  is created. Once the volume is
1845 created, changing the value  in the bacula-dir.conf file will not change what
1846 is stored  for the Volume. To change the value for an existing Volume  you
1847 must use the {\bf update} command in the Console.  
1848
1849 \item [Maximum Volume Bytes = \lt{}size\gt{}]
1850    \index[dir]{Maximum Volume Bytes  }
1851    This directive specifies  the maximum number of bytes that can be written to
1852 the Volume. If  you specify zero (the default), there is no limit except the 
1853 physical size of the Volume. Otherwise,  when the number of bytes written to
1854 the Volume equals {\bf size}  the Volume will be marked {\bf Used}. When the
1855 Volume is marked  {\bf Used} it can no longer be used for appending Jobs, much
1856 like  the {\bf Full} status but it can be recycled if recycling is enabled. 
1857 This value is checked and the {\bf Used} status set while  the job is writing
1858 to the particular volume.  
1859
1860 Please note that the value defined by this directive in the  bacula-dir.conf
1861 file is the default value used when a Volume  is created. Once the volume is
1862 created, changing the value  in the bacula-dir.conf file will not change what
1863 is stored  for the Volume. To change the value for an existing Volume  you
1864 must use the {\bf update} command in the Console.  
1865
1866 \item [Volume Use Duration = \lt{}time-period-specification\gt{}]
1867    \index[dir]{Volume Use Duration  }
1868    The Volume Use Duration directive defines the time period that  the Volume can
1869    be written beginning from the time of first data  write to the Volume. If the
1870    time-period specified is zero (the  default), the Volume can be written
1871    indefinitely. Otherwise,  when the time period from the first write to the
1872    volume (the  first Job written) exceeds the time-period-specification, the 
1873    Volume will be marked {\bf Used}, which means that no more  Jobs can be
1874    appended to the Volume, but it may be recycled if  recycling is enabled.  
1875    
1876    You might use this directive, for example, if you have a Volume  used for
1877    Incremental backups, and Volumes used for Weekly Full  backups. Once the Full
1878    backup is done, you will want to use a  different Incremental Volume. This can
1879    be accomplished by setting  the Volume Use Duration for the Incremental Volume
1880    to six days.  I.e. it will be used for the 6 days following a Full save, then 
1881    a different Incremental volume will be used. Be careful about setting the 
1882    duration to short periods such as 23 hours, or you might experience problems
1883    of Bacula waiting for a tape over the weekend only to complete the backups
1884    Monday morning when an operator mounts a new tape.
1885    
1886    The use duration is checked and the {\bf Used} status is set only  at the end of a
1887    job that writes to the particular volume, which  means that even though the
1888    use duration may have expired, the  catalog entry will not be updated until
1889    the next job that  uses this volume is run.  
1890    
1891    Please note that the value defined by this directive in the  bacula-dir.conf
1892    file is the default value used when a Volume  is created. Once the volume is
1893    created, changing the value  in the bacula-dir.conf file will not change what
1894    is stored  for the Volume. To change the value for an existing Volume  you
1895    must use the 
1896    \ilink{\bf update volume}{UpdateCommand} command in the Console.  
1897
1898 \item [Catalog Files = \lt{}yes|no\gt{}]
1899    \index[dir]{Catalog Files  }
1900    This directive  defines whether or not you want the names of the files  that
1901    were saved to be put into the catalog. The default  is {\bf yes}. The
1902    advantage of specifying {\bf Catalog Files = No}  is that you will have a
1903    significantly smaller Catalog database. The  disadvantage is that you will not
1904    be able to produce a Catalog listing  of the files backed up for each Job
1905    (this is often called Browsing).  Also, without the File entries in the
1906    catalog, you will not be  able to use the Console {\bf restore} command nor
1907    any other  command that references File entries.  
1908    
1909 \label{PoolAutoPrune}
1910 \item [AutoPrune = \lt{}yes|no\gt{}]
1911    \index[dir]{AutoPrune  }
1912    If AutoPrune is set to  {\bf yes} (default), Bacula (version 1.20 or greater)
1913    will  automatically apply the Volume Retention period when new Volume  is
1914    needed and no appendable Volumes exist in the Pool. Volume  pruning causes
1915    expired Jobs (older than the {\bf Volume  Retention} period) to be deleted
1916    from the Catalog and permits  possible recycling of the Volume.  
1917    
1918 \label{VolRetention}
1919 \item [Volume Retention = \lt{}time-period-specification\gt{}]
1920    \index[dir]{Volume Retention  }
1921    The  Volume Retention directive defines the length of time that {\bf Bacula} 
1922    will keep Job records associated with the Volume in the Catalog  database.
1923    When this time period expires, and if {\bf AutoPrune}  is set to {\bf yes}
1924    Bacula will prune (remove) Job  records that are older than the specified
1925    Volume Retention period.  All File records associated with pruned Jobs are
1926    also pruned.  The time may be specified as seconds,  minutes, hours, days,
1927    weeks, months, quarters, or years.  The {\bf Volume Retention} applied
1928    independently to the  {\bf Job Retention} and the {\bf File Retention} periods
1929    defined in the Client resource. This means that the shorter  period is the
1930    one that applies. Note, that when the  {\bf Volume Retention} period has been
1931    reached, it will  prune both the Job and the File records.  
1932    
1933    The default is 365 days. Note, this directive sets the default  value for each
1934    Volume entry in the Catalog when the Volume is  created. The value in the 
1935    catalog may be later individually changed for each Volume using  the Console
1936    program.  
1937    
1938    By defining multiple Pools with different Volume Retention periods,  you may
1939    effectively have a set of tapes that is recycled weekly,  another Pool of
1940    tapes that is recycled monthly and so on. However,  one must keep in mind that
1941    if your {\bf Volume Retention} period  is too short, it may prune the last
1942    valid Full backup, and hence  until the next Full backup is done, you will not
1943    have a complete  backup of your system, and in addition, the next Incremental 
1944    or Differential backup will be promoted to a Full backup. As  a consequence,
1945    the minimum {\bf Volume Retention} period should be at  twice the interval of
1946    your Full backups. This means that if you  do a Full backup once a month, the
1947    minimum Volume retention  period should be two months.  
1948    
1949    Please note that the value defined by this directive in the  bacula-dir.conf
1950    file is the default value used when a Volume  is created. Once the volume is
1951    created, changing the value  in the bacula-dir.conf file will not change what
1952    is stored  for the Volume. To change the value for an existing Volume  you
1953    must use the {\bf update} command in the Console.
1954    
1955 \label{PoolRecycle}
1956 \item [Recycle = \lt{}yes|no\gt{}]
1957    \index[dir]{Recycle  }
1958    This directive specifies the  default for recycling Purged Volumes. If it is
1959 set to {\bf yes}  and Bacula needs a volume but finds none that are 
1960 appendable, it will search for Purged Volumes (i.e. volumes  with all the Jobs
1961 and Files expired and thus deleted from  the Catalog). If the Volume is
1962 recycled, all previous data  written to that Volume will be overwritten.  
1963
1964 Please note that the value defined by this directive in the  bacula-dir.conf
1965 file is the default value used when a Volume  is created. Once the volume is
1966 created, changing the value  in the bacula-dir.conf file will not change what
1967 is stored  for the Volume. To change the value for an existing Volume  you
1968 must use the {\bf update} command in the Console.  
1969 \label{RecycleOldest}
1970
1971 \item [Recycle Oldest Volume = \lt{}yes|no\gt{}]
1972    \index[dir]{Recycle Oldest Volume  }
1973    This directive instructs the Director to search for the oldest used Volume
1974 in the Pool when another Volume is requested by the Storage daemon and none
1975 are available.  The catalog is then {\bf pruned} respecting the retention
1976 periods of all Files and Jobs written to this Volume.  If all Jobs are
1977 pruned (i.e.  the volume is Purged), then the Volume is recycled and will
1978 be used as the next Volume to be written.  This directive respects any Job,
1979 File, or Volume retention periods that you may have specified, and as such
1980 it is {\bf much} better to use this directive than the Purge Oldest Volume.
1981
1982 This directive can be useful if you have a fixed number of Volumes in the
1983 Pool and you want to cycle through them and you have specified the correct
1984 retention periods.  
1985 However, if you use this directive and have only one
1986 Volume in the Pool, you will immediately recycle your Volume if you fill
1987 it and Bacula needs another one. Thus your backup will be totally invalid.
1988 Please use this directive with care.
1989
1990 \label{RecycleCurrent}
1991
1992 \item [Recycle Current Volume = \lt{}yes|no\gt{}]
1993    \index[dir]{Recycle Current Volume  }
1994    If  Bacula needs a new Volume, this directive instructs Bacula  to Prune the
1995 volume respecting the Job and File  retention periods.  If all Jobs are pruned
1996 (i.e. the volume is Purged), then  the Volume is recycled and will be used as
1997 the next  Volume to be written. This directive respects any Job,  File, or
1998 Volume retention periods that you may have specified,  and thus it is {\bf
1999 much} better to use it rather  than the Purge Oldest Volume directive.  
2000
2001 This directive can be useful if you have:  a fixed number of Volumes in the
2002 Pool, you want to  cycle through them, and you have specified  retention
2003 periods that prune Volumes before  you have cycled through the Volume in the
2004 Pool.  
2005 However, if you use this directive and have only one
2006 Volume in the Pool, you will immediately recycle your Volume if you fill
2007 it and Bacula needs another one. Thus your backup will be totally invalid.
2008 Please use this directive with care.
2009
2010 \label{PurgeOldest}
2011
2012 \item [Purge Oldest Volume = \lt{}yes|no\gt{}]
2013    \index[dir]{Purge Oldest Volume  }
2014    This directive  instructs the Director to search for the oldest used  Volume
2015 in the Pool when another Volume is requested by  the Storage daemon and none
2016 are available.  The catalog is then {\bf purged} irrespective of retention 
2017 periods of all Files and Jobs written to this Volume.  The Volume is then
2018 recycled and will be used as the next  Volume to be written. This directive
2019 overrides any Job,  File, or Volume retention periods that you may have
2020 specified.  
2021
2022 This directive can be useful if you have  a fixed number of Volumes in the
2023 Pool and you want to  cycle through them and reusing the oldest one when all
2024 Volumes are full, but you don't  want to worry about setting proper retention
2025 periods. However,  by using this option you risk losing valuable data.  
2026
2027 {\bf Please be aware that {\bf Purge Oldest Volume} disregards  all retention
2028 periods.} If you have only a single Volume  defined and you turn this variable
2029 on, that Volume will always  be immediately overwritten when it fills! So at a
2030 minimum,  ensure that you have a decent number of Volumes in your Pool  before
2031 running any jobs. If you want retention periods to apply  do not use this
2032 directive. To specify a retention period,  use the {\bf Volume Retention}
2033 directive (see above).  
2034
2035 We {\bf highly} recommend against using this directive, because it is sure that
2036 some day, Bacula will recycle a Volume that contains current data.
2037
2038 \item [Accept Any Volume = \lt{}yes|no\gt{}]
2039    \index[dir]{Accept Any Volume  }
2040    This directive  specifies whether or not any volume from the Pool may  be used
2041 for backup. The default is {\bf yes} as of version  1.27 and later. If it is
2042 {\bf no} then only the first  writable volume in the Pool will be accepted for
2043 writing backup  data, thus Bacula will fill each Volume sequentially  in turn
2044 before using any other appendable volume in the  Pool. If this is {\bf no} and
2045 you mount a volume out  of order, Bacula will not accept it. If this  is {\bf
2046 yes} any appendable volume from the pool  mounted will be accepted.  
2047
2048 If your tape backup procedure dictates that you manually  mount the next
2049 volume, you will almost certainly want to be  sure this directive is turned
2050 on.  
2051
2052 If you are going on vacation and you think the current volume  may not have
2053 enough room on it, you can simply label a new tape  and leave it in the drive,
2054 and assuming that {\bf Accept Any Volume}  is {\bf yes} Bacula will begin
2055 writing on it. When you return  from vacation, simply remount the last tape,
2056 and Bacula will  continue writing on it until it is full. Then you can remount
2057  your vacation tape and Bacula will fill it in turn.  
2058
2059 \item [Cleaning Prefix = \lt{}string\gt{}]
2060    \index[dir]{Cleaning Prefix  }
2061    This directive defines  a prefix string, which if it matches the beginning of 
2062 a Volume name during labeling of a Volume, the Volume  will be defined with
2063 the VolStatus set to {\bf Cleaning} and  thus Bacula will never attempt to use
2064 this tape. This  is primarily for use with autochangers that accept barcodes 
2065 where the convention is that barcodes beginning with {\bf CLN}  are treated as
2066 cleaning tapes.  
2067 \label{Label}
2068
2069 \item [Label Format = \lt{}format\gt{}]
2070    \index[dir]{Label Format  }
2071    This directive specifies the  format of the labels contained in this pool. The
2072 format directive  is used as a sort of template to create new Volume names
2073 during  automatic Volume labeling.  
2074
2075 The {\bf format} should be specified in double quotes, and  consists of
2076 letters, numbers and the special characters  hyphen ({\bf -}), underscore
2077 ({\bf \_}), colon ({\bf :}), and  period ({\bf .}), which are the legal
2078 characters for a Volume  name. The {\bf format} should be enclosed in  double
2079 quotes ('').  
2080
2081 In addition, the format may contain a number of variable expansion  characters
2082 which will be expanded by a complex algorithm allowing  you to create Volume
2083 names of many different formats. In all  cases, the expansion process must
2084 resolve to the set of characters  noted above that are legal Volume names.
2085 Generally, these  variable expansion characters begin with a dollar sign ({\bf
2086 \$})  or a left bracket ({\bf [}). If you specify variable expansion 
2087 characters, you should always enclose the format with double  quote characters
2088 ({\bf ``}). For more details on variable expansion,  please see the 
2089 \ilink{Variable Expansion}{_ChapterStart50} Chapter of  this manual.  
2090
2091 If no variable expansion characters are found in the string,  the Volume name
2092 will be formed from the {\bf format} string  appended with the number of
2093 volumes in the pool plus one, which  will be edited as four digits with
2094 leading zeros. For example,  with a {\bf Label Format = ''File-``}, the first
2095 volumes will be  named {\bf File-0001}, {\bf File-0002}, ...  
2096
2097 With the exception of Job specific variables, you can test  your {\bf
2098 LabelFormat} by using the 
2099 \ilink{ var command}{var} the Console Chapter of this manual.  
2100
2101 In almost all cases, you should enclose the format specification  (part after
2102 the equal sign) in double quotes.  Please note that this directive is
2103 deprecated and is replaced in version 1.37 and greater with a Python script
2104 for creating volume names.
2105
2106 \end{description}
2107
2108 In order for a Pool to be used during a Backup Job, the Pool must have at
2109 least one Volume associated with it. Volumes are created for a Pool using the
2110 {\bf label} or the {\bf add} commands in the {\bf Bacula Console}, program. In
2111 addition to adding Volumes to the Pool (i.e. putting the Volume names in the
2112 Catalog database), the physical Volume must be labeled with a valid Bacula
2113 software volume label before {\bf Bacula} will accept the Volume. This will be
2114 automatically done if you use the {\bf label} command. Bacula can
2115 automatically label Volumes if instructed to do so, but this feature is not
2116 yet fully implemented. 
2117
2118 The following is an example of a valid Pool resource definition: 
2119
2120 \footnotesize
2121 \begin{verbatim}
2122  
2123 Pool {
2124   Name = Default
2125   Pool Type = Backup
2126 }
2127 \end{verbatim}
2128 \normalsize
2129
2130 \subsection*{The Catalog Resource}
2131 \label{CatalogResource}
2132 \index[general]{Resource!Catalog }
2133 \index[general]{Catalog Resource }
2134 \addcontentsline{toc}{subsection}{Catalog Resource}
2135
2136 The Catalog Resource defines what catalog to use for the current job.
2137 Currently, Bacula can only handle a single database server (SQLite, MySQL, 
2138 PostgreSQL) that is defined when configuring {\bf Bacula}. However, there may be
2139 as many Catalogs (databases) defined as you wish. For example, you may want
2140 each Client to have its own Catalog database, or you may want backup jobs to
2141 use one database and verify or restore jobs to use another database. 
2142
2143 \begin{description}
2144
2145 \item [Catalog]
2146    \index[dir]{Catalog }
2147    Start of the Catalog resource.  At least one Catalog resource must be defined.
2148
2149
2150 \item [Name = \lt{}name\gt{}]
2151    \index[dir]{Name  }
2152    The name of the Catalog. No  necessary relation to the database server name.
2153 This name  will be specified in the Client resource directive indicating  that
2154 all catalog data for that Client is maintained in this  Catalog. This
2155 directive is required.  
2156
2157 \item [password = \lt{}password\gt{}]
2158    \index[dir]{password  }
2159    This specifies the password  to use when logging into the database. This
2160 directive is required.  
2161
2162 \item [DB Name = \lt{}name\gt{}]
2163    \index[dir]{DB Name  }
2164    This specifies the name of the  database. If you use multiple catalogs
2165 (databases), you specify  which one here. If you are using an external
2166 database server  rather than the internal one, you must specify a name that 
2167 is known to the server (i.e. you explicitly created the  Bacula tables using
2168 this name. This directive is  required. 
2169
2170 \item [user = \lt{}user\gt{}]
2171    \index[dir]{user  }
2172    This specifies what user name  to use to log into the database. This directive
2173 is required.  
2174
2175 \item [DB Socket = \lt{}socket-name\gt{}]
2176    \index[dir]{DB Socket  }
2177    This is the name of  a socket to use on the local host to connect to the
2178 database.  This directive is used only by MySQL and is ignored by  SQLite.
2179 Normally, if neither {\bf DB Socket} or {\bf DB Address}  are specified, MySQL
2180 will use the default socket.  
2181
2182 \item [DB Address = \lt{}address\gt{}]
2183    \index[dir]{DB Address  }
2184    This is the host address  of the database server. Normally, you would specify
2185 this instead  of {\bf DB Socket} if the database server is on another machine.
2186 In that case, you will also specify {\bf DB Port}. This directive  is used
2187 only by MySQL and is ignored by SQLite if provided.  This directive is
2188 optional.  
2189
2190 \item [DB Port = \lt{}port\gt{}]
2191    \index[dir]{DB Port  }
2192    This defines the port to  be used in conjunction with {\bf DB Address} to
2193 access the  database if it is on another machine. This directive is used  only
2194 by MySQL and is ignored by SQLite if provided. This  directive is optional.  
2195
2196 %% \item [Multiple Connections = \lt{}yes|no\gt{}]
2197 %% \index[dir]{Multiple Connections  }
2198 %% By default, this  directive is set to no. In that case, each job that uses the
2199 %% same Catalog will use a single connection to the catalog. It will  be shared,
2200 %% and Bacula will allow only one Job at a time to  communicate. If you set this
2201 %% directive to yes, Bacula will  permit multiple connections to the database,
2202 %% and the database  must be multi-thread capable. For SQLite and PostgreSQL,
2203 %% this is  no problem. For MySQL, you must be *very* careful to have the 
2204 %% multi-thread version of the client library loaded on your system.  When this
2205 %% directive is set yes, each Job will have a separate  connection to the
2206 %% database, and the database will control the  interaction between the different
2207 %% Jobs. This can significantly  speed up the database operations if you are
2208 %% running multiple  simultaneous jobs. In addition, for SQLite and PostgreSQL,
2209 %% Bacula  will automatically enable transactions. This can significantly  speed
2210 %% up insertion of attributes in the database either for  a single Job or
2211 %% multiple simultaneous Jobs.  
2212
2213 %% This directive has not been tested. Please test carefully  before running it
2214 %% in production and report back your results.  
2215
2216 \end{description}
2217
2218 The following is an example of a valid Catalog resource definition: 
2219
2220 \footnotesize
2221 \begin{verbatim}
2222 Catalog
2223 {
2224   Name = SQLite
2225   dbname = bacula;
2226   user = bacula;
2227   password = ""                       # no password = no security
2228 }
2229 \end{verbatim}
2230 \normalsize
2231
2232 or for a Catalog on another machine: 
2233
2234 \footnotesize
2235 \begin{verbatim}
2236 Catalog
2237 {
2238   Name = MySQL
2239   dbname = bacula
2240   user = bacula
2241   password = ""
2242   DB Address = remote.acme.com
2243   DB Port = 1234
2244 }
2245 \end{verbatim}
2246 \normalsize
2247
2248 \subsection*{The Messages Resource}
2249 \label{MessagesResource2}
2250 \index[general]{Resource!Messages }
2251 \index[general]{Messages Resource }
2252 \addcontentsline{toc}{subsection}{Messages Resource}
2253
2254 For the details of the Messages Resource, please see the 
2255 \ilink{Messages Resource Chapter}{_ChapterStart15} of this
2256 manual. 
2257
2258 \subsection*{The Console Resource}
2259 \label{ConsoleResource1}
2260 \index[general]{Console Resource }
2261 \index[general]{Resource!Console }
2262 \addcontentsline{toc}{subsection}{Console Resource}
2263
2264 As of Bacula version 1.33 and higher, there are three different kinds of
2265 consoles, which the administrator or user can use to interact with the
2266 Director. These three kinds of consoles comprise three different security
2267 levels. 
2268
2269 \begin{itemize}
2270 \item The first console type is an {\bf anonymous} or {\bf default}  console,
2271    which  has full privileges. There is no console resource necessary  for this
2272    type since the password is specified in the Director's  resource and
2273 consequently such consoles do not have a name as defined on a {\bf Name =}
2274 directive. This is the kind of  console that was initially implemented in
2275 versions prior to 1.33  and remains valid. Typically you would use it only for
2276  administrators.  
2277 \item The second type of console, and new to version 1.33 and  higher is a
2278    ''named`` console defined within  a Console resource in both the Director's
2279    configuration file and in  the Console's configuration file. Both the names
2280 and the passwords  in these two entries must match much as is the case for 
2281 Client programs.  
2282
2283 This second type of console begins with absolutely no  privileges except those
2284 explicitly specified in the Director's  Console resource. Thus you can have
2285 multiple Consoles with  different names and passwords, sort of like multiple
2286 users, each  with different privileges. As a  default, these consoles can do
2287 absolutely nothing -- no commands  whatsoever. You give them privileges or
2288 rather access  to commands and resources by specifying access  control lists
2289 in the Director's Console resource. The ACLs are  specified by a directive
2290 followed by a list of access names.  Examples of this are shown below.  
2291 \item The third type of console is similar to the above mentioned  one in that
2292    it requires a Console resource definition in both  the Director and the
2293    Console. In addition, if the console name,  provided on the {\bf Name =}
2294 directive, is the same as a Client  name, that console is permitted to use the
2295 {\bf SetIP}  command to change the Address directive in the  Director's client
2296 resource to the IP address of the Console. This  permits portables or other
2297 machines using DHCP (non-fixed IP addresses)  to ''notify`` the Director of
2298 their current IP address.  
2299 \end{itemize}
2300
2301 The Console resource is optional and need not be specified. The following
2302 directives are permited within the Director's configuration resource: 
2303
2304 \begin{description}
2305
2306 \item [Name = \lt{}name\gt{}]
2307    \index[dir]{Name  }
2308    The name of the console. This  name must match the name specified in the
2309 Console's configuration  resource (much as is the case with Client
2310 definitions).  
2311
2312 \item [Password = \lt{}password\gt{}]
2313    \index[dir]{Password  }
2314    Specifies the password that  must be supplied for a named Bacula Console to be
2315 authorized. The same  password must appear in the {\bf Console} resource of
2316 the Console  configuration file. For added security, the password is never 
2317 actually passed across the network but rather a challenge response  hash code
2318 created with the password. This directive is required.  If you have either
2319 {\bf /dev/random}  {\bf bc} on your machine, Bacula will generate a random 
2320 password during the configuration process, otherwise it will  be left blank. 
2321
2322 \item [JobACL = \lt{}name-list\gt{}]
2323    \index[dir]{JobACL  }
2324    This directive is used to  specify a list of Job resource names that can be
2325 accessed by  the console. Without this directive, the console cannot access 
2326 any of the Director's Job resources. Multiple Job resource names  may be
2327 specified by separating them with commas, and/or by specifying  multiple
2328 JobACL directives. For example, the directive  may be specified as:  
2329
2330 \footnotesize
2331 \begin{verbatim}
2332     JobACL = kernsave, "Backup client 1", "Backup client 2"
2333     JobACL = "RestoreFiles"
2334     
2335 \end{verbatim}
2336 \normalsize
2337
2338 With the above specification, the console can access the Director's  resources
2339 for the four jobs named on the JobACL directives,  but for no others.  
2340
2341 \item [ClientACL = \lt{}name-list\gt{}]
2342    \index[dir]{ClientACL  }
2343    This directive is used to  specify a list of Client resource names that can be
2344 accessed by  the console.  
2345
2346 \item [StorageACL = \lt{}name-list\gt{}]
2347    \index[dir]{StorageACL  }
2348    This directive is used to  specify a list of Storage resource names that can
2349 be accessed by  the console.  
2350
2351 \item [ScheduleACL = \lt{}name-list\gt{}]
2352    \index[dir]{ScheduleACL  }
2353    This directive is used to  specify a list of Schedule resource names that can
2354 be accessed by  the console.  
2355
2356 \item [PoolACL = \lt{}name-list\gt{}]
2357    \index[dir]{PoolACL  }
2358    This directive is used to  specify a list of Pool resource names that can be
2359 accessed by  the console.  
2360
2361 \item [FileSetACL = \lt{}name-list\gt{}]
2362    \index[dir]{FileSetACL  }
2363    This directive is used to  specify a list of FileSet resource names that can
2364 be accessed by  the console.  
2365
2366 \item [CatalogACL = \lt{}name-list\gt{}]
2367    \index[dir]{CatalogACL  }
2368    This directive is used to  specify a list of Catalog resource names that can
2369 be accessed by  the console.  
2370
2371 \item [CommandACL = \lt{}name-list\gt{}]
2372    \index[dir]{CommandACL  }
2373    This directive is used to  specify a list of of console commands that can be
2374 executed by  the console. 
2375 \end{description}
2376
2377 Aside from Director resource names and console command names, the special
2378 keyword {\bf *all*} can be specified in any of the above access control lists.
2379 When this keyword is present, any resource or command name (which ever is
2380 appropriate) will be accepted. For an example configuration file, please see
2381 the 
2382 \ilink{Console Configuration}{_ChapterStart36} chapter of this
2383 manual. 
2384
2385 \subsection*{The Counter Resource}
2386 \label{CounterResource}
2387 \index[general]{Resource!Counter }
2388 \index[general]{Counter Resource }
2389 \addcontentsline{toc}{subsection}{Counter Resource}
2390
2391 The Counter Resource defines a counter variable that can be accessed by
2392 variable expansion used for creating Volume labels with the {\bf LabelFormat}
2393 directive. See the 
2394 \ilink{LabelFormat}{Label} directive in this chapter for more
2395 details. 
2396
2397 \begin{description}
2398
2399 \item [Counter] 
2400    \index[dir]{Counter }
2401    Start of the Counter resource.  Counter directives are optional. 
2402
2403 \item [Name = \lt{}name\gt{}]
2404    \index[dir]{Name  }
2405    The name of the Counter.  This is the name you will use in the variable
2406 expansion  to reference the counter value.  
2407
2408 \item [Minimum = \lt{}integer\gt{}]
2409    \index[dir]{Minimum  }
2410    This specifies the minimum  value that the counter can have. It also becomes
2411 the default.  If not supplied, zero is assumed.  
2412
2413 \item [Maximum = \lt{}integer\gt{}]
2414    \index[dir]{Maximum  }
2415    This is the maximum value  value that the counter can have. If not specified
2416 or set to  zero, the counter can have a maximum value of 2,147,483,648  (2 to
2417 the 31 power). When the counter is incremented past  this value, it is reset
2418 to the Minimum.  
2419
2420 \item [*WrapCounter = \lt{}counter-name\gt{}]
2421    \index[dir]{*WrapCounter  }
2422    If this value  is specified, when the counter is incremented past the maximum 
2423 and thus reset to the minimum, the counter specified on the  {\bf WrapCounter}
2424 is incremented. (This is not currently  implemented). 
2425
2426 \item [Catalog = \lt{}catalog-name\gt{}]
2427    \index[dir]{Catalog  }
2428    If this directive is  specified, the counter and its values will be saved in 
2429 the specified catalog. If this directive is not present, the  counter will be
2430 redefined each time that Bacula is started. 
2431 \end{description}
2432
2433 \subsection*{Example Director Configuration File}
2434 \label{SampleDirectorConfiguration}
2435 \index[general]{File!Example Director Configuration }
2436 \index[general]{Example Director Configuration File }
2437 \addcontentsline{toc}{subsection}{Example Director Configuration File}
2438
2439 An example Director configuration file might be the following: 
2440
2441 \footnotesize
2442 \begin{verbatim}
2443 #
2444 # Default Bacula Director Configuration file
2445 #
2446 #  The only thing that MUST be changed is to add one or more
2447 #   file or directory names in the Include directive of the
2448 #   FileSet resource.
2449 #
2450 #  For Bacula release 1.15 (5 March 2002) -- redhat
2451 #
2452 #  You might also want to change the default email address
2453 #   from root to your address.  See the "mail" and "operator"
2454 #   directives in the Messages resource.
2455 #
2456 Director {                            # define myself
2457   Name = rufus-dir
2458   QueryFile = "/home/kern/bacula/bin/query.sql"
2459   WorkingDirectory = "/home/kern/bacula/bin/working"
2460   PidDirectory = "/home/kern/bacula/bin/working"
2461   Password = "XkSfzu/Cf/wX4L8Zh4G4/yhCbpLcz3YVdmVoQvU3EyF/"
2462 }
2463 # Define the backup Job
2464 Job {
2465   Name = "NightlySave"
2466   Type = Backup
2467   Level = Incremental                 # default
2468   Client=rufus-fd
2469   FileSet="Full Set"
2470   Schedule = "WeeklyCycle"
2471   Storage = DLTDrive
2472   Messages = Standard
2473   Pool = Default
2474 }
2475 Job {
2476   Name = "Restore"
2477   Type = Restore
2478   Client=rufus-fd
2479   FileSet="Full Set"
2480   Where = /tmp/bacula-restores
2481   Storage = DLTDrive
2482   Messages = Standard
2483   Pool = Default
2484 }
2485    
2486 # List of files to be backed up
2487 FileSet {
2488   Name = "Full Set"
2489   Include {
2490     Options { signature=SHA1 }
2491 #
2492 #  Put your list of files here, one per line or include an
2493 #    external list with:
2494 #
2495 #    @file-name
2496 #
2497 #  Note: / backs up everything
2498   File = /
2499   }
2500   Exclude { }
2501 }
2502 # When to do the backups
2503 Schedule {
2504   Name = "WeeklyCycle"
2505   Run = Full sun at 1:05
2506   Run = Incremental mon-sat at 1:05
2507 }
2508 # Client (File Services) to backup
2509 Client {
2510   Name = rufus-fd
2511   Address = rufus
2512   Catalog = MyCatalog
2513   Password = "MQk6lVinz4GG2hdIZk1dsKE/LxMZGo6znMHiD7t7vzF+"
2514   File Retention = 60d      # sixty day file retention
2515   Job Retention = 1y        # 1 year Job retention
2516   AutoPrune = yes           # Auto apply retention periods
2517 }
2518 # Definition of DLT tape storage device
2519 Storage {
2520   Name = DLTDrive
2521   Address = rufus
2522   Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
2523   Device = "HP DLT 80"      # same as Device in Storage daemon
2524   Media Type = DLT8000      # same as MediaType in Storage daemon
2525 }
2526 # Definition of DDS tape storage device
2527 Storage {
2528   Name = SDT-10000
2529   Address = rufus
2530   Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
2531   Device = SDT-10000        # same as Device in Storage daemon
2532   Media Type = DDS-4        # same as MediaType in Storage daemon
2533 }
2534 # Definition of 8mm tape storage device
2535 Storage {
2536   Name = "8mmDrive"
2537   Address = rufus
2538   Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
2539   Device = "Exabyte 8mm"
2540   MediaType = "8mm"
2541 }
2542 # Definition of file storage device
2543 Storage {
2544   Name = File
2545   Address = rufus
2546   Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
2547   Device = FileStorage
2548   Media Type = File
2549 }
2550 # Generic catalog service
2551 Catalog {
2552   Name = MyCatalog
2553   dbname = bacula; user = bacula; password = ""
2554 }
2555 # Reasonable message delivery -- send most everything to
2556 #   the email address and to the console
2557 Messages {
2558   Name = Standard
2559   mail = root@localhost = all, !skipped, !terminate
2560   operator = root@localhost = mount
2561   console = all, !skipped, !saved
2562 }
2563     
2564 # Default pool definition
2565 Pool {
2566   Name = Default
2567   Pool Type = Backup
2568   AutoPrune = yes
2569   Recycle = yes
2570 }
2571 #
2572 # Restricted console used by tray-monitor to get the status of the director
2573 #
2574 Console {
2575   Name = Monitor
2576   Password = "GN0uRo7PTUmlMbqrJ2Gr1p0fk0HQJTxwnFyE4WSST3MWZseR"
2577   CommandACL = status, .status
2578 }
2579 \end{verbatim}
2580 \normalsize