]> git.sur5r.net Git - bacula/docs/blob - docs/manuals/en/main/dirdconf.tex
Minor changes like typo, external references
[bacula/docs] / docs / manuals / en / main / dirdconf.tex
1 %%
2 %%
3
4 \chapter{Configuring the Director}
5 \label{DirectorChapter}
6 \index[general]{Director!Configuring the}
7 \index[general]{Configuring the Director}
8
9 Of all the configuration files needed to run {\bf Bacula}, the Director's is
10 the most complicated, and the one that you will need to modify the most often
11 as you add clients or modify the FileSets.
12
13 For a general discussion of configuration files and resources including the
14 data types recognized by {\bf Bacula}. Please see the
15 \ilink{Configuration}{ConfigureChapter} chapter of this manual.
16
17 \section{Director Resource Types}
18 \index[general]{Types!Director Resource}
19 \index[general]{Director Resource Types}
20
21 Director resource type may be one of the following:
22
23 Job, JobDefs, Client, Storage, Catalog, Schedule, FileSet, Pool, Director,  or
24 Messages. We present them here in the most logical order for defining them:
25
26 Note, everything revolves around a job and is tied to a job in one
27 way or another.
28
29 \begin{bsysitemize}
30 \item
31    \ilink{Director}{DirectorResource} -- to  define the Director's
32    name and its access password used for authenticating the Console program.
33    Only a single  Director resource definition may appear in the Director's
34    configuration file.  If you have either {\bf /dev/random} or  {\bf bc} on your
35    machine, Bacula will generate a random password during the configuration
36    process, otherwise it will  be left blank.
37 \item
38    \ilink{Job}{JobResource} -- to define the backup/restore Jobs
39    and to tie together the Client, FileSet and Schedule resources to  be used
40    for each Job. Normally, you will Jobs of different names corresponding
41    to each client (i.e. one Job per client, but a different one with a different name
42    for each client).
43 \item
44    \ilink{JobDefs}{JobDefsResource} -- optional resource for
45    providing defaults for Job resources.
46 \item
47    \ilink{Schedule}{ScheduleResource} -- to define when a Job is to
48    be automatically run by {\bf Bacula's} internal scheduler. You
49    may have any number of Schedules, but each job will reference only
50    one.
51 \item
52    \ilink{FileSet}{FileSetResource} -- to define the set of files
53    to be backed up for each Client. You may have any number of
54    FileSets but each Job will reference only one.
55 \item
56    \ilink{Client}{ClientResource2} -- to define what Client is to be
57    backed up. You will generally have multiple Client definitions. Each
58    Job will reference only a single client.
59 \item
60    \ilink{Storage}{StorageResource} -- to define on what physical
61    device the Volumes should be mounted. You may have one or
62    more Storage definitions.
63 \item
64    \ilink{Pool}{PoolResource} -- to define the pool of Volumes
65    that can be used for a particular Job. Most people use a
66    single default Pool.  However, if you have a large number
67    of clients or volumes, you may want to have multiple Pools.
68    Pools allow you to restrict a Job (or a Client) to use
69    only a particular set of Volumes.
70 \item
71    \ilink{Catalog}{CatalogResource} -- to define in what database to
72    keep the list of files and the Volume names where they are backed up.
73    Most people only use a single catalog.  However, if you want to
74    scale the Director to many clients, multiple catalogs can be helpful.
75    Multiple catalogs require a bit more management because in general
76    you must know what catalog contains what data.  Currently, all
77    Pools are defined in each catalog.  This restriction will be removed
78    in a later release.
79 \item
80    \ilink{Messages}{MessagesChapter} -- to define where error and
81    information messages are to be sent or logged. You may define
82    multiple different message resources and hence direct particular
83    classes of messages to different users or locations (files, \ldots{}).
84 \end{bsysitemize}
85
86 \label{DirectorResource}
87 \section{The Director Resource}
88 \index[general]{Director Resource}
89 \index[general]{Resource!Director}
90
91 The Director resource defines the attributes of the Directors running on the
92 network. In the current implementation, there is only a single Director
93 resource, but the final design will contain multiple Directors to maintain
94 index and media database redundancy.
95
96 \begin{description}
97
98 \item [Director]
99    \index[dir]{Director}
100    Start of the Director resource. One and only one  director resource must be
101 supplied.
102
103 \label{Director:Director:Name}
104 \item [Name = \lt{}name\gt{}]
105    \index[dir]{Name}
106    \index[dir]{Directive!Name}
107    The director name used by the system  administrator. This directive is
108 required.
109
110 \label{Director:Director:Description}
111 \item [Description = \lt{}text\gt{}]
112    \index[dir]{Description}
113    \index[dir]{Directive!Description}
114    The text field contains a  description of the Director that will be displayed
115 in the  graphical user interface. This directive is optional.
116
117 \label{Director:Director:Password}
118 \item [Password = \lt{}UA-password\gt{}]
119    \index[dir]{Password}
120    \index[dir]{Directive!Password}
121    Specifies the password that must be supplied for the default Bacula
122    Console to be authorized.  The same password must appear in the {\bf
123    Director} resource of the Console configuration file.  For added
124    security, the password is never passed across the network but instead a
125    challenge response hash code created with the password.  This directive
126    is required.  If you have either {\bf /dev/random} or {\bf bc} on your
127    machine, Bacula will generate a random password during the configuration
128    process, otherwise it will be left blank and you must manually supply
129    it.
130
131    The password is plain text.  It is not generated through any special
132    process but as noted above, it is better to use random text for
133    security reasons.
134
135    \label{Director:Director:Messages}
136 \item [Messages = \lt{}Messages-resource-name\gt{}]
137    \index[dir]{Directive!Messages}
138    The messages resource  specifies where to deliver Director messages that are
139    not associated  with a specific Job. Most messages are specific to a job and
140    will  be directed to the Messages resource specified by the job. However,
141    there are a few messages that can occur when no job is running.  This
142    directive is required.
143
144    \label{Director:Director:WorkingDirectory}
145 \item [Working Directory = \lt{}Directory\gt{}]
146    \index[dir]{Working Directory}
147    \index[dir]{Directive!Working Directory}
148    This directive  is mandatory and specifies a directory in which the Director
149    may put its status files. This directory should be used only  by Bacula but
150    may be shared by other Bacula daemons. However, please note, if this
151    directory is shared with other Bacula daemons (the File daemon and Storage
152    daemon), you must ensure that the {\bf Name} given to each daemon is
153    unique so that the temporary filenames used do not collide.  By default
154    the Bacula configure process creates unique daemon names by postfixing them
155    with -dir, -fd, and -sd. Standard shell expansion of the {\bf
156    Directory}  is done when the configuration file is read so that values such
157    as {\bf \$HOME} will be properly expanded. This directive is required.
158    The working directory specified must already exist and be
159    readable and writable by the Bacula daemon referencing it.
160
161    If you have specified a Director user and/or a Director group on your
162    ./configure line with {\bf {-}{-}with-dir-user} and/or
163    {\bf {-}{-}with-dir-group} the Working Directory owner and group will
164    be set to those values.
165
166    \label{Director:Director:PidDirectory}
167 \item [Pid Directory = \lt{}Directory\gt{}]
168    \index[dir]{Pid Directory}
169    \index[dir]{Directive!Pid Directory}
170    This directive  is mandatory and specifies a directory in which the Director
171    may put its process Id file. The process Id file is used to  shutdown
172    Bacula and to prevent multiple copies of  Bacula from running simultaneously.
173    Standard shell expansion of the {\bf Directory}  is done when the
174    configuration file is read so that values such  as {\bf \$HOME} will be
175    properly expanded.
176
177    The PID directory specified must already exist and be
178    readable and writable by the Bacula daemon referencing it
179
180    Typically on Linux systems, you will set this to:  {\bf /var/run}. If you are
181    not installing Bacula in the  system directories, you can use the {\bf Working
182    Directory} as  defined above.  This directive is required.
183
184    \label{Director:Director:ScriptsDirectory}
185 \item [Scripts Directory = \lt{}Directory\gt{}]
186    \index[dir]{Scripts Directory}
187    \index[dir]{Directive!Scripts Directory}
188    This directive is optional and, if defined, specifies a directory in
189    which the Director will look for the Python startup script {\bf
190    DirStartup.py}.  This directory may be shared by other Bacula daemons.
191    Standard shell expansion of the directory is done when the configuration
192    file is read so that values such as {\bf \$HOME} will be properly
193    expanded.
194
195    \label{Director:Director:QueryFile}
196 \item [QueryFile = \lt{}Path\gt{}]
197    \index[dir]{QueryFile}
198    \index[dir]{Directive!QueryFile}
199    This directive is mandatory and specifies a directory and file in which
200    the Director can find the canned SQL statements for the {\bf Query}
201    command of the Console.  Standard shell expansion of the {\bf Path} is
202    done when the configuration file is read so that values such as {\bf
203    \$HOME} will be properly expanded.  This directive is required.
204
205    \label{Director:Director:HeartbeatInterval}
206 \item [Heartbeat Interval = \lt{}time-interval\gt{}]
207    \index[dir]{Heartbeat Interval}
208    \index[dir]{Directive!Heartbeat}
209    This directive is optional and if specified will cause the Director to
210    set a keepalive interval (heartbeat) in seconds on each of the sockets
211    it opens for the Client resource.  This value will override any
212    specified at the Director level.  It is implemented only on systems
213    (Linux, \ldots{}) that provide the {\bf setsockopt} TCP\_KEEPIDLE function.
214    The default value is zero, which means no change is made to the socket.
215
216 \label{DirMaxConJobs}
217
218    \label{Director:Director:MaximumConcurrentJobs}
219 \item [Maximum Concurrent Jobs = \lt{}number\gt{}]
220    \index[dir]{Maximum Concurrent Jobs}
221    \index[dir]{Directive!Maximum Concurrent Jobs}
222    \index[general]{Simultaneous Jobs}
223    \index[general]{Concurrent Jobs}
224    where \lt{}number\gt{}  is the maximum number of total Director Jobs that
225    should run  concurrently. The default is set to 1, but you may set it to a
226    larger number.
227
228    The Volume format becomes more complicated with
229    multiple simultaneous jobs, consequently, restores may take longer if
230    Bacula must sort through interleaved volume blocks from  multiple simultaneous
231    jobs. This can be avoided by having each simultaneous job write to
232    a different volume or  by using data spooling, which will first spool the data
233    to disk simultaneously, then write one spool file at a time to the volume
234    thus avoiding excessive interleaving of the different job blocks.
235
236    \label{Director:Director:FdConnectTimeout}
237 \item [FD Connect Timeout = \lt{}time\gt{}]
238    \index[dir]{FD Connect Timeout}
239    \index[dir]{Directive!FD Connect Timeout}
240    where {\bf time} is the time that the Director should continue
241    attempting to contact the File daemon to start a job, and after which
242    the Director will cancel the job.  The default is 30 minutes.
243
244    \label{Director:Director:SdConnectTimeout}
245 \item [SD Connect Timeout = \lt{}time\gt{}]
246    \index[dir]{SD Connect Timeout}
247    \index[dir]{Directive!SD Connect Timeout}
248    where {\bf time} is the time that the Director should continue
249    attempting to contact the Storage daemon to start a job, and after which
250    the Director will cancel the job.  The default is 30 minutes.
251
252    \label{Director:Director:DirAddresses}
253 \item [DirAddresses = \lt{}IP-address-specification\gt{}]
254    \index[dir]{DirAddresses}
255    \index[dir]{Address}
256    \index[general]{Address}
257    \index[dir]{Directive!DirAddresses}
258    Specify the ports and addresses on which the Director daemon will listen
259    for Bacula Console connections.  Probably the simplest way to explain
260    this is to show an example:
261
262 \footnotesize
263 \begin{lstlisting}
264  DirAddresses  = {
265     ip = { addr = 1.2.3.4; port = 1205;}
266     ipv4 = {
267         addr = 1.2.3.4; port = http;}
268     ipv6 = {
269         addr = 1.2.3.4;
270         port = 1205;
271     }
272     ip = {
273         addr = 1.2.3.4
274         port = 1205
275     }
276     ip = { addr = 1.2.3.4 }
277     ip = { addr = 201:220:222::2 }
278     ip = {
279         addr = bluedot.thun.net
280     }
281 }
282 \end{lstlisting}
283 \normalsize
284
285 where ip, ip4, ip6, addr, and port are all keywords. Note, that  the address
286 can be specified as either a dotted quadruple, or  IPv6 colon notation, or as
287 a symbolic name (only in the ip specification).  Also, port can be specified
288 as a number or as the mnemonic value from  the /etc/services file.  If a port
289 is not specified, the default will be used. If an ip  section is specified,
290 the resolution can be made either by IPv4 or  IPv6. If ip4 is specified, then
291 only IPv4 resolutions will be permitted,  and likewise with ip6.
292
293 Please note that if you use the DirAddresses directive, you must
294 not use either a DirPort or a DirAddress directive in the same
295 resource.
296
297    \label{Director:Director:DirPort}
298 \item [DirPort = \lt{}port-number\gt{}]
299    \index[dir]{DirPort}
300    \index[dir]{Directive!DirPort}
301    Specify the port (a positive  integer) on which the  Director daemon will
302    listen for Bacula Console connections.  This same port number must be
303    specified in the Director resource  of the Console configuration file. The
304    default is 9101, so  normally this directive need not be specified.  This
305    directive should not be used if you specify DirAddresses (N.B plural)
306    directive.
307
308    \label{Director:Director:DirAddress}
309 \item [DirAddress = \lt{}IP-Address\gt{}]
310    \index[dir]{DirAddress}
311    \index[dir]{Directive!DirAddress}
312    This directive is optional, but if it is specified, it will cause the
313    Director server (for the Console program) to bind to the specified {\bf
314      IP-Address}, which is either a domain name or an IP address specified as a
315    dotted quadruple in string or quoted string format.  If this directive is
316    not specified, the Director will bind to any available address (the
317    default).  Note, unlike the DirAddresses specification noted above, this
318    directive only permits a single address to be specified.  This directive
319    should not be used if you specify a DirAddresses (N.B. plural) directive.
320
321    \label{Director:Director:DirSourceAddress}
322 \item [DirSourceAddress = \lt{}IP-Address\gt{}]
323    \index[fd]{DirSourceAddress}
324    \index[fd]{Directive!DirSourceAddress}
325    This record is optional, and if it is specified, it will cause the Director
326    server (when initiating connections to a storage or file daemon) to source
327    its connections from the specified address.  Only a single IP address may be
328    specified.  If this record is not specified, the Director server will source
329    its outgoing connections according to the system routing table (the default).
330
331 \phantomsection
332 \label{Director:Director:StatisticsRetention}
333 \item[Statistics Retention = \lt{}time\gt{}]
334    \index[dir]{StatisticsRetention}
335    \label{PruneStatistics}
336    \index[dir]{Directive!StatisticsRetention}
337
338    The \texttt{Statistics Retention} directive defines the length of time that
339    Bacula will keep statistics job records in the Catalog database after the
340    Job End time. (In \texttt{JobHistory} table) When this time period expires,
341    and if user runs \texttt{prune stats} command, Bacula will prune (remove)
342    Job records that are older than the specified period.
343
344    Theses statistics records aren't use for restore purpose, but mainly for
345    capacity planning, billings, etc. See \ilink{Statistics chapter}{UseBaculaCatalogToExtractInformationChapter} for
346    additional information.
347
348    See the \ilink{ Configuration chapter}{Time} of this manual for additional
349    details of time specification.
350
351    The default is 5 years.
352
353   \label{Director:Director:VerId}
354 \item[VerId = \lt{}string\gt{}]
355   \index[dir]{Directive!VerId}
356   where  \lt{}string\gt{} is an identifier which can be used for support purpose.
357   This string is displayed using the \texttt{version} command.
358
359   \label{Director:Director:MaximumConsoleConnections}
360 \item[MaximumConsoleConnections = \lt{}number\gt{}]
361   \index[dir]{MaximumConsoleConnections}
362   \index[dir]{Directive!MaximumConsoleConnections}
363   \index[dir]{Console}
364    where \lt{}number\gt{}  is the maximum number of Console Connections that
365    could run  concurrently. The default is set to 20, but you may set it to a
366    larger number.
367
368 \label{Director:Director:MaximumReloadRequests}
369  \item[MaximumReloadRequests = \lt{}number\gt{}]
370 \index[dir]{MaximumReloadRequests}
371 \index[dir]{Directive!MaximumReloadRequests}
372 \index[dir]{Console}
373
374 Where \lt{}number\gt{} is the maximum number of \texttt{reload} command that
375 can be done while jobs are running. The default is set to 32 and is usually
376 sufficient.
377
378 \label{Director:Director:End}
379
380 %   \label{Director:SharedStorage}
381 %\item[SharedStorage = \lt{}yes\vb{}no\gt{}]
382 %   \index[dir]{SharedStorage}
383 %   \index[dir]{Directive!SharedStorage}
384 %
385 %   The \texttt{Shared Storage} directive is a Bacula Enterprise feature that
386 %   allows you to share volumes between different Storage resources. This
387 %   directive should be used \textbf{only} if all \texttt{Media Type} are
388 %   correctly set across all Devices.
389 %
390 %   The \texttt{Shared Storage} directive should be used when using the SAN
391 %   Shared Storage plugin or when accessing from the Director Storage resources
392 %   directly to Devices of an Autochanger.
393 %
394 %   When sharing volumes between different Storage resources, you will
395 %   need also to use the \texttt{reset-storageid} script before using the
396 %   \texttt{update slots} command. This script can be scheduled once a day in
397 %   an Admin job.
398 %
399 %\begin{lstlisting}
400 % $ /opt/bacula/scripts/reset-storageid MediaType StorageName
401 % $ bconsole
402 % * update slots storage=StorageName drive=0
403 %\end{lstlisting}
404 %
405 %   Please contact Bacula Systems support to get help on this advanced
406 %   configuration.
407
408 \end{description}
409
410 The following is an example of a valid Director resource definition:
411
412 \footnotesize
413 \begin{lstlisting}
414 Director {
415   Name = HeadMan
416   WorkingDirectory = "$HOME/bacula/bin/working"
417   Password = UA_password
418   PidDirectory = "$HOME/bacula/bin/working"
419   QueryFile = "$HOME/bacula/bin/query.sql"
420   Messages = Standard
421 }
422 \end{lstlisting} %% $
423 \normalsize
424
425 \label{JobResource}
426 \section{The Job Resource}
427 \index[general]{Resource!Job}
428 \index[general]{Job Resource}
429
430 The Job resource defines a Job (Backup, Restore, \ldots{}) that Bacula must
431 perform. Each Job resource definition contains the name of a Client and
432 a FileSet to backup, the Schedule for the Job, where the data
433 are to be stored, and what media Pool can be used. In effect, each Job
434 resource must specify What, Where, How, and When or FileSet, Storage,
435 Backup/Restore/Level, and Schedule respectively. Note, the FileSet must
436 be specified for a restore job for historical reasons, but it is no longer used.
437
438 Only a single type ({\bf Backup}, {\bf Restore}, \ldots{}) can be specified for any
439 job. If you want to backup multiple FileSets on the same Client or multiple
440 Clients, you must define a Job for each one.
441
442 Note, you define only a single Job to do the Full, Differential, and
443 Incremental backups since the different backup levels are tied together by
444 a unique Job name.  Normally, you will have only one Job per Client, but
445 if a client has a really huge number of files (more than several million),
446 you might want to split it into to Jobs each with a different FileSet
447 covering only part of the total files.
448
449 Multiple Storage daemons are not currently supported for Jobs, so if
450 you do want to use multiple storage daemons, you will need to create
451 a different Job and ensure that for each Job that the combination of
452 Client and FileSet are unique.  The Client and FileSet are what Bacula
453 uses to restore a client, so if there are multiple Jobs with the same
454 Client and FileSet or multiple Storage daemons that are used, the
455 restore will not work.  This problem can be resolved by defining multiple
456 FileSet definitions (the names must be different, but the contents of
457 the FileSets may be the same).
458
459
460 \begin{description}
461
462 \item [Job]
463    \index[dir]{Job}
464    \index[dir]{Directive!Job}
465    Start of the Job resource. At least one Job  resource is required.
466
467    \label{Director:Job:Name}
468 \item [Name = \lt{}name\gt{}]
469    \index[dir]{Name}
470    \index[dir]{Directive!Name}
471    The Job name. This name can be specified  on the {\bf Run} command in the
472    console program to start a job. If the  name contains spaces, it must be
473    specified between quotes. It is  generally a good idea to give your job the
474    same name as the Client  that it will backup. This permits easy
475    identification of jobs.
476
477    When the job actually runs, the unique Job Name will consist  of the name you
478    specify here followed by the date and time the  job was scheduled for
479    execution. This directive is required.
480
481   \label{Director:Job:Enabled}
482 \item [Enabled = \lt{}yes\vb{}no\gt{}]
483   \index[dir]{Enable}
484   \index[dir]{Directive!Enable}
485   This directive allows you to enable or disable automatic execution
486   via the scheduler of a Job.
487
488    \label{Director:Job:Type}
489 \item [Type = \lt{}job-type\gt{}]
490    \index[dir]{Type}
491    \index[dir]{Directive!Type}
492    The {\bf Type} directive specifies  the Job type, which may be one of the
493    following: {\bf Backup},  {\bf Restore}, {\bf Verify}, or {\bf Admin}. This
494    directive  is required. Within a particular Job Type, there are also Levels
495    as discussed in the next item.
496
497 \begin{description}
498
499 \item [Backup]
500    \index[dir]{Backup}
501    Run a backup Job. Normally you will  have at least one Backup job for each
502    client you want  to save. Normally, unless you turn off cataloging,  most all
503    the important statistics and data concerning  files backed up will be placed
504    in the catalog.
505
506 \item [Restore]
507    \index[dir]{Restore}
508    Run a restore Job.  Normally, you will specify only one Restore job
509    which acts as a sort of prototype that you will modify using the console
510    program in order to perform restores.  Although certain basic
511    information from a Restore job is saved in the catalog, it is very
512    minimal compared to the information stored for a Backup job -- for
513    example, no File database entries are generated since no Files are
514    saved.
515
516    {\bf Restore} jobs cannot be
517    automatically started by the scheduler as is the case for Backup, Verify
518    and Admin jobs. To restore files, you must use the {\bf restore} command
519    in the console.
520
521
522 \item [Verify]
523    \index[dir]{Verify}
524    Run a verify Job. In general, {\bf verify}  jobs permit you to compare the
525    contents of the catalog  to the file system, or to what was backed up. In
526    addition,  to verifying that a tape that was written can be read,  you can
527    also use {\bf verify} as a sort of tripwire  intrusion detection.
528
529 \item [Admin]
530    \index[dir]{Admin}
531    Run an admin Job. An {\bf Admin} job can  be used to periodically run catalog
532    pruning, if you  do not want to do it at the end of each {\bf Backup}  Job.
533    Although an Admin job is recorded in the  catalog, very little data is saved.
534 \end{description}
535 \label{Level}
536
537
538 \label{Director:Job:Level}
539 \item [Level = \lt{}job-level\gt{}]
540 \index[dir]{Level}
541 \index[dir]{Directive!Level}
542    The Level directive specifies the default Job level to be run.  Each
543    different Job Type (Backup, Restore, \ldots{}) has a different set of Levels
544    that can be specified.  The Level is normally overridden by a different
545    value that is specified in the {\bf Schedule} resource.  This directive
546    is not required, but must be specified either by a {\bf Level} directive
547    or as an override specified in the {\bf Schedule} resource.
548
549 For a {\bf Backup} Job, the Level may be one of the  following:
550
551 \begin{description}
552
553 \item [Full]
554 \index[dir]{Full}
555    When the Level is set to Full all files in the FileSet whether or not
556    they have changed will be backed up.
557
558 \item [Incremental]
559    \index[dir]{Incremental}
560    When the Level is set to Incremental all files specified in the FileSet
561    that have changed since the last successful backup of the the same Job
562    using the same FileSet and Client, will be backed up.  If the Director
563    cannot find a previous valid Full backup then the job will be upgraded
564    into a Full backup.  When the Director looks for a valid backup record
565    in the catalog database, it looks for a previous Job with:
566
567 \begin{bsysitemize}
568 \item The same Job name.
569 \item The same Client name.
570 \item The same FileSet (any change to the definition of  the FileSet such as
571    adding or deleting a file in the  Include or Exclude sections constitutes a
572    different FileSet.
573 \item The Job was a Full, Differential, or Incremental backup.
574 \item The Job terminated normally (i.e. did not fail or was not  canceled).
575 \item The Job started no longer ago than {\bf Max Full Interval}.
576 \end{bsysitemize}
577
578    If all the above conditions do not hold, the Director will upgrade  the
579    Incremental to a Full save. Otherwise, the Incremental  backup will be
580    performed as requested.
581
582    The File daemon (Client) decides which files to backup for an
583    Incremental backup by comparing start time of the prior Job (Full,
584    Differential, or Incremental) against the time each file was last
585    ``modified'' (st\_mtime) and the time its attributes were last
586    ``changed''(st\_ctime).  If the file was modified or its attributes
587    changed on or after this start time, it will then be backed up.
588
589    Some virus scanning software may change st\_ctime while
590    doing the scan.  For example, if the virus scanning program attempts to
591    reset the access time (st\_atime), which Bacula does not use, it will
592    cause st\_ctime to change and hence Bacula will backup the file during
593    an Incremental or Differential backup.  In the case of Sophos virus
594    scanning, you can prevent it from resetting the access time (st\_atime)
595    and hence changing st\_ctime by using the {\bf \lstinline:--:no-reset-atime}
596    option.  For other software, please see their manual.
597
598    When Bacula does an Incremental backup, all modified files that are
599    still on the system are backed up.  However, any file that has been
600    deleted since the last Full backup remains in the Bacula catalog,
601    which means that if between a Full save and the time you do a
602    restore, some files are deleted, those deleted files will also be
603    restored.  The deleted files will no longer appear in the catalog
604    after doing another Full save.
605
606    In addition, if you move a directory rather than copy it, the files in
607    it do not have their modification time (st\_mtime) or their attribute
608    change time (st\_ctime) changed.  As a consequence, those files will
609    probably not be backed up by an Incremental or Differential backup which
610    depend solely on these time stamps.  If you move a directory, and wish
611    it to be properly backed up, it is generally preferable to copy it, then
612    delete the original.
613
614    However, to manage deleted files or directories changes in the
615    catalog during an Incremental backup you can use \texttt{accurate}
616    mode. This is quite memory consuming process. See \ilink{Accurate
617      mode}{accuratemode} for more details.
618
619 \item [Differential]
620    \index[dir]{Differential}
621    When the Level is set to Differential
622    all files specified in the FileSet that have changed since the last
623    successful Full backup of the same Job will be backed up.
624    If the Director cannot find a
625    valid previous Full backup for the same Job, FileSet, and Client,
626    backup, then the Differential job will be upgraded into a Full backup.
627    When the Director looks for a valid Full backup record in the catalog
628    database, it looks for a previous Job with:
629
630 \begin{bsysitemize}
631 \item The same Job name.
632 \item The same Client name.
633 \item The same FileSet (any change to the definition of  the FileSet such as
634    adding or deleting a file in the  Include or Exclude sections constitutes a
635    different FileSet.
636 \item The Job was a FULL backup.
637 \item The Job terminated normally (i.e. did not fail or was not  canceled).
638 \item The Job started no longer ago than {\bf Max Full Interval}.
639 \end{bsysitemize}
640
641    If all the above conditions do not hold, the Director will  upgrade the
642    Differential to a Full save. Otherwise, the  Differential backup will be
643    performed as requested.
644
645    The File daemon (Client) decides which files to backup for a
646    differential backup by comparing the start time of the prior Full backup
647    Job against the time each file was last ``modified'' (st\_mtime) and the
648    time its attributes were last ``changed'' (st\_ctime).  If the file was
649    modified or its attributes were changed on or after this start time, it
650    will then be backed up.  The start time used is displayed after the {\bf
651    Since} on the Job report.  In rare cases, using the start time of the
652    prior backup may cause some files to be backed up twice, but it ensures
653    that no change is missed.  As with the Incremental option, you should
654    ensure that the clocks on your server and client are synchronized or as
655    close as possible to avoid the possibility of a file being skipped.
656    Note, on versions 1.33 or greater Bacula automatically makes the
657    necessary adjustments to the time between the server and the client so
658    that the times Bacula uses are synchronized.
659
660    When Bacula does a Differential backup, all modified files that are
661    still on the system are backed up.  However, any file that has been
662    deleted since the last Full backup remains in the Bacula catalog, which
663    means that if between a Full save and the time you do a restore, some
664    files are deleted, those deleted files will also be restored.  The
665    deleted files will no longer appear in the catalog after doing another
666    Full save.  However, to remove deleted files from the catalog during a
667    Differential backup is quite a time consuming process and not currently
668    implemented in Bacula.  It is, however, a planned future feature.
669
670    As noted above, if you move a directory rather than copy it, the
671    files in it do not have their modification time (st\_mtime) or
672    their attribute change time (st\_ctime) changed.  As a
673    consequence, those files will probably not be backed up by an
674    Incremental or Differential backup which depend solely on these
675    time stamps.  If you move a directory, and wish it to be
676    properly backed up, it is generally preferable to copy it, then
677    delete the original. Alternatively, you can move the directory, then
678    use the {\bf touch} program to update the timestamps.
679
680 %% TODO: merge this with incremental
681    However, to manage deleted files or directories changes in the
682    catalog during an Differential backup you can use \texttt{accurate}
683    mode. This is quite memory consuming process. See \ilink{Accurate
684      mode}{accuratemode} for more details.
685
686    Every once and a while, someone asks why we need Differential
687    backups as long as Incremental backups pickup all changed files.
688    There are possibly many answers to this question, but the one
689    that is the most important for me is that a Differential backup
690    effectively merges
691    all the Incremental and Differential backups since the last Full backup
692    into a single Differential backup.  This has two effects: 1.  It gives
693    some redundancy since the old backups could be used if the merged backup
694    cannot be read.  2.  More importantly, it reduces the number of Volumes
695    that are needed to do a restore effectively eliminating the need to read
696    all the volumes on which the preceding Incremental and Differential
697    backups since the last Full are done.
698
699 \end{description}
700
701 For a {\bf Restore} Job, no level needs to be specified.
702
703 For a {\bf Verify} Job, the Level may be one of the  following:
704
705 \begin{description}
706
707 \item [InitCatalog]
708 \index[dir]{InitCatalog}
709    does a scan of the specified {\bf FileSet} and stores the file
710    attributes in the Catalog database.  Since no file data is saved, you
711    might ask why you would want to do this.  It turns out to be a very
712    simple and easy way to have a {\bf Tripwire} like feature using {\bf
713    Bacula}.  In other words, it allows you to save the state of a set of
714    files defined by the {\bf FileSet} and later check to see if those files
715    have been modified or deleted and if any new files have been added.
716    This can be used to detect system intrusion.  Typically you would
717    specify a {\bf FileSet} that contains the set of system files that
718    should not change (e.g.  /sbin, /boot, /lib, /bin, \ldots{}).  Normally, you
719    run the {\bf InitCatalog} level verify one time when your system is
720    first setup, and then once again after each modification (upgrade) to
721    your system.  Thereafter, when your want to check the state of your
722    system files, you use a {\bf Verify} {\bf level = Catalog}.  This
723    compares the results of your {\bf InitCatalog} with the current state of
724    the files.
725
726 \item [Catalog]
727 \index[dir]{Catalog}
728    Compares the current state of the files against the state previously
729    saved during an {\bf InitCatalog}.  Any discrepancies are reported.  The
730    items reported are determined by the {\bf verify} options specified on
731    the {\bf Include} directive in the specified {\bf FileSet} (see the {\bf
732    FileSet} resource below for more details).  Typically this command will
733    be run once a day (or night) to check for any changes to your system
734    files.
735
736    Please note!  If you run two Verify Catalog jobs on the same client at
737    the same time, the results will certainly be incorrect.  This is because
738    Verify Catalog modifies the Catalog database while running in order to
739    track new files.
740
741 \item [VolumeToCatalog]
742 \index[dir]{VolumeToCatalog}
743    This level causes Bacula to read the file attribute data written to the
744    Volume from the last backup Job for the job specified on the {\bf VerifyJob}
745    directive.  The file attribute data are compared to the
746    values saved in the Catalog database and any differences are reported.
747    This is similar to the {\bf DiskToCatalog} level except that instead of
748    comparing the disk file attributes to the catalog database, the
749    attribute data written to the Volume is read and compared to the catalog
750    database.  Although the attribute data including the signatures (MD5 or
751    SHA1) are compared, the actual file data is not compared (it is not in
752    the catalog).
753
754    Please note!  If you run two Verify VolumeToCatalog jobs on the same
755    client at the same time, the results will certainly be incorrect.  This
756    is because the Verify VolumeToCatalog modifies the Catalog database
757    while running.
758
759 \item [DiskToCatalog]
760 \index[dir]{DiskToCatalog}
761    This level causes Bacula to read the files as they currently are on
762    disk, and to compare the current file attributes with the attributes
763    saved in the catalog from the last backup for the job specified on the
764    {\bf VerifyJob} directive.  This level differs from the {\bf VolumeToCatalog}
765    level described above by the fact that it doesn't compare against a
766    previous Verify job but against a previous backup.  When you run this
767    level, you must supply the verify options on your Include statements.
768    Those options determine what attribute fields are compared.
769
770    This command can be very useful if you have disk problems because it
771    will compare the current state of your disk against the last successful
772    backup, which may be several jobs.
773
774    Note, the current implementation (1.32c) does not identify files that
775    have been deleted.
776 \end{description}
777
778 \label{Director:Job:Accurate}
779 \item [Accurate = \lt{}yes\vb{}no\gt{}]
780 \index[dir]{Accurate}
781    In accurate mode, the File daemon knowns exactly which files were present
782    after the last backup. So it is able to handle deleted or renamed files.
783
784    When restoring a FileSet for a specified date (including ``most
785    recent''), Bacula is able to restore exactly the files and
786    directories that existed at the time of the last backup prior to
787    that date including ensuring that deleted files are actually deleted,
788    and renamed directories are restored properly.
789
790    In this mode, the File daemon must keep data concerning all files in
791    memory.  So If you do not have sufficient memory, the backup may
792    either be terribly slow or fail.
793
794 %%   $$ memory = \sum_{i=1}^{n}(strlen(path_i + file_i) + sizeof(CurFile))$$
795
796    For 500.000 files (a typical desktop linux system), it will require
797    approximately 64 Megabytes of RAM on your File daemon to hold the
798    required information.
799
800    \label{Director:Job:VerifyJob}
801 \item [Verify Job = \lt{}Job-Resource-Name\gt{}]
802    \index[dir]{Verify Job}
803    \index[dir]{Directive!Verify Job}
804    If you run a verify job without this directive, the last job run will be
805    compared with the catalog, which means that you must immediately follow
806    a backup by a verify command.  If you specify a {\bf Verify Job} Bacula
807    will find the last job with that name that ran.  This permits you to run
808    all your backups, then run Verify jobs on those that you wish to be
809    verified (most often a {\bf VolumeToCatalog}) so that the tape just
810    written is re-read.
811
812 \label{Director:Job:JobDefs}
813 \item [JobDefs = \lt{}JobDefs-Resource-Name\gt{}]
814 \index[dir]{JobDefs}
815 \index[dir]{Directive!JobDefs}
816    If a JobDefs-Resource-Name is specified, all the values contained in the
817    named JobDefs resource will be used as the defaults for the current Job.
818    Any value that you explicitly define in the current Job resource, will
819    override any defaults specified in the JobDefs resource.  The use of
820    this directive permits writing much more compact Job resources where the
821    bulk of the directives are defined in one or more JobDefs.  This is
822    particularly useful if you have many similar Jobs but with minor
823    variations such as different Clients.  A simple example of the use of
824    JobDefs is provided in the default bacula-dir.conf file.
825
826 \label{Director:Job:Bootstrap}
827 \item [Bootstrap = \lt{}bootstrap-file\gt{}]
828 \index[dir]{Bootstrap}
829 \index[dir]{Directive!Bootstrap}
830    The Bootstrap directive specifies a bootstrap file that, if provided,
831    will be used during {\bf Restore} Jobs and is ignored in other Job
832    types.  The {\bf bootstrap} file contains the list of tapes to be used
833    in a restore Job as well as which files are to be restored.
834    Specification of this directive is optional, and if specified, it is
835    used only for a restore job.  In addition, when running a Restore job
836    from the console, this value can be changed.
837
838    If you use the {\bf Restore} command in the Console program, to start a
839    restore job, the {\bf bootstrap} file will be created automatically from
840    the files you select to be restored.
841
842    For additional details of the {\bf bootstrap} file, please see
843    \ilink{Restoring Files with the Bootstrap File}{BootstrapChapter} chapter
844    of this manual.
845 \label{writebootstrap}
846
847 \label{Director:Job:WriteBootstrap}
848 \item [Write Bootstrap =  \lt{}bootstrap-file-specification\gt{}]
849 \index[dir]{Write Bootstrap}
850 \index[dir]{Directive!Write Bootstrap}
851    The {\bf writebootstrap} directive specifies a file name where Bacula
852    will write a {\bf bootstrap} file for each Backup job run.  This
853    directive applies only to Backup Jobs.  If the Backup job is a Full
854    save, Bacula will erase any current contents of the specified file
855    before writing the bootstrap records.  If the Job is an Incremental
856    or Differential
857    save, Bacula will append the current bootstrap record to the end of the
858    file.
859
860    Using this feature, permits you to constantly have a bootstrap file that
861    can recover the current state of your system.  Normally, the file
862    specified should be a mounted drive on another machine, so that if your
863    hard disk is lost, you will immediately have a bootstrap record
864    available.  Alternatively, you should copy the bootstrap file to another
865    machine after it is updated. Note, it is a good idea to write a separate
866    bootstrap file for each Job backed up including the job that backs up
867    your catalog database.
868
869    If the {\bf bootstrap-file-specification} begins with a vertical bar
870    (\lstinline+|+), Bacula will use the specification as the name of a program to which
871    it will pipe the bootstrap record.  It could for example be a shell
872    script that emails you the bootstrap record.
873
874    On versions 1.39.22 or greater, before opening the file or executing the
875    specified command, Bacula performs
876    \ilink{character substitution}{character substitution} like in RunScript
877    directive. To automatically manage your bootstrap files, you can use
878    this in your {\bf JobDefs} resources:
879 \begin{lstlisting}
880 JobDefs {
881    Write Bootstrap = "%c_%n.bsr"
882    ...
883 }
884 \end{lstlisting}
885
886    For more details on using this file, please see the chapter entitled
887    \ilink{The Bootstrap File}{BootstrapChapter} of this manual.
888
889 \label{Director:Job:Client}
890 \item [Client = \lt{}client-resource-name\gt{}]
891 \index[dir]{Client}
892 \index[dir]{Directive!Client}
893    The Client directive  specifies the Client (File daemon) that will be used in
894    the  current Job. Only a single Client may be specified in any one Job.  The
895    Client runs on the machine to be backed up,  and sends the requested files to
896    the Storage daemon for backup,  or receives them when restoring. For
897    additional details, see the
898    \ilink{Client Resource section}{ClientResource} of this chapter.
899    This directive is required.
900
901 \label{Director:Job:Fileset}
902 \item [FileSet = \lt{}FileSet-resource-name\gt{}]
903 \index[dir]{FileSet}
904 \index[dir]{Directive!FileSet}
905    The FileSet directive specifies the FileSet that will be used in the
906    current Job.  The FileSet specifies which directories (or files) are to
907    be backed up, and what options to use (e.g.  compression, \ldots{}).  Only a
908    single FileSet resource may be specified in any one Job.  For additional
909    details, see the \ilink{FileSet Resource section}{FileSetResource} of
910    this chapter.  This directive is required.
911
912 \label{Director:Job:Base}
913 \item [Base = \lt{}job-resource-name, \ldots{}\gt{}]
914 \index[dir]{Base}
915 \index[dir]{Directive!Base}
916 The Base directive permits to specify the list of jobs that will be used during
917 Full backup as base. This directive is optional. See the \ilink{Base Job
918 chapter}{basejobs} for more information.
919
920 \label{Director:Job:Messages}
921 \item [Messages = \lt{}messages-resource-name\gt{}]
922 \index[dir]{Messages}
923 \index[dir]{Directive!Messages}
924    The Messages directive defines what Messages resource should be used for
925    this job, and thus how and where the various messages are to be
926    delivered.  For example, you can direct some messages to a log file, and
927    others can be sent by email.  For additional details, see the
928    \ilink{Messages Resource}{MessagesChapter} Chapter of this manual.  This
929    directive is required.
930
931 \label{Director:Job:Pool}
932 \item [Pool = \lt{}pool-resource-name\gt{}]
933 \index[dir]{Pool}
934 \index[dir]{Directive!Pool}
935    The Pool directive defines the pool of Volumes where your data can be
936    backed up.  Many Bacula installations will use only the {\bf Default}
937    pool.  However, if you want to specify a different set of Volumes for
938    different Clients or different Jobs, you will probably want to use
939    Pools.  For additional details, see the \ilink{Pool Resource
940    section}{PoolResource} of this chapter.  This directive is required.
941
942 \label{Director:Job:FullBackupPool}
943 \item [Full Backup Pool = \lt{}pool-resource-name\gt{}]
944 \index[dir]{Full Backup Pool}
945 \index[dir]{Directive!Full Backup Pool}
946    The {\it Full Backup Pool} specifies a Pool to be used for Full backups.
947    It will override any Pool specification during a Full backup.  This
948    directive is optional.
949
950 \label{Director:Job:DifferentialBackupPool}
951 \item [Differential Backup Pool = \lt{}pool-resource-name\gt{}]
952 \index[dir]{Differential Backup Pool}
953 \index[dir]{Directive!Differential Backup Pool}
954    The {\it Differential Backup Pool} specifies a Pool to be used for
955    Differential backups.  It will override any Pool specification during a
956    Differential backup.  This directive is optional.
957
958 \label{Director:Job:IncrementalBackupPool}
959 \item [Incremental Backup Pool = \lt{}pool-resource-name\gt{}]
960 \index[dir]{Incremental Backup Pool}
961 \index[dir]{Directive!Incremental Backup Pool}
962    The {\it Incremental Backup Pool} specifies a Pool to be used for
963    Incremental backups.  It will override any Pool specification during an
964    Incremental backup.  This directive is optional.
965
966 \label{Director:Job:Schedule}
967 \item [Schedule = \lt{}schedule-name\gt{}]
968 \index[dir]{Schedule}
969 \index[dir]{Directive!Schedule}
970    The Schedule directive defines what schedule is to be used for the Job.
971    The schedule in turn determines when the Job will be automatically
972    started and what Job level (i.e.  Full, Incremental, \ldots{}) is to be run.
973    This directive is optional, and if left out, the Job can only be started
974    manually using the Console program.  Although you may specify only a
975    single Schedule resource for any one job, the Schedule resource may
976    contain multiple {\bf Run} directives, which allow you to run the Job at
977    many different times, and each {\bf run} directive permits overriding
978    the default Job Level Pool, Storage, and Messages resources.  This gives
979    considerable flexibility in what can be done with a single Job.  For
980    additional details, see the \ilink{Schedule Resource
981    Chapter}{ScheduleResource} of this manual.
982
983
984 \label{Director:Job:Storage}
985 \item [Storage = \lt{}storage-resource-name\gt{}]
986 \index[dir]{Storage}
987 \index[dir]{Directive!Storage}
988    The Storage directive defines the name of the storage services where you
989    want to backup the FileSet data.  For additional details, see the
990    \ilink{Storage Resource Chapter}{StorageResource} of this manual.
991    The Storage resource may also be specified in the Job's Pool resource,
992    in which case the value in the Pool resource overrides any value
993    in the Job. This Storage resource definition is not required by either
994    the Job resource or in the Pool, but it must be specified in
995    one or the other, if not an error will result.
996
997 \label{Director:Job:MaxStartDelay}
998 \item [Max Start Delay = \lt{}time\gt{}]
999 \index[dir]{Max Start Delay}
1000 \index[dir]{Directive!Max Start Delay}
1001    The time specifies the maximum delay between the scheduled time and the
1002    actual start time for the Job.  For example, a job can be scheduled to
1003    run at 1:00am, but because other jobs are running, it may wait to run.
1004    If the delay is set to 3600 (one hour) and the job has not begun to run
1005    by 2:00am, the job will be canceled.  This can be useful, for example,
1006    to prevent jobs from running during day time hours.  The default is 0
1007    which indicates no limit.
1008
1009 \label{Director:Job:MaxRunTime}
1010 \item [Max Run Time = \lt{}time\gt{}]
1011 \index[dir]{Max Run Time}
1012 \index[dir]{Directive!Max Run Time}
1013    The time specifies the maximum allowed time that a job may run, counted
1014    from when the job starts, ({\bf not} necessarily the same as when the
1015    job was scheduled).
1016
1017    By default, the the watchdog thread will kill any Job that has run more
1018    than 6 days.  The maximum watchdog timeout is independent of MaxRunTime
1019    and cannot be changed.
1020
1021
1022 \label{Director:Job:IncrementalWaitRunTime}
1023 \item [Incremental|Differential Max Wait Time = \lt{}time\gt{}]
1024 \index[dir]{Incremental Wait Run Time}
1025 \index[dir]{Differential Wait Run Time}
1026 \index[dir]{Directive!Differential Max Wait Time}
1027     Theses directives have been deprecated in favor of
1028     \texttt{Incremental|Differential Max Run Time} since bacula 2.3.18.
1029
1030 \label{Director:Job:IncrementalMaxRunTime}
1031 \item [Incremental Max Run Time = \lt{}time\gt{}]
1032 \index[dir]{Incremental Max Run Time}
1033 \index[dir]{Directive!Incremental Max Run Time}
1034 The time specifies the maximum allowed time that an Incremental backup job may
1035 run, counted from when the job starts, ({\bf not} necessarily the same as when
1036 the job was scheduled).
1037
1038 \label{Director:Job:DifferentialMaxRunTime}
1039 \item [Differential Max Wait Time = \lt{}time\gt{}]
1040 \index[dir]{Differential Max Run Time}
1041 \index[dir]{Directive!Differential Max Run Time}
1042 The time specifies the maximum allowed time that a Differential backup job may
1043 run, counted from when the job starts, ({\bf not} necessarily the same as when
1044 the job was scheduled).
1045
1046 \label{Director:Job:MaxRunSchedTime}
1047 \item [Max Run Sched Time = \lt{}time\gt{}]
1048 \index[dir]{Max Run Sched Time}
1049 \index[dir]{Directive!Max Run Sched Time}
1050
1051 The time specifies the maximum allowed time that a job may run, counted from
1052 when the job was scheduled. This can be useful to prevent jobs from running
1053 during working hours. We can see it like \texttt{Max Start Delay + Max Run
1054   Time}.
1055
1056 \label{Director:Job:MaxWaitTime}
1057 \item [Max Wait Time = \lt{}time\gt{}]
1058 \index[dir]{Max Wait Time}
1059 \index[dir]{Directive!Max Wait Time}
1060    The time specifies the maximum allowed time that a job may block waiting
1061    for a resource (such as waiting for a tape to be mounted, or waiting for
1062    the storage or file daemons to perform their duties), counted from the
1063    when the job starts, ({\bf not} necessarily the same as when the job was
1064    scheduled). This directive works as expected since bacula 2.3.18.
1065
1066 \bsysimageH{different_time}{Job time control directives}{fig:differenttime}
1067
1068 \label{Director:Job:MaximumBandwidth}
1069 \item [Maximum Bandwidth = \lt{}speed\gt{}]
1070 \index[dir]{Maximum Bandwidth}
1071 \index[dir]{Directive!Maximum Bandwidth}
1072
1073 The speed parameter specifies the maximum allowed bandwidth that a job may
1074 use. The speed parameter should be specified in k/s, kb/s, m/s or mb/s.
1075
1076 \label{Director:Job:MaxFullInterval}
1077 \item [Max Full Interval = \lt{}time\gt{}]
1078 \index[dir]{Max Full Interval}
1079 \index[dir]{Directive!Max Full Interval}
1080    The time specifies the maximum allowed age (counting from start time) of
1081    the most recent successful Full backup that is required in order to run
1082    Incremental or Differential backup jobs. If the most recent Full backup
1083    is older than this interval, Incremental and Differential backups will be
1084    upgraded to Full backups automatically. If this directive is not present,
1085    or specified as 0, then the age of the previous Full backup is not
1086    considered.
1087 \label{PreferMountedVolumes}
1088
1089 \label{Director:Job:PreferMountedVolumes}
1090 \item [Prefer Mounted Volumes = \lt{}yes\vb{}no\gt{}]
1091 \index[dir]{Prefer Mounted Volumes}
1092 \index[dir]{Directive!Prefer Mounted Volumes}
1093    If the Prefer Mounted Volumes directive is set to {\bf yes} (default
1094    yes), the Storage daemon is requested to select either an Autochanger or
1095    a drive with a valid Volume already mounted in preference to a drive
1096    that is not ready.  This means that all jobs will attempt to append
1097    to the same Volume (providing the Volume is appropriate -- right Pool,
1098    \ldots{} for that job), unless you are using multiple pools.
1099    If no drive with a suitable Volume is available, it
1100    will select the first available drive.  Note, any Volume that has
1101    been requested to be mounted, will be considered valid as a mounted
1102    volume by another job.  This if multiple jobs start at the same time
1103    and they all prefer mounted volumes, the first job will request the
1104    mount, and the other jobs will use the same volume.
1105
1106    If the directive is set to {\bf no}, the Storage daemon will prefer
1107    finding an unused drive, otherwise, each job started will append to the
1108    same Volume (assuming the Pool is the same for all jobs).  Setting
1109    Prefer Mounted Volumes to no can be useful for those sites
1110    with multiple drive autochangers that prefer to maximize backup
1111    throughput at the expense of using additional drives and Volumes.
1112    This means that the job will prefer to use an unused drive rather
1113    than use a drive that is already in use.
1114
1115    Despite the above, we recommend against setting this directive to
1116    {\bf no} since
1117    it tends to add a lot of swapping of Volumes between the different
1118    drives and can easily lead to deadlock situations in the Storage
1119    daemon. We will accept bug reports against it, but we cannot guarantee
1120    that we will be able to fix the problem in a reasonable time.
1121
1122    A better alternative for using multiple drives is to use multiple
1123    pools so that Bacula will be forced to mount Volumes from those Pools
1124    on different drives.
1125
1126 \label{Director:Job:PruneJobs}
1127 \item [Prune Jobs = \lt{}yes\vb{}no\gt{}]
1128 \index[dir]{Prune Jobs}
1129 \index[dir]{Directive!Prune Jobs}
1130    Normally, pruning of Jobs from the Catalog is specified on a Client by
1131    Client basis in the Client resource with the {\bf AutoPrune} directive.
1132    If this directive is specified (not normally) and the value is {\bf
1133    yes}, it will override the value specified in the Client resource.  The
1134    default is {\bf no}.
1135
1136
1137 \label{Director:Job:PruneFiles}
1138 \item [Prune Files = \lt{}yes\vb{}no\gt{}]
1139 \index[dir]{Prune Files}
1140 \index[dir]{Directive!Prune Files}
1141    Normally, pruning of Files from the Catalog is specified on a Client by
1142    Client basis in the Client resource with the {\bf AutoPrune} directive.
1143    If this directive is specified (not normally) and the value is {\bf
1144    yes}, it will override the value specified in the Client resource.  The
1145    default is {\bf no}.
1146
1147 \label{Director:Job:PruneVolumes}
1148 \item [Prune Volumes = \lt{}yes\vb{}no\gt{}]
1149 \index[dir]{Prune Volumes}
1150 \index[dir]{Directive!Prune Volumes}
1151    Normally, pruning of Volumes from the Catalog is specified on a Pool by
1152    Pool basis in the Pool resource with the {\bf AutoPrune} directive.
1153    Note, this is different from File and Job pruning which is done on a
1154    Client by Client basis.  If this directive is specified (not normally)
1155    and the value is {\bf yes}, it will override the value specified in the
1156    Pool resource.  The default is {\bf no}.
1157
1158    \label{Director:Job:Runscript}
1159 \item [RunScript \{\lt{}body-of-runscript\gt{}\}]
1160    \index[dir]{RunScript}
1161    \index[dir]{Directive!Run Script}
1162
1163    The RunScript directive behaves like a resource in that it
1164    requires opening and closing braces around a number of directives
1165    that make up the body of the runscript.
1166
1167    The specified {\bf Command} (see below for details) is run as an external
1168    program prior or after the current Job.  This is optional.  By default, the
1169    program is executed on the Client side like in \texttt{ClientRunXXXJob}.
1170
1171    \textbf{Console} options are special commands that are sent to the director instead
1172    of the OS. At this time, console command ouputs are redirected to log with
1173    the jobid 0.
1174
1175    You can use following console command : \texttt{delete}, \texttt{disable},
1176    \texttt{enable}, \texttt{estimate}, \texttt{list}, \texttt{llist},
1177    \texttt{memory}, \texttt{prune}, \texttt{purge}, \texttt{reload},
1178    \texttt{status}, \texttt{setdebug}, \texttt{show}, \texttt{time},
1179    \texttt{trace}, \texttt{update}, \texttt{version}, \texttt{.client},
1180    \texttt{.jobs}, \texttt{.pool}, \texttt{.storage}.  See console chapter for
1181    more information. You need to specify needed information on command line, nothing
1182    will be prompted. Example :
1183
1184 \begin{lstlisting}
1185    Console = "prune files client=%c"
1186    Console = "update stats age=3"
1187 \end{lstlisting}
1188
1189    You can specify more than one Command/Console option per RunScript.
1190
1191    You can use following options may be specified in the body
1192    of the runscript:\\
1193    \LTXtable{0.95\linewidth}{table_runscript}
1194
1195    Any output sent by the command to standard output will be included in the
1196    Bacula job report.  The command string must be a valid program name or name
1197    of a shell script.
1198
1199    In addition, the command string is parsed then fed to the OS,
1200    which means that the path will be searched to execute your specified
1201    command, but there is no shell interpretation, as a consequence, if you
1202    invoke complicated commands or want any shell features such as redirection
1203    or piping, you must call a shell script and do it inside that script.
1204
1205    Before submitting the specified command to the operating system, Bacula
1206    performs character substitution of the following characters:
1207 \label{character substitution}
1208
1209 \footnotesize
1210 \begin{lstlisting}
1211     %% = %
1212     %b = Job Bytes
1213     %c = Client's name
1214     %d = Daemon's name (Such as host-dir or host-fd)
1215     %D = Director's name (Also valid on file daemon)
1216     %e = Job Exit Status
1217     %f = Job FileSet (Only on director side)
1218     %F = Job Files
1219     %h = Client address
1220     %i = JobId
1221     %j = Unique Job id
1222     %l = Job Level
1223     %n = Job name
1224     %p = Pool name (Only on director side)
1225     %s = Since time
1226     %t = Job type (Backup, ...)
1227     %v = Volume name (Only on director side)
1228     %w = Storage name (Only on director side)
1229     %x = Spooling enabled? ("yes" or "no")
1230
1231 \end{lstlisting}
1232 \normalsize
1233
1234 Some character substitutions are not available in all situations. The Job Exit
1235 Status code \%e edits the following values:
1236
1237
1238 \index[dir]{Exit Status}
1239 \begin{bsysitemize}
1240 \item OK
1241 \item Error
1242 \item Fatal Error
1243 \item Canceled
1244 \item Differences
1245 \item Unknown term code
1246 \end{bsysitemize}
1247
1248    Thus if you edit it on a command line, you will need to enclose
1249    it within some sort of quotes.
1250
1251 \label{Director:Job:End}
1252
1253 You can use these following shortcuts:\\
1254
1255 \LTXtable{0.95\linewidth}{table_runscriptshortcuts}
1256 Examples:
1257 \begin{lstlisting}
1258 RunScript {
1259     RunsWhen = Before
1260     FailJobOnError = No
1261     Command = "/etc/init.d/apache stop"
1262 }
1263
1264 RunScript {
1265     RunsWhen = After
1266     RunsOnFailure = yes
1267     Command = "/etc/init.d/apache start"
1268 }
1269 \end{lstlisting}
1270
1271    {\bf Notes about ClientRunBeforeJob}
1272
1273    For compatibility reasons, with this shortcut, the command is executed
1274    directly when the client recieve it. And if the command is in error, other
1275    remote runscripts will be discarded. To be sure that all commands will be
1276    sent and executed, you have to use RunScript syntax.
1277
1278    {\bf Special Windows Considerations}
1279
1280    You can run scripts just after snapshots initializations with
1281    \textsl{AfterVSS} keyword.
1282
1283    In addition, for a Windows client, please take
1284    note that you must ensure a correct path to your script.  The script or
1285    program can be a .com, .exe or a .bat file.  If you just put the program
1286    name in then Bacula will search using the same rules that cmd.exe uses
1287    (current directory, Bacula bin directory, and PATH).  It will even try the
1288    different extensions in the same order as cmd.exe.
1289    The command can be anything that cmd.exe or command.com will recognize
1290    as an executable file.
1291
1292    However, if you have slashes in the program name then Bacula figures you
1293    are fully specifying the name, so you must also explicitly add the three
1294    character extension.
1295
1296    The command is run in a Win32 environment, so Unix like commands will not
1297    work unless you have installed and properly configured Cygwin in addition
1298    to and separately from Bacula.
1299
1300    The System \%Path\% will be searched for the command.  (under the
1301    environment variable dialog you have have both System Environment and
1302    User Environment, we believe that only the System environment will be
1303    available to bacula-fd, if it is running as a service.)
1304
1305    System environment variables can be referenced with \%var\% and
1306    used as either part of the command name or arguments.
1307
1308    So if you have a script in the Bacula\\bin directory then the following lines
1309    should work fine:
1310
1311 \footnotesize
1312 \begin{lstlisting}
1313         Client Run Before Job = systemstate
1314 or
1315         Client Run Before Job = systemstate.bat
1316 or
1317         Client Run Before Job = "systemstate"
1318 or
1319         Client Run Before Job = "systemstate.bat"
1320 or
1321         ClientRunBeforeJob = "\"C:/Program Files/Bacula/systemstate.bat\""
1322 \end{lstlisting}
1323 \normalsize
1324
1325 The outer set of quotes is removed when the configuration file is parsed.
1326 You need to escape the inner quotes so that they are there when the code
1327 that parses the command line for execution runs so it can tell what the
1328 program name is.
1329
1330
1331 \footnotesize
1332 \begin{lstlisting}
1333 ClientRunBeforeJob = "\"C:/Program Files/Software
1334      Vendor/Executable\" /arg1 /arg2 \"foo bar\""
1335 \end{lstlisting}
1336 \normalsize
1337
1338    The special characters
1339 \begin{lstlisting}
1340 &<>()@^|
1341 \end{lstlisting}
1342    will need to be quoted,
1343    if they are part of a filename or argument.
1344
1345    If someone is logged in, a blank ``command'' window running the commands
1346    will be present during the execution of the command.
1347
1348    Some Suggestions from Phil Stracchino for running on Win32 machines with
1349    the native Win32 File daemon:
1350
1351    \begin{enumerate}
1352    \item You might want the ClientRunBeforeJob directive to specify a .bat
1353       file which runs the actual client-side commands, rather than trying
1354       to run (for example) regedit /e directly.
1355    \item The batch file should explicitly 'exit 0' on successful completion.
1356    \item The path to the batch file should be specified in Unix form:
1357
1358       ClientRunBeforeJob = "c:/bacula/bin/systemstate.bat"
1359
1360    rather than DOS/Windows form:
1361
1362    ClientRunBeforeJob =
1363
1364 "c:\textbackslash{}bacula\textbackslash{}bin\textbackslash{}systemstate.bat"
1365    INCORRECT
1366    \end{enumerate}
1367
1368 For Win32, please note that there are certain limitations:
1369
1370 ClientRunBeforeJob = "C:/Program Files/Bacula/bin/pre-exec.bat"
1371
1372 Lines like the above do not work because there are limitations of
1373 cmd.exe that is used to execute the command.
1374 Bacula prefixes the string you supply with {\bf cmd.exe /c }.  To test that
1375 your command works you should type {\bf cmd /c "C:/Program Files/test.exe"} at a
1376 cmd prompt and see what happens.  Once the command is correct insert a
1377 backslash (\textbackslash{}) before each double quote ("), and
1378 then put quotes around the whole thing when putting it in
1379 the director's .conf file.  You either need to have only one set of quotes
1380 or else use the short name and don't put quotes around the command path.
1381
1382 Below is the output from cmd's help as it relates to the command line
1383 passed to the /c option.
1384
1385
1386  If /C or /K is specified, then the remainder of the command line after
1387  the switch is processed as a command line, where the following logic is
1388  used to process quote (") characters:
1389
1390 \begin{enumerate}
1391 \item
1392      If all of the following conditions are met, then quote characters
1393          on the command line are preserved:
1394     \begin{bsysitemize}
1395        \item no /S switch.
1396        \item exactly two quote characters.
1397        \item no special characters between the two quote characters,
1398            where special is one of:
1399 \begin{lstlisting}
1400 &<>()@^|
1401 \end{lstlisting}
1402        \item there are one or more whitespace characters between the
1403            the two quote characters.
1404        \item the string between the two quote characters is the name
1405            of an executable file.
1406     \end{bsysitemize}
1407
1408 \item  Otherwise, old behavior is to see if the first character is
1409          a quote character and if so, strip the leading character and
1410          remove the last quote character on the command line, preserving
1411          any text after the last quote character.
1412
1413 \end{enumerate}
1414
1415
1416 The following example of the use of the Client Run Before Job directive was
1417 submitted by a user:\\
1418 You could write a shell script to back up a DB2 database to a FIFO. The shell
1419 script is:
1420
1421 \footnotesize
1422 \begin{lstlisting}
1423  #!/bin/sh
1424  # ===== backupdb.sh
1425  DIR=/u01/mercuryd
1426
1427  mkfifo $DIR/dbpipe
1428  db2 BACKUP DATABASE mercuryd TO $DIR/dbpipe WITHOUT PROMPTING &
1429  sleep 1
1430 \end{lstlisting}
1431 \normalsize
1432
1433 The following line in the Job resource in the bacula-dir.conf file:
1434 \footnotesize
1435 \begin{lstlisting}
1436  Client Run Before Job = "su - mercuryd -c \"/u01/mercuryd/backupdb.sh '%t'
1437 '%l'\""
1438 \end{lstlisting}
1439 \normalsize
1440
1441 When the job is run, you will get messages from the output of the script
1442 stating that the backup has started. Even though the command being run is
1443 backgrounded with \&, the job will block until the ``db2 BACKUP DATABASE''
1444 command, thus the backup stalls.
1445
1446 To remedy this situation, the ``db2 BACKUP DATABASE'' line should be changed to
1447 the following:
1448
1449 \footnotesize
1450 \begin{lstlisting}
1451  db2 BACKUP DATABASE mercuryd TO $DIR/dbpipe WITHOUT PROMPTING > $DIR/backup.log
1452 2>&1 < /dev/null &
1453 \end{lstlisting}
1454 \normalsize
1455
1456 It is important to redirect the input and outputs of a backgrounded command to
1457 /dev/null to prevent the script from blocking.
1458
1459 \label{Director:Job:RunBeforeJob}
1460 \item [Run Before Job = \lt{}command\gt{}]
1461 \index[dir]{Run Before Job}
1462 \index[dir]{Directive!Run Before Job}
1463 \index[dir]{Directive!Run Before Job}
1464 The specified {\bf command} is run as an external program prior to running the
1465 current Job.  This directive is not required, but if it is defined, and if the
1466 exit code of the program run is non-zero, the current Bacula job will be
1467 canceled.
1468
1469 \begin{lstlisting}
1470 Run Before Job = "echo test"
1471 \end{lstlisting}
1472    it's equivalent to :
1473 \begin{lstlisting}
1474 RunScript {
1475  Command = "echo test"
1476  RunsOnClient = No
1477  RunsWhen = Before
1478 }
1479 \end{lstlisting}
1480
1481    Lutz Kittler has pointed out that using the RunBeforeJob directive can be a
1482    simple way to modify your schedules during a holiday.  For example, suppose
1483    that you normally do Full backups on Fridays, but Thursday and Friday are
1484    holidays.  To avoid having to change tapes between Thursday and Friday when
1485    no one is in the office, you can create a RunBeforeJob that returns a
1486    non-zero status on Thursday and zero on all other days.  That way, the
1487    Thursday job will not run, and on Friday the tape you inserted on Wednesday
1488    before leaving will be used.
1489
1490 \label{Director:Job:RunAfterJob}
1491 \item [Run After Job = \lt{}command\gt{}]
1492 \index[dir]{Run After Job}
1493 \index[dir]{Directive!Run After Job}
1494    The specified {\bf command} is run as an external program if the current
1495    job terminates normally (without error or without being canceled).  This
1496    directive is not required.  If the exit code of the program run is
1497    non-zero, Bacula will print a warning message.  Before submitting the
1498    specified command to the operating system, Bacula performs character
1499    substitution as described above for the {\bf RunScript} directive.
1500
1501    An example of the use of this directive is given in the
1502    \bsysxrlink{Tips}{JobNotification}{problems}{chapter} of the \problemsman{}.
1503
1504    See the {\bf Run After Failed Job} if you
1505    want to run a script after the job has terminated with any
1506    non-normal status.
1507
1508 \label{Director:Job:RunAfterJob}
1509 \item [Run After Failed Job = \lt{}command\gt{}]
1510 \index[dir]{Run After Job}
1511 \index[dir]{Directive!Run After Job}
1512    The specified {\bf command} is run as an external program after the current
1513    job terminates with any error status.  This directive is not required.  The
1514    command string must be a valid program name or name of a shell script. If
1515    the exit code of the program run is non-zero, Bacula will print a
1516    warning message. Before submitting the specified command to the
1517    operating system, Bacula performs character substitution as described above
1518    for the {\bf RunScript} directive. Note, if you wish that your script
1519    will run regardless of the exit status of the Job, you can use this :
1520 \begin{lstlisting}
1521 RunScript {
1522  Command = "echo test"
1523  RunsWhen = After
1524  RunsOnFailure = yes
1525  RunsOnClient  = no
1526  RunsOnSuccess = yes    # default, you can drop this line
1527 }
1528 \end{lstlisting}
1529
1530    An example of the use of this directive is given in the
1531    \bsysxrlink{Tips}{JobNotification}{problems}{chapter} of the \problemsman{}.
1532
1533
1534 \label{Director:Job:ClientRunBeforeJob}
1535 \item [Client Run Before Job = \lt{}command\gt{}]
1536 \index[dir]{Client Run Before Job}
1537 \index[dir]{Directive!Client Run Before Job}
1538    This directive is the same as {\bf Run Before Job} except that the
1539    program is run on the client machine.  The same restrictions apply to
1540    Unix systems as noted above for the {\bf RunScript}.
1541
1542    \label{Director:Job:ClientRunAfterJob}
1543 \item [Client Run After Job = \lt{}command\gt{}]
1544    \index[dir]{Client Run After Job}
1545    \index[dir]{Directive!Client Run After Job}
1546    The specified {\bf command} is run on the client machine as soon
1547    as data spooling is complete in order to allow restarting applications
1548    on the client as soon as possible. .
1549
1550    Note, please see the notes above in {\bf RunScript}
1551    concerning Windows clients.
1552
1553    \label{Director:Job:RerunFailedLevels}
1554 \item [Rerun Failed Levels = \lt{}yes\vb{}no\gt{}]
1555    \index[dir]{Rerun Failed Levels}
1556    \index[dir]{Directive!Rerun Failed Levels}
1557    If this directive is set to {\bf yes} (default no), and Bacula detects that
1558    a previous job at a higher level (i.e.  Full or Differential) has failed,
1559    the current job level will be upgraded to the higher level.  This is
1560    particularly useful for Laptops where they may often be unreachable, and if
1561    a prior Full save has failed, you wish the very next backup to be a Full
1562    save rather than whatever level it is started as.
1563
1564    There are several points that must be taken into account when using this
1565    directive: first, a failed job is defined as one that has not terminated
1566    normally, which includes any running job of the same name (you need to
1567    ensure that two jobs of the same name do not run simultaneously);
1568    secondly, the {\bf Ignore FileSet Changes} directive is not considered
1569    when checking for failed levels, which means that any FileSet change will
1570    trigger a rerun.
1571
1572    \label{Director:Job:SpoolData}
1573 \item [Spool Data = \lt{}yes\vb{}no\gt{}]
1574    \index[dir]{Spool Data}
1575    \index[dir]{Directive!Spool Data}
1576
1577    If this directive is set  to {\bf yes} (default no), the Storage daemon will
1578    be requested  to spool the data for this Job to disk rather than write it
1579    directly to the Volume (normally a tape).
1580
1581    Thus the data is written in large blocks to the Volume rather than small
1582    blocks.  This directive is particularly useful when running multiple
1583    simultaneous backups to tape.  Once all the data arrives or the spool
1584    files' maximum sizes are reached, the data will be despooled and written
1585    to tape.
1586
1587    Spooling data prevents interleaving date from several job and reduces or
1588    eliminates tape drive stop and start commonly known as ``shoe-shine''.
1589
1590    We don't recommend using this option if you are writing to a disk file
1591    using this option will probably just slow down the backup jobs.
1592
1593    NOTE: When this directive is set to yes, Spool Attributes is also
1594    automatically set to yes.
1595
1596    \label{Director:Job:SpoolData}
1597 \item [SpoolData=yes\vb{}no]
1598    \index[dir]{SpoolData}
1599    \index[dir]{Directive!SpoolData}
1600    tells Bacula to request the Storage  daemon to spool data to a disk file
1601    before writing it to the Volume (normally a tape).
1602
1603    \label{Director:Job:SpoolAttributes}
1604 \item [Spool Attributes = \lt{}yes\vb{}no\gt{}]
1605    \index[dir]{Spool Attributes}
1606    \index[dir]{Directive!Spool Attributes}
1607    \index[dir]{slow}
1608    \index[general]{slow}
1609    \index[dir]{Backups!slow}
1610    \index[general]{Backups!slow}
1611    The default is set to {\bf no}, which means that the File attributes are
1612    sent by the Storage daemon to the Director as they are stored on tape.
1613    However, if you want to avoid the possibility that database updates will
1614    slow down writing to the tape, you may want to set the value to {\bf
1615    yes}, in which case the Storage daemon will buffer the File attributes
1616    and Storage coordinates to a temporary file in the Working Directory,
1617    then when writing the Job data to the tape is completed, the attributes
1618    and storage coordinates will be sent to the Director.
1619
1620    NOTE: When Spool Data is set to yes, Spool Attributes is also
1621    automatically set to yes.
1622
1623    \label{Director:Job:SpoolSize}
1624 \item [SpoolSize={\it bytes}]
1625    \index[dir]{SpoolSize}
1626    \index[dir]{Directive!SpoolSize}
1627    where the bytes specify the maximum spool size for this job.
1628    The default is take from Device Maximum Spool Size limit.
1629    This directive is available only in Bacula version 2.3.5 or
1630    later.
1631
1632
1633    \label{Director:Job:Where}
1634 \item [Where = \lt{}directory\gt{}]
1635    \index[dir]{Where}
1636    \index[dir]{Directive!Where}
1637    This directive applies only to a Restore job and specifies a prefix to
1638    the directory name of all files being restored.  This permits files to
1639    be restored in a different location from which they were saved.  If {\bf
1640    Where} is not specified or is set to backslash ({\bf /}), the files will
1641    be restored to their original location.  By default, we have set {\bf
1642    Where} in the example configuration files to be {\bf
1643    /tmp/bacula-restores}.  This is to prevent accidental overwriting of
1644    your files.
1645
1646   \label{confaddprefix}
1647   \label{Director:Job:AddPrefix}
1648 \item [Add Prefix = \lt{}directory\gt{}]
1649   \index[dir]{AddPrefix}
1650   \index[dir]{Directive!AddPrefix}
1651   This directive applies only to a Restore job and specifies a prefix to the
1652   directory name of all files being restored.  This will use \ilink{File
1653   Relocation}{filerelocation} feature implemented in Bacula 2.1.8 or later.
1654
1655   \label{Director:Job:AddSuffix}
1656 \item [Add Suffix = \lt{}extention\gt{}]
1657   \index[dir]{AddSuffix}
1658   \index[dir]{Directive!AddSuffix}
1659   This directive applies only to a Restore job and specifies a suffix to all
1660   files being restored.  This will use \ilink{File Relocation}{filerelocation}
1661   feature implemented in Bacula 2.1.8 or later.
1662
1663   Using \texttt{Add Suffix=.old}, \texttt{/etc/passwd} will be restored to
1664   \texttt{/etc/passwsd.old}
1665
1666   \label{Director:Job:StripPrefix}
1667 \item [Strip Prefix = \lt{}directory\gt{}]
1668   \index[dir]{StripPrefix}
1669   \index[dir]{Directive!StripPrefix}
1670   This directive applies only to a Restore job and specifies a prefix to remove
1671   from the directory name of all files being restored.  This will use the
1672   \ilink{File Relocation}{filerelocation} feature implemented in Bacula 2.1.8
1673   or later.
1674
1675   Using \texttt{Strip Prefix=/etc}, \texttt{/etc/passwd} will be restored to
1676   \texttt{/passwd}
1677
1678   Under Windows, if you want to restore \texttt{c:/files} to \texttt{d:/files},
1679   you can use :
1680
1681 \begin{lstlisting}
1682  Strip Prefix = c:
1683  Add Prefix = d:
1684 \end{lstlisting}
1685
1686   \label{Director:Job:RegexWhere}
1687 \item [RegexWhere = \lt{}expressions\gt{}]
1688   \index[dir]{RegexWhere}
1689   \index[dir]{Directive!RegexWhere}
1690   This directive applies only to a Restore job and specifies a regex filename
1691   manipulation of all files being restored.  This will use \ilink{File
1692   Relocation}{filerelocation} feature implemented in Bacula 2.1.8 or later.
1693
1694   For more informations about how use this option, see
1695   \ilink{this}{useregexwhere}.
1696
1697    \label{Director:Job:Replace}
1698 \item [Replace = \lt{}replace-option\gt{}]
1699    \index[dir]{Replace}
1700    \index[dir]{Directive!Replace}
1701    This directive applies only to a Restore job and specifies what happens
1702    when Bacula wants to restore a file or directory that already exists.
1703    You have the following options for {\bf replace-option}:
1704
1705 \begin{description}
1706
1707 \item [always]
1708    \index[dir]{always}
1709   when the file to be restored already exists, it is deleted and then
1710   replaced by the copy that was backed up.  This is the default value.
1711
1712 \item [ifnewer]
1713 \index[dir]{ifnewer}
1714   if the backed up file (on tape) is newer than the existing file, the
1715   existing file is deleted and replaced by the back up.
1716
1717 \item [ifolder]
1718    \index[dir]{ifolder}
1719   if the backed up file (on tape) is older than the existing file, the
1720   existing file is deleted and replaced by the back up.
1721
1722 \item [never]
1723    \index[dir]{never}
1724   if the backed up file already exists, Bacula skips  restoring this file.
1725 \end{description}
1726
1727    \label{Director:Job:PrefixLinks}
1728 \item [Prefix Links=\lt{}yes\vb{}no\gt{}]
1729    \index[dir]{Prefix Links}
1730    \index[dir]{Directive!Prefix Links}
1731    If a {\bf Where} path prefix is specified for a recovery job, apply it
1732    to absolute links as well.  The default is {\bf No}.  When set to {\bf
1733    Yes} then while restoring files to an alternate directory, any absolute
1734    soft links will also be modified to point to the new alternate
1735    directory.  Normally this is what is desired -- i.e.  everything is self
1736    consistent.  However, if you wish to later move the files to their
1737    original locations, all files linked with absolute names will be broken.
1738
1739    \label{Director:Job:MaximumConcurrentJobs}
1740 \item [Maximum Concurrent Jobs = \lt{}number\gt{}]
1741    \index[dir]{Maximum Concurrent Jobs}
1742    \index[dir]{Directive!Maximum Concurrent Jobs}
1743    where \lt{}number\gt{} is the maximum number of Jobs from the current
1744    Job resource that can run concurrently.  Note, this directive limits
1745    only Jobs with the same name as the resource in which it appears.  Any
1746    other restrictions on the maximum concurrent jobs such as in the
1747    Director, Client, or Storage resources will also apply in addition to
1748    the limit specified here.  The default is set to 1, but you may set it
1749    to a larger number.  We strongly recommend that you read the WARNING
1750    documented under \ilink{ Maximum Concurrent Jobs}{DirMaxConJobs} in the
1751    Director's resource.
1752
1753    \label{Director:Job:RescheduleOnError}
1754 \item [Reschedule On Error = \lt{}yes\vb{}no\gt{}]
1755    \index[dir]{Reschedule On Error}
1756    \index[dir]{Directive!Reschedule On Error}
1757    If this directive is enabled, and the job terminates in error, the job
1758    will be rescheduled as determined by the {\bf Reschedule Interval} and
1759    {\bf Reschedule Times} directives.  If you cancel the job, it will not
1760    be rescheduled.  The default is {\bf no} (i.e.  the job will not be
1761    rescheduled).
1762
1763    This specification can be useful for portables, laptops, or other
1764    machines that are not always connected to the network or switched on.
1765
1766    \label{Director:Job:RescheduleInterval}
1767 \item [Reschedule Interval = \lt{}time-specification\gt{}]
1768    \index[dir]{Reschedule Interval}
1769    \index[dir]{Directive!Reschedule Interval}
1770    If you have specified {\bf Reschedule On Error = yes} and the job
1771    terminates in error, it will be rescheduled after the interval of time
1772    specified by {\bf time-specification}.  See \ilink{the time
1773    specification formats}{Time} in the Configure chapter for details of
1774    time specifications.  If no interval is specified, the job will not be
1775    rescheduled on error.
1776
1777    \label{Director:Job:RescheduleTimes}
1778 \item [Reschedule Times = \lt{}count\gt{}]
1779    \index[dir]{Reschedule Times}
1780    \index[dir]{Directive!Reschedule Times}
1781    This directive specifies the maximum number of times to reschedule the
1782    job.  If it is set to zero (the default) the job will be rescheduled an
1783    indefinite number of times.
1784
1785 \label{Director:Job:AllowDuplicateJobs}
1786 \item [Allow Duplicate Jobs = \lt{}yes\vb{}no\gt{}]
1787 \index[general]{Allow Duplicate Jobs}
1788
1789 \bsysimageH{duplicate-real}{Allow Duplicate Jobs usage}{fig:allowduplicatejobs}
1790
1791 A duplicate job in the sense we use it here means a second or subsequent job
1792 with the same name starts.  This happens most frequently when the first job
1793 runs longer than expected because no tapes are available.
1794
1795   If this directive is enabled duplicate jobs will be run.  If
1796   the directive is set to {\bf no} (default) then only one job of a given name
1797   may run at one time, and the action that Bacula takes to ensure only
1798   one job runs is determined by the other directives (see below).
1799
1800   If {\bf Allow Duplicate Jobs} is set to {\bf no} and two jobs
1801   are present and none of the three directives given below permit
1802   cancelling a job, then the current job (the second one started)
1803   will be cancelled.
1804
1805 \label{Job:AllowHigherDuplicates}
1806 \item [Allow Higher Duplicates = \lt{}yes\vb{}no\gt{}]
1807 \index[general]{Allow Higher Duplicates}
1808   This directive was implemented in version 5.0.0, but does not work
1809   as expected. If used, it should always be set to no.  In later versions
1810   of Bacula the directive is disabled (disregarded).
1811
1812
1813 \label{Director:Job:CancelLowerLevelDuplicates}
1814 \item [Cancel Lower Level Duplicates = \lt{}yes\vb{}no\gt{}]
1815 \index[general]{Cancel Lower Level Duplicates}
1816   If \textbf{Allow Duplicates Jobs} is set to \textbf{no} and this
1817   directive is set to \textbf{yes}, Bacula will choose between duplicated
1818   jobs the one with the highest level.  For example, it will cancel a
1819   previous Incremental to run a Full backup.  It works only for Backup
1820   jobs.  The default is \texttt{no}. If the levels of the duplicated
1821   jobs are the same, nothing is done and the other
1822   Cancel XXX Duplicate directives will be examined.
1823
1824 \label{Director:Job:CancelQueuedDuplicates}
1825 \item [Cancel Queued Duplicates = \lt{}yes\vb{}no\gt{}]
1826 \index[general]{Cancel Queued Duplicates}
1827   If {\bf Allow Duplicate Jobs} is set to {\bf no} and
1828   if this directive is set to {\bf yes} any job that is
1829   already queued to run but not yet running will be canceled.
1830   The default is {\bf no}.
1831
1832 \label{Director:Job:CancelRunningDuplicates}
1833 \item[Cancel Running Duplicates = \lt{}yes\vb{}no\gt{}]
1834 \index[general]{Cancel Running Duplicates}
1835   If {\bf Allow Duplicate Jobs} is set to {\bf no} and
1836   if this directive is set to {\bf yes} any job that is already running
1837   will be canceled.  The default is {\bf no}.
1838
1839
1840 %%\item[DuplicateJobProximity = \lt{}time-specification\gt{}]
1841 %%\index[general]{Duplicate Job Proximity}
1842 %%  This directive permits to determine if two jobs are really duplicated.
1843 %%  If the first one is running for long time, this is probably not a good
1844 %%  idea to cancel it.
1845
1846    \label{Director:Job:Run}
1847 \item [Run = \lt{}job-name\gt{}]
1848    \index[dir]{Run}
1849    \index[dir]{Directive!Run}
1850    \index[dir]{Clone a Job}
1851    The Run directive (not to be confused with the Run option in a
1852    Schedule) allows you to start other jobs or to clone jobs. By using the
1853    cloning keywords (see below), you can backup
1854    the same data (or almost the same data) to two or more drives
1855    at the same time. The {\bf job-name} is normally the same name
1856    as the current Job resource (thus creating a clone). However, it
1857    may be any Job name, so one job may start other related jobs.
1858
1859    The part after the equal sign must be enclosed in double quotes,
1860    and can contain any string or set of options (overrides) that you
1861    can specify when entering the Run command from the console. For
1862    example {\bf storage=DDS-4 \ldots{}}.  In addition, there are two special
1863    keywords that permit you to clone the current job. They are {\bf level=\%l}
1864    and {\bf since=\%s}. The \%l in the level keyword permits
1865    entering the actual level of the current job and the \%s in the since
1866    keyword permits putting the same time for comparison as used on the
1867    current job.  Note, in the case of the since keyword, the \%s must be
1868    enclosed in double quotes, and thus they must be preceded by a backslash
1869    since they are already inside quotes. For example:
1870
1871 \begin{lstlisting}
1872    run = "Nightly-backup level=%l since=\"%s\" storage=DDS-4"
1873 \end{lstlisting}
1874
1875    A cloned job will not start additional clones, so it is not
1876    possible to recurse.
1877
1878    Please note that all cloned jobs, as specified in the Run directives are
1879    submitted for running before the original job is run (while it is being
1880    initialized). This means that any clone job will actually start before
1881    the original job, and may even block the original job from starting
1882    until the original job finishes unless you allow multiple simultaneous
1883    jobs.  Even if you set a lower priority on the clone job, if no other
1884    jobs are running, it will start before the original job.
1885
1886    If you are trying to prioritize jobs by using the clone feature (Run
1887    directive), you will find it much easier to do using a RunScript
1888    resource, or a RunBeforeJob directive.
1889 \label{Priority}
1890
1891    \label{Director:Job:Priority}
1892 \item [Priority = \lt{}number\gt{}]
1893    \index[dir]{Priority}
1894    \index[dir]{Directive!Priority}
1895    This directive permits you to control the order in which your jobs will
1896    be run by specifying a positive non-zero number. The higher the number,
1897    the lower the job priority. Assuming you are not running concurrent jobs,
1898    all queued jobs of priority 1 will run before queued jobs of priority 2
1899    and so on, regardless of the original scheduling order.
1900
1901    The priority only affects waiting jobs that are queued to run, not jobs
1902    that are already running.  If one or more jobs of priority 2 are already
1903    running, and a new job is scheduled with priority 1, the currently
1904    running priority 2 jobs must complete before the priority 1 job is
1905    run, unless Allow Mixed Priority is set.
1906
1907    The default priority is 10.
1908
1909    If you want to run concurrent jobs you should
1910    keep these points in mind:
1911
1912 \begin{bsysitemize}
1913 \item See \bsysxrlink{Running Concurrent Jobs}{ConcurrentJobs}{problems}{section} on how to setup
1914    concurrent jobs in the \problemsman{}.
1915
1916 \item Bacula concurrently runs jobs of only one priority at a time.  It
1917    will not simultaneously run a priority 1 and a priority 2 job.
1918
1919 \item If Bacula is running a priority 2 job and a new priority 1 job is
1920    scheduled, it will wait until the running priority 2 job terminates even
1921    if the Maximum Concurrent Jobs settings would otherwise allow two jobs
1922    to run simultaneously.
1923
1924 \item Suppose that bacula is running a priority 2 job and a new priority 1
1925    job is scheduled and queued waiting for the running priority 2 job to
1926    terminate.  If you then start a second priority 2 job, the waiting
1927    priority 1 job will prevent the new priority 2 job from running
1928    concurrently with the running priority 2 job.  That is: as long as there
1929    is a higher priority job waiting to run, no new lower priority jobs will
1930    start even if the Maximum Concurrent Jobs settings would normally allow
1931    them to run.  This ensures that higher priority jobs will be run as soon
1932    as possible.
1933 \end{bsysitemize}
1934
1935 If you have several jobs of different priority, it may not best to start
1936 them at exactly the same time, because Bacula must examine them one at a
1937 time.  If by Bacula starts a lower priority job first, then it will run
1938 before your high priority jobs.  If you experience this problem, you may
1939 avoid it by starting any higher priority jobs a few seconds before lower
1940 priority ones.  This insures that Bacula will examine the jobs in the
1941 correct order, and that your priority scheme will be respected.
1942 \label{AllowMixedPriority}
1943
1944 \label{Director:Job:AllowMixedPriority}
1945 \item [Allow Mixed Priority = \lt{}yes\vb{}no\gt{}]
1946 \index[dir]{Allow Mixed Priority}
1947    This directive is only implemented in version 2.5 and later.  When
1948    set to {\bf yes} (default {\bf no}), this job may run even if lower
1949    priority jobs are already running.  This means a high priority job
1950    will not have to wait for other jobs to finish before starting.
1951    The scheduler will only mix priorities when all running jobs have
1952    this set to true.
1953
1954    Note that only higher priority jobs will start early.  Suppose the
1955    director will allow two concurrent jobs, and that two jobs with
1956    priority 10 are running, with two more in the queue.  If a job with
1957    priority 5 is added to the queue, it will be run as soon as one of
1958    the running jobs finishes.  However, new priority 10 jobs will not
1959    be run until the priority 5 job has finished.
1960 \label{WritePartAfterJob}
1961
1962 \label{Director:Job:WritePartAfterJob}
1963 \item [Write Part After Job = \lt{}yes\vb{}no\gt{}]
1964 \index[dir]{Write Part After Job}
1965 \index[dir]{Directive!Write Part After Job}
1966    This directive is only implemented in version 1.37 and later.
1967    If this directive is set to {\bf yes} (default {\bf no}), a new part file
1968    will be created after the job is finished.
1969
1970    It should be set to {\bf yes} when writing to devices that require mount
1971    (for example DVD), so you are sure that the current part, containing
1972    this job's data, is written to the device, and that no data is left in
1973    the temporary file on the hard disk.  However, on some media, like DVD+R
1974    and DVD-R, a lot of space (about 10Mb) is lost every time a part is
1975    written.  So, if you run several jobs each after another, you could set
1976    this directive to {\bf no} for all jobs, except the last one, to avoid
1977    wasting too much space, but to ensure that the data is written to the
1978    medium when all jobs are finished.
1979
1980    This directive is ignored with tape and FIFO devices.
1981
1982 \end{description}
1983
1984 The following is an example of a valid Job resource definition:
1985
1986 \footnotesize
1987 \begin{lstlisting}
1988 Job {
1989   Name = "Minou"
1990   Type = Backup
1991   Level = Incremental                 # default
1992   Client = Minou
1993   FileSet="Minou Full Set"
1994   Storage = DLTDrive
1995   Pool = Default
1996   Schedule = "MinouWeeklyCycle"
1997   Messages = Standard
1998 }
1999 \end{lstlisting}
2000 \normalsize
2001
2002 \label{JobDefsResource}
2003 \section{The JobDefs Resource}
2004 \index[general]{JobDefs Resource}
2005 \index[general]{Resource!JobDefs}
2006
2007 The JobDefs resource permits all the same directives that can appear in a Job
2008 resource. However, a JobDefs resource does not create a Job, rather it can be
2009 referenced within a Job to provide defaults for that Job. This permits you to
2010 concisely define several nearly identical Jobs, each one referencing a JobDefs
2011 resource which contains the defaults. Only the changes from the defaults need to
2012 be mentioned in each Job.
2013
2014 \label{ScheduleResource}
2015 \section{The Schedule Resource}
2016 \index[general]{Resource!Schedule}
2017 \index[general]{Schedule Resource}
2018
2019 The Schedule resource provides a means of automatically scheduling a Job as
2020 well as the ability to override the default Level, Pool, Storage and Messages
2021 resources. If a Schedule resource is not referenced in a Job, the Job can only
2022 be run manually. In general, you specify an action to be taken and when.
2023
2024 \begin{description}
2025
2026 \item [Schedule]
2027 \index[dir]{Schedule}
2028 \index[dir]{Directive!Schedule}
2029    Start of the Schedule directives.  No {\bf Schedule} resource is
2030    required, but you will need at least one if you want Jobs to be
2031    automatically started.
2032
2033    \label{Director:Schedule:Name}
2034 \item [Name = \lt{}name\gt{}]
2035    \index[dir]{Name}
2036    \index[dir]{Directive!Name}
2037    The name of the schedule being defined.  The Name directive is required.
2038
2039    \label{Director:Schedule:Run}
2040 \item [Run = \lt{}Job-overrides\gt{} \lt{}Date-time-specification\gt{}]
2041    \index[dir]{Run}
2042    \index[dir]{Directive!Run}
2043    The Run directive defines when a Job is to be run, and what overrides if
2044    any to apply.  You may specify multiple {\bf run} directives within a
2045    {\bf Schedule} resource.  If you do, they will all be applied (i.e.
2046    multiple schedules).  If you have two {\bf Run} directives that start at
2047    the same time, two Jobs will start at the same time (well, within one
2048    second of each other).
2049
2050    The {\bf Job-overrides} permit overriding the Level, the Storage, the
2051    Messages, and the Pool specifications provided in the Job resource.  In
2052    addition, the FullPool, the IncrementalPool, and the DifferentialPool
2053    specifications permit overriding the Pool specification according to
2054    what backup Job Level is in effect.
2055
2056    By the use of overrides, you may customize a particular Job.  For
2057    example, you may specify a Messages override for your Incremental
2058    backups that outputs messages to a log file, but for your weekly or
2059    monthly Full backups, you may send the output by email by using a
2060    different Messages override.
2061
2062    {\bf Job-overrides} are specified as: {\bf keyword=value} where the
2063    keyword is Level, Storage, Messages, Pool, FullPool, DifferentialPool,
2064    or IncrementalPool, and the {\bf value} is as defined on the respective
2065    directive formats for the Job resource.  You may specify multiple {\bf
2066    Job-overrides} on one {\bf Run} directive by separating them with one or
2067    more spaces or by separating them with a trailing comma.  For example:
2068
2069    \label{Director:Schedule:End}
2070 \begin{description}
2071
2072 \item [Level=Full]
2073    \index[dir]{Level}
2074    \index[dir]{Directive!Level}
2075    is all files in the FileSet whether or not  they have changed.
2076
2077 \item [Level=Incremental]
2078    \index[dir]{Level}
2079    \index[dir]{Directive!Level}
2080    is all files that have changed since  the last backup.
2081
2082 \item [Pool=Weekly]
2083    \index[dir]{Pool}
2084    \index[dir]{Directive!Pool}
2085    specifies to use the Pool named {\bf Weekly}.
2086
2087 \item [Storage=DLT\_Drive]
2088    \index[dir]{Storage}
2089    \index[dir]{Directive!Storage}
2090    specifies to use {\bf DLT\_Drive} for  the storage device.
2091
2092 \item [Messages=Verbose]
2093    \index[dir]{Messages}
2094    \index[dir]{Directive!Messages}
2095    specifies to use the {\bf Verbose}  message resource for the Job.
2096
2097 \item [FullPool=Full]
2098    \index[dir]{FullPool}
2099    \index[dir]{Directive!FullPool}
2100    specifies to use the Pool named {\bf Full}  if the job is a full backup, or
2101 is
2102 upgraded from another type  to a full backup.
2103
2104 \item [DifferentialPool=Differential]
2105    \index[dir]{DifferentialPool}
2106    \index[dir]{Directive!DifferentialPool}
2107    specifies to use the Pool named {\bf Differential} if the job is a
2108    differential  backup.
2109
2110 \item [IncrementalPool=Incremental]
2111    \index[dir]{IncrementalPool}
2112    \index[dir]{Directive!IncrementalPool}
2113    specifies to use the Pool  named {\bf Incremental} if the job is an
2114 incremental  backup.
2115
2116
2117 \item [WritePartAfterJob=yes\vb{}no]
2118    \index[dir]{WritePartAfterJob}
2119    \index[dir]{Directive!WritePartAfterJob}
2120    tells Bacula to request the Storage daemon to write the current part
2121    file to the device when the job is finished (see \ilink{Write Part After
2122    Job directive in the Job resource}{WritePartAfterJob}).  Please note,
2123    this directive is implemented only in version 1.37 and later.  The
2124    default is yes.  We strongly recommend that you keep this set to yes
2125    otherwise, when the last job has finished one part will remain in the
2126    spool file and restore may or may not work.
2127
2128 \end{description}
2129
2130 {\bf Date-time-specification} determines when the  Job is to be run. The
2131 specification is a repetition, and as  a default Bacula is set to run a job at
2132 the beginning of the  hour of every hour of every day of every week of every
2133 month  of every year. This is not normally what you want, so you  must specify
2134 or limit when you want the job to run. Any  specification given is assumed to
2135 be repetitive in nature and  will serve to override or limit the default
2136 repetition. This  is done by specifying masks or times for the hour, day of the
2137 month, day of the week, week of the month, week of the year,  and month when
2138 you want the job to run. By specifying one or  more of the above, you can
2139 define a schedule to repeat at  almost any frequency you want.
2140
2141 Basically, you must supply a {\bf month}, {\bf day}, {\bf hour}, and  {\bf
2142 minute} the Job is to be run. Of these four items to be specified,  {\bf day}
2143 is special in that you may either specify a day of the month  such as 1, 2,
2144 \ldots{} 31, or you may specify a day of the week such  as Monday, Tuesday, \ldots{}
2145 Sunday. Finally, you may also specify a  week qualifier to restrict the
2146 schedule to the first, second, third,  fourth, or fifth week of the month.
2147
2148 For example, if you specify only a day of the week, such as {\bf Tuesday}  the
2149 Job will be run every hour of every Tuesday of every Month. That  is the {\bf
2150 month} and {\bf hour} remain set to the defaults of  every month and all
2151 hours.
2152
2153 Note, by default with no other specification, your job will run  at the
2154 beginning of every hour. If you wish your job to run more than  once in any
2155 given hour, you will need to specify multiple {\bf run}  specifications each
2156 with a different minute.
2157
2158 The date/time to run the Job can be specified in the following way  in
2159 pseudo-BNF:
2160
2161 \footnotesize
2162 \begin{lstlisting}
2163 <void-keyword>    = on
2164 <at-keyword>      = at
2165 <week-keyword>    = 1st | 2nd | 3rd | 4th | 5th | first |
2166                     second | third | fourth | fifth
2167 <wday-keyword>    = sun | mon | tue | wed | thu | fri | sat |
2168                     sunday | monday | tuesday | wednesday |
2169                     thursday | friday | saturday
2170 <week-of-year-keyword> = w00 | w01 | ... w52 | w53
2171 <month-keyword>   = jan | feb | mar | apr | may | jun | jul |
2172                     aug | sep | oct | nov | dec | january |
2173                     february | ... | december
2174 <daily-keyword>   = daily
2175 <weekly-keyword>  = weekly
2176 <monthly-keyword> = monthly
2177 <hourly-keyword>  = hourly
2178 <digit>           = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0
2179 <number>          = <digit> | <digit><number>
2180 <12hour>          = 0 | 1 | 2 | ... 12
2181 <hour>            = 0 | 1 | 2 | ... 23
2182 <minute>          = 0 | 1 | 2 | ... 59
2183 <day>             = 1 | 2 | ... 31
2184 <time>            = <hour>:<minute> |
2185                     <12hour>:<minute>am |
2186                     <12hour>:<minute>pm
2187 <time-spec>       = <at-keyword> <time> |
2188                     <hourly-keyword>
2189 <date-keyword>    = <void-keyword>  <weekly-keyword>
2190 <day-range>       = <day>-<day>
2191 <month-range>     = <month-keyword>-<month-keyword>
2192 <wday-range>      = <wday-keyword>-<wday-keyword>
2193 <range>           = <day-range> | <month-range> |
2194                           <wday-range>
2195 <date>            = <date-keyword> | <day> | <range>
2196 <date-spec>       = <date> | <date-spec>
2197 <day-spec>        = <day> | <wday-keyword> |
2198                     <day> | <wday-range> |
2199                     <week-keyword> <wday-keyword> |
2200                     <week-keyword> <wday-range> |
2201                     <daily-keyword>
2202 <month-spec>      = <month-keyword> | <month-range> |
2203                     <monthly-keyword>
2204 <date-time-spec>  = <month-spec> <day-spec> <time-spec>
2205 \end{lstlisting}
2206 \normalsize
2207
2208 \end{description}
2209
2210 Note, the Week of Year specification wnn follows the ISO standard definition
2211 of the week of the year, where Week 1 is the week in which the first Thursday
2212 of the year occurs, or alternatively, the week which contains the 4th of
2213 January. Weeks are numbered w01 to w53. w00 for Bacula is the week that
2214 precedes the first ISO week (i.e. has the first few days of the year if any
2215 occur before Thursday). w00 is not defined by the ISO specification. A week
2216 starts with Monday and ends with Sunday.
2217
2218 According to the NIST (US National Institute of Standards and Technology),
2219 12am and 12pm are ambiguous and can be defined to anything.  However,
2220 12:01am is the same as 00:01 and 12:01pm is the same as 12:01, so Bacula
2221 defines 12am as 00:00 (midnight) and 12pm as 12:00 (noon).  You can avoid
2222 this abiguity (confusion) by using 24 hour time specifications (i.e.  no
2223 am/pm). This is the definition in Bacula version 2.0.3 and later.
2224
2225 An example schedule resource that is named {\bf WeeklyCycle} and runs a job
2226 with level full each Sunday at 2:05am and an incremental job Monday through
2227 Saturday at 2:05am is:
2228
2229 \footnotesize
2230 \begin{lstlisting}
2231 Schedule {
2232   Name = "WeeklyCycle"
2233   Run = Level=Full sun at 2:05
2234   Run = Level=Incremental mon-sat at 2:05
2235 }
2236 \end{lstlisting}
2237 \normalsize
2238
2239 An example of a possible monthly cycle is as follows:
2240
2241 \footnotesize
2242 \begin{lstlisting}
2243 Schedule {
2244   Name = "MonthlyCycle"
2245   Run = Level=Full Pool=Monthly 1st sun at 2:05
2246   Run = Level=Differential 2nd-5th sun at 2:05
2247   Run = Level=Incremental Pool=Daily mon-sat at 2:05
2248 }
2249 \end{lstlisting}
2250 \normalsize
2251
2252 The first of every month:
2253
2254 \footnotesize
2255 \begin{lstlisting}
2256 Schedule {
2257   Name = "First"
2258   Run = Level=Full on 1 at 2:05
2259   Run = Level=Incremental on 2-31 at 2:05
2260 }
2261 \end{lstlisting}
2262 \normalsize
2263
2264 Every 10 minutes:
2265
2266 \footnotesize
2267 \begin{lstlisting}
2268 Schedule {
2269   Name = "TenMinutes"
2270   Run = Level=Full hourly at 0:05
2271   Run = Level=Full hourly at 0:15
2272   Run = Level=Full hourly at 0:25
2273   Run = Level=Full hourly at 0:35
2274   Run = Level=Full hourly at 0:45
2275   Run = Level=Full hourly at 0:55
2276 }
2277 \end{lstlisting}
2278 \normalsize
2279
2280 \section{Technical Notes on Schedules}
2281 \index[general]{Schedules!Technical Notes on}
2282 \index[general]{Technical Notes on Schedules}
2283
2284 Internally Bacula keeps a schedule as a bit mask. There are six masks and a
2285 minute field to each schedule. The masks are hour, day of the month (mday),
2286 month, day of the week (wday), week of the month (wom), and week of the year
2287 (woy). The schedule is initialized to have the bits of each of these masks
2288 set, which means that at the beginning of every hour, the job will run. When
2289 you specify a month for the first time, the mask will be cleared and the bit
2290 corresponding to your selected month will be selected. If you specify a second
2291 month, the bit corresponding to it will also be added to the mask. Thus when
2292 Bacula checks the masks to see if the bits are set corresponding to the
2293 current time, your job will run only in the two months you have set. Likewise,
2294 if you set a time (hour), the hour mask will be cleared, and the hour you
2295 specify will be set in the bit mask and the minutes will be stored in the
2296 minute field.
2297
2298 For any schedule you have defined, you can see how these bits are set by doing
2299 a {\bf show schedules} command in the Console program. Please note that the
2300 bit mask is zero based, and Sunday is the first day of the week (bit zero).
2301
2302 \input{fileset}
2303 \input{bsplugins}
2304
2305 \label{ClientResource}
2306 \section{The Client Resource}
2307 \index[general]{Resource!Client}
2308 \index[general]{Client Resource}
2309
2310 The Client resource defines the attributes of the Clients that are served by
2311 this Director; that is the machines that are to be backed up. You will need
2312 one Client resource definition for each machine to be backed up.
2313
2314 \begin{description}
2315
2316 \item [Client (or FileDaemon)]
2317    \index[dir]{Client (or FileDaemon)}
2318    \index[dir]{Directive!Client (or FileDaemon)}
2319    Start of the Client directives.
2320
2321    \label{Director:Client:Name}
2322 \item [Name = \lt{}name\gt{}]
2323    \index[dir]{Name}
2324    \index[dir]{Directive!Name}
2325    The client name which will be used in the  Job resource directive or in the
2326 console run command.  This directive is required.
2327
2328    \label{Director:Client:Address}
2329 \item [Address = \lt{}address\gt{}]
2330    \index[dir]{Address}
2331    \index[dir]{Directive!FD Address}
2332    \index[dir]{File Daemon Address}
2333    \index[dir]{Client Address}
2334    Where the address is a host name, a fully qualified domain name, or a
2335    network address in dotted quad notation for a Bacula File server daemon.
2336    This directive is required.
2337
2338    \label{Director:Client:FdPort}
2339 \item [FD Port = \lt{}port-number\gt{}]
2340    \index[dir]{FD Port}
2341    \index[dir]{Directive!FD Port}
2342    Where the port is a port  number at which the Bacula File server daemon can
2343    be contacted.  The default is 9102.
2344
2345    \label{Director:Client:Catalog}
2346 \item [Catalog = \lt{}Catalog-resource-name\gt{}]
2347    \index[dir]{Catalog}
2348    \index[dir]{Directive!Catalog}
2349    This specifies the  name of the catalog resource to be used for this Client.
2350    This directive is required.
2351
2352    \label{Director:Client:Password}
2353 \item [Password = \lt{}password\gt{}]
2354    \index[dir]{Password}
2355    \index[dir]{Directive!Password}
2356    This is the password to be  used when establishing a connection with the File
2357    services, so  the Client configuration file on the machine to be backed up
2358    must  have the same password defined for this Director. This directive is
2359    required.  If you have either {\bf /dev/random}  {\bf bc} on your machine,
2360    Bacula will generate a random  password during the configuration process,
2361    otherwise it will  be left blank.
2362
2363    The password is plain text.  It is not generated through any special
2364    process, but it is preferable for security reasons to make the text
2365    random.
2366 \label{FileRetention}
2367
2368    \label{FileRetention}
2369    \label{Director:Client:FileRetention}
2370 \item [File Retention = \lt{}time-period-specification\gt{}]
2371    \index[dir]{File Retention}
2372    \index[dir]{Directive!File Retention}
2373    The File Retention directive defines the length of time that  Bacula will
2374    keep File records in the Catalog database after the End time of the
2375    Job corresponding to the File records.
2376    When this time period expires, and if
2377    {\bf AutoPrune} is set to  {\bf yes} Bacula will prune (remove) File records
2378    that  are older than the specified File Retention period. Note, this  affects
2379    only records in the catalog database. It does not  affect your archive
2380    backups.
2381
2382    File records  may actually be retained for a shorter period than you specify
2383    on  this directive if you specify either a shorter {\bf Job Retention}  or a
2384    shorter {\bf Volume Retention} period. The shortest  retention period of the
2385    three takes precedence.  The time may be expressed in seconds, minutes,
2386    hours, days, weeks, months, quarters, or years. See the
2387    \ilink{ Configuration chapter}{Time} of this  manual for
2388    additional details of time specification.
2389
2390    The  default is 60 days.
2391
2392    \label{JobRetention}
2393    \label{Director:Client:JobRetention}
2394 \item [Job Retention = \lt{}time-period-specification\gt{}]
2395    \index[dir]{Job Retention}
2396    \index[dir]{Directive!Job Retention}
2397    The Job Retention directive defines the length of time that  Bacula will keep
2398    Job records in the Catalog database after the Job End time.  When
2399    this time period expires, and if {\bf AutoPrune} is set to {\bf yes}
2400    Bacula will prune (remove) Job records that are older than the specified
2401    File Retention period.  As with the other retention periods, this
2402    affects only records in the catalog and not data in your archive backup.
2403
2404    If a Job record is selected for pruning, all associated File and JobMedia
2405    records will also be pruned regardless of the File Retention period set.
2406    As a consequence, you normally will set the File retention period to be
2407    less than the Job retention period.  The Job retention period can actually
2408    be less than the value you specify here if you set the {\bf Volume
2409    Retention} directive in the Pool resource to a smaller duration.  This is
2410    because the Job retention period and the Volume retention period are
2411    independently applied, so the smaller of the two takes precedence.
2412
2413    The Job retention period is specified as seconds,  minutes, hours, days,
2414    weeks, months,  quarters, or years.  See the
2415    \ilink{ Configuration chapter}{Time} of this manual for
2416    additional details of  time specification.
2417
2418    The default is 180 days.
2419 \label{AutoPrune}
2420
2421    \label{Director:Client:AutoPrune}
2422 \item [AutoPrune = \lt{}yes\vb{}no\gt{}]
2423    \index[dir]{AutoPrune}
2424    \index[dir]{Directive!AutoPrune}
2425    If AutoPrune is set to  {\bf yes} (default), Bacula (version 1.20 or greater)
2426    will  automatically apply the File retention period and the Job  retention
2427    period for the Client at the end of the Job.  If you set {\bf AutoPrune = no},
2428    pruning will not be done,  and your Catalog will grow in size each time you
2429    run a Job.  Pruning affects only information in the catalog and not data
2430    stored in the backup archives (on Volumes).
2431
2432    \label{Director:Client:MaximumConcurrentJobs}
2433 \item [Maximum Concurrent Jobs = \lt{}number\gt{}]
2434    \index[dir]{Maximum Concurrent Jobs}
2435    \index[dir]{Directive!Maximum Concurrent Jobs}
2436    where \lt{}number\gt{}  is the maximum number of Jobs with the current Client
2437    that  can run concurrently. Note, this directive limits only Jobs  for Clients
2438    with the same name as the resource in which it appears. Any  other
2439    restrictions on the maximum concurrent jobs such as in  the Director, Job, or
2440    Storage resources will also apply in addition to  any limit specified here.
2441    The  default is set to 1, but you may set it to a larger number.
2442
2443 \label{Director:Client:MaximumBandwidthPerJob}
2444 \item [Maximum Bandwidth Per Job = \lt{}speed\gt{}]
2445 \index[dir]{Maximum Bandwidth Per Job}
2446 \index[dir]{Directive!Maximum Bandwidth Per Job}
2447
2448 The speed parameter specifies the maximum allowed bandwidth that a job may use
2449 when started for this Client. The speed parameter should be specified in
2450 k/s, Kb/s, m/s or Mb/s.
2451
2452 % \item [FD Storage Address = \lt{}address\gt{}]
2453 %    \index[dir]{FDStorageAddress}
2454 %    \index[dir]{Directive!FD Storage Address}
2455 %    \index[dir]{Storage daemon Address}
2456 %
2457 %    Where the address is a host name, a {\bf fully qualified domain name}, or an
2458 %    {\bf IP address}. Please note that the \lt{}address\gt{} as specified here
2459 %    will be transmitted to the File daemon instead of the Storage
2460 %    \texttt{Address} who will then use it to contact the Storage daemon. This
2461 %    directive can be used in NAT environment where the configuration of the
2462 %    Client resolver is not possible. Note that using this directive will not allow
2463 %    to use multiple Storage Daemon for Backup/Restore jobs.
2464 %
2465
2466    \label{Director:Client:Priority}
2467 \item [Priority = \lt{}number\gt{}]
2468    \index[dir]{Priority}
2469    \index[dir]{Directive!Priority}
2470    The number specifies the  priority of this client relative to other clients
2471    that the  Director is processing simultaneously. The priority can range  from
2472    1 to 1000. The clients are ordered such that the smaller  number priorities
2473    are performed first (not currently  implemented).
2474 \end{description}
2475
2476    The following is an example of a valid Client resource definition:
2477
2478 \footnotesize
2479 \begin{lstlisting}
2480 Client {
2481   Name = Minimatou
2482   FDAddress = minimatou
2483   Catalog = MySQL
2484   Password = very_good
2485 }
2486 \end{lstlisting}
2487 \normalsize
2488
2489 \label{StorageResource}
2490 \section{The Storage Resource}
2491 \index[general]{Resource!Storage}
2492 \index[general]{Storage Resource}
2493
2494 The Storage resource defines which Storage daemons are available for use by
2495 the Director.
2496
2497 \begin{description}
2498
2499 \item [Storage]
2500    \index[dir]{Storage}
2501    \index[dir]{Directive!Storage}
2502    Start of the Storage resources. At least one  storage resource must be
2503    specified.
2504
2505    \label{Director:Storage:Name}
2506 \item [Name = \lt{}name\gt{}]
2507    \index[dir]{Name}
2508    \index[dir]{Directive!Name}
2509    The name of the storage resource. This  name appears on the Storage directive
2510    specified in the Job resource and is required.
2511
2512    \label{Director:Storage:Address}
2513 \item [Address = \lt{}address\gt{}]
2514    \index[dir]{Address}
2515    \index[dir]{Directive!SD Address}
2516    \index[dir]{Storage daemon Address}
2517    Where the address is a host name,  a {\bf fully qualified domain name}, or an
2518    {\bf IP address}. Please note  that the \lt{}address\gt{} as specified here
2519    will be transmitted to  the File daemon who will then use it to contact the
2520    Storage daemon. Hence,  it is {\bf not}, a good idea to use {\bf localhost} as
2521    the  name but rather a fully qualified machine name or an IP address.  This
2522    directive is required.
2523
2524    \label{Director:Storage:FdStorageAddress}
2525  \item [FD Storage Address = \lt{}address\gt{}]
2526    \index[dir]{FDStorageAddress}
2527    \index[dir]{Directive!FD Storage Address} \index[dir]{Storage daemon
2528      Address} Where the address is a host name, a {\bf fully qualified domain
2529      name}, or an {\bf IP address}. Please note that the \lt{}address\gt{} as
2530    specified here will be transmitted to the File daemon instead of the
2531    \texttt{Address} who will then use it to contact the Storage daemon. This
2532    directive can be used in NAT environment where the configuration of the
2533    Client resolver is not possible.
2534
2535 \bsysimageH{BackupOverWan1}{Backup over WAN using FD Storage Address}{figdirdconf:backupwan}
2536
2537    \label{Director:Storage:SdPort}
2538 \item [SD Port = \lt{}port\gt{}]
2539    \index[dir]{SD Port}
2540    \index[dir]{Directive!SD Port}
2541    Where port is the port to use to  contact the storage daemon for information
2542    and to start jobs.  This same port number must appear in the Storage resource
2543    of the  Storage daemon's configuration file. The default is 9103.
2544
2545    \label{Director:Storage:Password}
2546 \item [Password = \lt{}password\gt{}]
2547    \index[dir]{Password}
2548    \index[dir]{Directive!Password}
2549    This is the password to be used  when establishing a connection with the
2550    Storage services. This  same password also must appear in the Director
2551    resource of the Storage  daemon's configuration file. This directive is
2552    required.  If you have either {\bf /dev/random}  {\bf bc} on your machine,
2553    Bacula will generate a random  password during the configuration process,
2554    otherwise it will  be left blank.
2555
2556    The password is plain text.  It is not generated through any special
2557    process, but it is preferable for security reasons to use random text.
2558
2559    \label{Director:Storage:Device}
2560 \item [Device = \lt{}device-name\gt{}]
2561    \index[dir]{Device}
2562    \index[dir]{Directive!Device}
2563    This directive specifies the Storage daemon's name of the device
2564    resource to be used for the storage.  If you are using an Autochanger,
2565    the name specified here should be the name of the Storage daemon's
2566    Autochanger resource rather than the name of an individual device.  This
2567    name is not the physical device name, but the logical device name as
2568    defined on the {\bf Name} directive contained in the {\bf Device} or the
2569    {\bf Autochanger} resource definition of the {\bf Storage daemon}
2570    configuration file.  You can specify any name you would like (even the
2571    device name if you prefer) up to a maximum of 127 characters in length.
2572    The physical device name associated with this device is specified in the
2573    {\bf Storage daemon} configuration file (as {\bf Archive Device}).
2574    Please take care not to define two different Storage resource directives
2575    in the Director that point to the same Device in the Storage daemon.
2576    Doing so may cause the Storage daemon to block (or hang) attempting to
2577    open the same device that is already open.  This directive is required.
2578 \label{MediaType}
2579
2580    \label{Director:Storage:MediaType}
2581 \item [Media Type = \lt{}MediaType\gt{}]
2582    \index[dir]{Media Type}
2583    \index[dir]{Directive!Media Type}
2584    This directive specifies the Media Type to be used to store the data.
2585    This is an arbitrary string of characters up to 127 maximum that you
2586    define.  It can be anything you want.  However, it is best to make it
2587    descriptive of the storage media (e.g.  File, DAT, ``HP DLT8000'', 8mm,
2588    \ldots{}).  In addition, it is essential that you make the {\bf Media Type}
2589    specification unique for each storage media type.  If you have two DDS-4
2590    drives that have incompatible formats, or if you have a DDS-4 drive and
2591    a DDS-4 autochanger, you almost certainly should specify different {\bf
2592    Media Types}.  During a restore, assuming a {\bf DDS-4} Media Type is
2593    associated with the Job, Bacula can decide to use any Storage daemon
2594    that supports Media Type {\bf DDS-4} and on any drive that supports it.
2595
2596    If you are writing to disk Volumes, you must make doubly sure that each
2597    Device resource defined in the Storage daemon (and hence in the
2598    Director's conf file) has a unique media type.  Otherwise for Bacula
2599    versions 1.38 and older, your restores may not work because Bacula
2600    will assume that you can mount any Media Type with the same name on
2601    any Device associated with that Media Type. This is possible with
2602    tape drives, but with disk drives, unless you are very clever you
2603    cannot mount a Volume in any directory -- this can be done by creating
2604    an appropriate soft link.
2605
2606    Currently Bacula permits only a single Media Type per Storage
2607    and Device definition. Consequently, if
2608    you have a drive that supports more than one Media Type, you can
2609    give a unique string to Volumes with different intrinsic Media
2610    Type (Media Type = DDS-3-4 for DDS-3 and DDS-4 types), but then
2611    those volumes will only be mounted on drives indicated with the
2612    dual type (DDS-3-4).
2613
2614    If you want to tie Bacula to using a single Storage daemon or drive, you
2615    must specify a unique Media Type for that drive.  This is an important
2616    point that should be carefully understood.  Note, this applies equally
2617    to Disk Volumes.  If you define more than one disk Device resource in
2618    your Storage daemon's conf file, the Volumes on those two devices are in
2619    fact incompatible because one can not be mounted on the other device
2620    since they are found in different directories.  For this reason, you
2621    probably should use two different Media Types for your two disk Devices
2622    (even though you might think of them as both being File types).  You can
2623    find more on this subject in the \ilink{Basic Volume
2624    Management}{DiskChapter} chapter of this manual.
2625
2626    The {\bf MediaType} specified in the Director's Storage resource, {\bf
2627    must} correspond to the {\bf Media Type} specified in the {\bf Device}
2628    resource of the {\bf Storage daemon} configuration file.  This directive
2629    is required, and it is used by the Director and the Storage daemon to
2630    ensure that a Volume automatically selected from the Pool corresponds to
2631    the physical device.  If a Storage daemon handles multiple devices (e.g.
2632    will write to various file Volumes on different partitions), this
2633    directive allows you to specify exactly which device.
2634
2635    As mentioned above, the value specified in the Director's Storage
2636    resource must agree with the value specified in the Device resource in
2637    the {\bf Storage daemon's} configuration file.  It is also an additional
2638    check so that you don't try to write data for a DLT onto an 8mm device.
2639 \label{Autochanger1}
2640
2641    \label{Director:Storage:Autochanger}
2642 \item [Autochanger = \lt{}yes\vb{}no\gt{}]
2643    \index[dir]{Autochanger}
2644    \index[dir]{Directive!Autochanger}
2645    If you specify {\bf yes} for this command (the default is {\bf no}),
2646    when you use the {\bf label} command or the {\bf add} command to create
2647    a new Volume, {\bf Bacula} will also request the Autochanger Slot
2648    number.  This simplifies creating database entries for Volumes in an
2649    autochanger.  If you forget to specify the Slot, the autochanger will
2650    not be used.  However, you may modify the Slot associated with a Volume
2651    at any time by using the {\bf update volume} or {\bf update slots}
2652    command in the console program.  When {\bf autochanger} is enabled, the
2653    algorithm used by Bacula to search for available volumes will be
2654    modified to consider only Volumes that are known to be in the
2655    autochanger's magazine.  If no {\bf in changer} volume is found, Bacula
2656    will attempt recycling, pruning, \ldots{}, and if still no volume is found,
2657    Bacula will search for any volume whether or not in the magazine.  By
2658    privileging in changer volumes, this procedure minimizes operator
2659    intervention.  The default is {\bf no}.
2660
2661    For the autochanger to be used, you must also specify {\bf Autochanger =
2662    yes} in the \ilink{Device Resource}{Autochanger} in the Storage daemon's
2663    configuration file as well as other important Storage daemon
2664    configuration information.  Please consult the \ilink{Using
2665    Autochangers}{AutochangersChapter} manual of this chapter for the
2666    details of using autochangers.
2667
2668    \label{Director:Storage:MaximumConcurrentJobs}
2669 \item [Maximum Concurrent Jobs = \lt{}number\gt{}]
2670    \index[dir]{Maximum Concurrent Jobs}
2671    \index[dir]{Directive!Maximum Concurrent Jobs}
2672    where \lt{}number\gt{}  is the maximum number of Jobs with the current
2673    Storage resource that can run concurrently.  Note, this directive limits
2674    only Jobs for Jobs using this Storage daemon.  Any other restrictions on
2675    the maximum concurrent jobs such as in the Director, Job, or Client
2676    resources will also apply in addition to any limit specified here.  The
2677    default is set to 1, but you may set it to a larger number.  However, if
2678    you set the Storage daemon's number of concurrent jobs greater than one,
2679    we recommend that you read the waring documented under \ilink{Maximum
2680    Concurrent Jobs}{DirMaxConJobs} in the Director's resource or simply
2681    turn data spooling on as documented in the \ilink{Data
2682    Spooling}{SpoolingChapter} chapter of this manual.
2683
2684   \label{AllowCompression}
2685    \label{Director:Storage:AllowCompression}
2686 \item [AllowCompression = \lt{}yes\vb{}no\gt{}]
2687    \index[dir]{AllowCompression}
2688    \index[dir]{Directive!AllowCompression}
2689
2690    This directive is optional, and if you specify {\bf No} (the default is {\bf
2691      Yes}), it will cause backups jobs running on this storage resource to run
2692    without client File Daemon compression.  This effectively overrides
2693    compression options in FileSets used by jobs which use this storage
2694    resource.
2695
2696    \label{Director:Storage:HeartbeatInterval}
2697 \item [Heartbeat Interval = \lt{}time-interval\gt{}]
2698    \index[dir]{Heartbeat Interval}
2699    \index[dir]{Directive!Heartbeat}
2700    This directive is optional and if specified will cause the Director to
2701    set a keepalive interval (heartbeat) in seconds on each of the sockets
2702    it opens for the Storage resource.  This value will override any
2703    specified at the Director level.  It is implemented only on systems
2704    (Linux, \ldots{}) that provide the {\bf setsockopt} TCP\_KEEPIDLE function.
2705    The default value is zero, which means no change is made to the socket.
2706
2707    \label{Director:Storage:End}
2708 \end{description}
2709
2710 The following is an example of a valid Storage resource definition:
2711
2712 \footnotesize
2713 \begin{lstlisting}
2714 # Definition of tape storage device
2715 Storage {
2716   Name = DLTDrive
2717   Address = lpmatou
2718   Password = storage_password # password for Storage daemon
2719   Device = "HP DLT 80"    # same as Device in Storage daemon
2720   Media Type = DLT8000    # same as MediaType in Storage daemon
2721 }
2722 \end{lstlisting}
2723 \normalsize
2724
2725 \label{PoolResource}
2726 \section{The Pool Resource}
2727 \index[general]{Resource!Pool}
2728 \index[general]{Pool Resource}
2729
2730 The Pool resource defines the set of storage Volumes (tapes or files) to be
2731 used by Bacula to write the data. By configuring different Pools, you can
2732 determine which set of Volumes (media) receives the backup data. This permits,
2733 for example, to store all full backup data on one set of Volumes and all
2734 incremental backups on another set of Volumes. Alternatively, you could assign
2735 a different set of Volumes to each machine that you backup. This is most
2736 easily done by defining multiple Pools.
2737
2738 Another important aspect of a Pool is that it contains the default attributes
2739 (Maximum Jobs, Retention Period, Recycle flag, \ldots{}) that will be given to a
2740 Volume when it is created. This avoids the need for you to answer a large
2741 number of questions when labeling a new Volume. Each of these attributes can
2742 later be changed on a Volume by Volume basis using the {\bf update} command in
2743 the console program. Note that you must explicitly specify which Pool Bacula
2744 is to use with each Job. Bacula will not automatically search for the correct
2745 Pool.
2746
2747 Most often in Bacula installations all backups for all machines (Clients) go
2748 to a single set of Volumes. In this case, you will probably only use the {\bf
2749 Default} Pool. If your backup strategy calls for you to mount a different tape
2750 each day, you will probably want to define a separate Pool for each day. For
2751 more information on this subject, please see the
2752 \ilink{Backup Strategies}{StrategiesChapter} chapter of this
2753 manual.
2754
2755
2756 To use a Pool, there are three distinct steps. First the Pool must be defined
2757 in the Director's configuration file. Then the Pool must be written to the
2758 Catalog database. This is done automatically by the Director each time that it
2759 starts, or alternatively can be done using the {\bf create} command in the
2760 console program. Finally, if you change the Pool definition in the Director's
2761 configuration file and restart Bacula, the pool will be updated alternatively
2762 you can use the {\bf update pool} console command to refresh the database
2763 image. It is this database image rather than the Director's resource image
2764 that is used for the default Volume attributes. Note, for the pool to be
2765 automatically created or updated, it must be explicitly referenced by a Job
2766 resource.
2767
2768 Next the physical media must be labeled. The labeling can either be done with
2769 the {\bf label} command in the {\bf console} program or using the {\bf btape}
2770 program. The preferred method is to use the {\bf label} command in the {\bf
2771 console} program.
2772
2773 Finally, you must add Volume names (and their attributes) to the Pool. For
2774 Volumes to be used by Bacula they must be of the same {\bf Media Type} as the
2775 archive device specified for the job (i.e. if you are going to back up to a
2776 DLT device, the Pool must have DLT volumes defined since 8mm volumes cannot be
2777 mounted on a DLT drive). The {\bf Media Type} has particular importance if you
2778 are backing up to files. When running a Job, you must explicitly specify which
2779 Pool to use. Bacula will then automatically select the next Volume to use from
2780 the Pool, but it will ensure that the {\bf Media Type} of any Volume selected
2781 from the Pool is identical to that required by the Storage resource you have
2782 specified for the Job.
2783
2784 If you use the {\bf label} command in the console program to label the
2785 Volumes, they will automatically be added to the Pool, so this last step is
2786 not normally required.
2787
2788 It is also possible to add Volumes to the database without explicitly labeling
2789 the physical volume. This is done with the {\bf add} console command.
2790
2791 As previously mentioned, each time Bacula starts, it scans all the Pools
2792 associated with each Catalog, and if the database record does not already
2793 exist, it will be created from the Pool Resource definition. {\bf Bacula}
2794 probably should do an {\bf update pool} if you change the Pool definition, but
2795 currently, you must do this manually using the {\bf update pool} command in
2796 the Console program.
2797
2798 The Pool Resource defined in the Director's configuration file
2799 (bacula-dir.conf) may contain the following directives:
2800
2801 \begin{description}
2802
2803 \item [Pool]
2804    \index[dir]{Pool}
2805    \index[dir]{Directive!Pool}
2806    Start of the Pool resource.  There must be at least one Pool resource
2807    defined.
2808
2809
2810    \label{Director:Pool:Name}
2811 \item [Name = \lt{}name\gt{}]
2812    \index[dir]{Name}
2813    \index[dir]{Directive!Name}
2814    The name of the pool.  For most applications, you will use the default
2815    pool name {\bf Default}.  This directive is required.
2816 \label{MaxVolumes}
2817
2818    \label{Director:Pool:MaximumVolumes}
2819 \item [Maximum Volumes = \lt{}number\gt{}]
2820    \index[dir]{Maximum Volumes}
2821    \index[dir]{Directive!Maximum Volumes}
2822    This directive specifies the maximum number of volumes (tapes or files)
2823    contained in the pool.  This directive is optional, if omitted or set to
2824    zero, any number of volumes will be permitted.  In general, this
2825    directive is useful for Autochangers where there is a fixed number of
2826    Volumes, or for File storage where you wish to ensure that the backups
2827    made to disk files do not become too numerous or consume too much space.
2828
2829    \label{Director:Pool:PoolType}
2830 \item [Pool Type = \lt{}type\gt{}]
2831    \index[dir]{Pool Type}
2832    \index[dir]{Directive!Pool Type}
2833    This directive defines the pool type, which corresponds to the type of
2834    Job being run.  It is required and may be one of the following:
2835
2836 \begin{bsysitemize}
2837   \item [Backup]
2838   \item [*Archive]
2839   \item [*Cloned]
2840   \item [*Migration]
2841   \item [*Copy]
2842   \item [*Save]
2843 \end{bsysitemize}
2844    Note, only Backup is current implemented.
2845
2846 \label{Director:Pool:Storage}
2847 \item [Storage = \lt{}storage-resource-name\gt{}]
2848 \index[dir]{Storage}
2849 \index[dir]{Directive!Storage}
2850    The Storage directive defines the name of the storage services where you
2851    want to backup the FileSet data.  For additional details, see the
2852    \ilink{Storage Resource Chapter}{StorageResource} of this manual.
2853    The Storage resource may also be specified in the Job resource,
2854    but the value, if any, in the Pool resource overrides any value
2855    in the Job. This Storage resource definition is not required by either
2856    the Job resource or in the Pool, but it must be specified in
2857    one or the other.  If not configuration error will result.
2858
2859    \label{Director:Pool:UseVolumeOnce}
2860 \item [Use Volume Once = \lt{}yes\vb{}no\gt{}]
2861    \index[dir]{Use Volume Once}
2862    \index[dir]{Directive!Use Volume Once}
2863    This directive if set to {\bf yes} specifies that each volume is to be
2864    used only once.  This is most useful when the Media is a file and you
2865    want a new file for each backup that is done.  The default is {\bf no}
2866    (i.e.  use volume any number of times).  This directive will most likely
2867    be phased out (deprecated), so you are recommended to use {\bf Maximum
2868    Volume Jobs = 1} instead.
2869
2870    The value defined by this directive in the bacula-dir.conf file is the
2871    default value used when a Volume is created.  Once the volume is
2872    created, changing the value in the bacula-dir.conf file will not change
2873    what is stored for the Volume.  To change the value for an existing
2874    Volume you must use the {\bf update} command in the Console.
2875
2876    Please see the notes below under {\bf Maximum Volume Jobs} concerning
2877    using this directive with multiple simultaneous jobs.
2878
2879    \label{Director:Pool:MaximumVolumeJobs}
2880 \item [Maximum Volume Jobs = \lt{}positive-integer\gt{}]
2881    \index[dir]{Maximum Volume Jobs}
2882    \index[dir]{Directive!Maximum Volume Jobs}
2883    This directive specifies the maximum number of Jobs that can be written
2884    to the Volume.  If you specify zero (the default), there is no limit.
2885    Otherwise, when the number of Jobs backed up to the Volume equals {\bf
2886    positive-integer} the Volume will be marked {\bf Used}.  When the Volume
2887    is marked {\bf Used} it can no longer be used for appending Jobs, much
2888    like the {\bf Full} status but it can be recycled if recycling is
2889    enabled, and thus used again.  By setting {\bf MaximumVolumeJobs} to
2890    one, you get the same effect as setting {\bf UseVolumeOnce = yes}.
2891
2892    The value defined by this directive in the  bacula-dir.conf
2893    file is the default value used when a Volume  is created. Once the volume is
2894    created, changing the value  in the bacula-dir.conf file will not change what
2895    is stored  for the Volume. To change the value for an existing Volume  you
2896    must use the {\bf update} command in the Console.
2897
2898    If you are running multiple simultaneous jobs, this directive may not
2899    work correctly because when a drive is reserved for a job, this
2900    directive is not taken into account, so multiple jobs may try to
2901    start writing to the Volume. At some point, when the Media record is
2902    updated, multiple simultaneous jobs may fail since the Volume can no
2903    longer be written.
2904
2905    \label{Director:Pool:MaximumVolumeFiles}
2906 \item [Maximum Volume Files = \lt{}positive-integer\gt{}]
2907    \index[dir]{Maximum Volume Files}
2908    \index[dir]{Directive!Maximum Volume Files}
2909    This directive specifies the maximum number of files that can be written
2910    to the Volume.  If you specify zero (the default), there is no limit.
2911    Otherwise, when the number of files written to the Volume equals {\bf
2912    positive-integer} the Volume will be marked {\bf Used}.  When the Volume
2913    is marked {\bf Used} it can no longer be used for appending Jobs, much
2914    like the {\bf Full} status but it can be recycled if recycling is
2915    enabled and thus used again.  This value is checked and the {\bf Used}
2916    status is set only at the end of a job that writes to the particular
2917    volume.
2918
2919    The value defined by this directive in the bacula-dir.conf file is the
2920    default value used when a Volume is created.  Once the volume is
2921    created, changing the value in the bacula-dir.conf file will not change
2922    what is stored for the Volume.  To change the value for an existing
2923    Volume you must use the {\bf update} command in the Console.
2924
2925    \label{Director:Pool:MaximumVolumeBytes}
2926 \item [Maximum Volume Bytes = \lt{}size\gt{}]
2927    \index[dir]{Maximum Volume Bytes}
2928    \index[dir]{Directive!Maximum Volume Bytes}
2929    This directive specifies the maximum number of bytes that can be written
2930    to the Volume.  If you specify zero (the default), there is no limit
2931    except the physical size of the Volume.  Otherwise, when the number of
2932    bytes written to the Volume equals {\bf size} the Volume will be marked
2933    {\bf Used}.  When the Volume is marked {\bf Used} it can no longer be
2934    used for appending Jobs, much like the {\bf Full} status but it can be
2935    recycled if recycling is enabled, and thus the Volume can be re-used
2936    after recycling.  This value is checked and the {\bf Used} status set
2937    while the job is writing to the particular volume.
2938
2939    This directive is particularly useful for restricting the size
2940    of disk volumes, and will work correctly even in the case of
2941    multiple simultaneous jobs writing to the volume.
2942
2943    The value defined by this directive in the bacula-dir.conf file is the
2944    default value used when a Volume is created.  Once the volume is
2945    created, changing the value in the bacula-dir.conf file will not change
2946    what is stored for the Volume.  To change the value for an existing
2947    Volume you must use the {\bf update} command in the Console.
2948
2949    \label{Director:Pool:VolumeUseDuration}
2950 \item [Volume Use Duration = \lt{}time-period-specification\gt{}]
2951    \index[dir]{Volume Use Duration}
2952    \index[dir]{Directive!Volume Use Duration}
2953    The Volume Use Duration directive defines the time period that the
2954    Volume can be written beginning from the time of first data write to the
2955    Volume.  If the time-period specified is zero (the default), the Volume
2956    can be written indefinitely.  Otherwise, the next time a job
2957    runs that wants to access this Volume, and the time period from the
2958    first write to the volume (the first Job written) exceeds the
2959    time-period-specification, the Volume will be marked {\bf Used}, which
2960    means that no more Jobs can be appended to the Volume, but it may be
2961    recycled if recycling is enabled. Using the command {\bf
2962    status dir} applies algorithms similar to running jobs, so
2963    during such a command, the Volume status may also be changed.
2964    Once the Volume is
2965    recycled, it will be available for use again.
2966
2967    You might use this directive, for example, if you have a Volume used for
2968    Incremental backups, and Volumes used for Weekly Full backups.  Once the
2969    Full backup is done, you will want to use a different Incremental
2970    Volume.  This can be accomplished by setting the Volume Use Duration for
2971    the Incremental Volume to six days.  I.e.  it will be used for the 6
2972    days following a Full save, then a different Incremental volume will be
2973    used.  Be careful about setting the duration to short periods such as 23
2974    hours, or you might experience problems of Bacula waiting for a tape
2975    over the weekend only to complete the backups Monday morning when an
2976    operator mounts a new tape.
2977
2978    The use duration is checked and the {\bf Used} status is set only at the
2979    end of a job that writes to the particular volume, which means that even
2980    though the use duration may have expired, the catalog entry will not be
2981    updated until the next job that uses this volume is run. This
2982    directive is not intended to be used to limit volume sizes
2983    and will not work correctly (i.e. will fail jobs) if the use
2984    duration expires while multiple simultaneous jobs are writing
2985    to the volume.
2986
2987    Please note that the value defined by this directive in the  bacula-dir.conf
2988    file is the default value used when a Volume  is created. Once the volume is
2989    created, changing the value  in the bacula-dir.conf file will not change what
2990    is stored  for the Volume. To change the value for an existing Volume  you
2991    must use the
2992    \bsysxrlink{update volume}{UpdateCommand}{console}{command} in the \consoleman{}.
2993
2994    \label{Director:Pool:CatalogFiles}
2995 \item [Catalog Files = \lt{}yes\vb{}no\gt{}]
2996    \index[dir]{Catalog Files}
2997    \index[dir]{Directive!Catalog Files}
2998    This directive defines whether or not you want the names of the files
2999    that were saved to be put into the catalog.  The default is {\bf yes}.
3000    The advantage of specifying {\bf Catalog Files = No} is that you will
3001    have a significantly smaller Catalog database.  The disadvantage is that
3002    you will not be able to produce a Catalog listing of the files backed up
3003    for each Job (this is often called Browsing).  Also, without the File
3004    entries in the catalog, you will not be able to use the Console {\bf
3005    restore} command nor any other command that references File entries.
3006 \label{PoolAutoPrune}
3007
3008    \label{Director:Pool:AutoPrune}
3009 \item [AutoPrune = \lt{}yes\vb{}no\gt{}]
3010    \index[dir]{AutoPrune}
3011    \index[dir]{Directive!AutoPrune}
3012    If AutoPrune is set to {\bf yes} (default), Bacula (version 1.20 or
3013    greater) will automatically apply the Volume Retention period when new
3014    Volume is needed and no appendable Volumes exist in the Pool.  Volume
3015    pruning causes expired Jobs (older than the {\bf Volume Retention}
3016    period) to be deleted from the Catalog and permits possible recycling of
3017    the Volume.
3018 \label{VolRetention}
3019
3020    \label{Director:Pool:VolumeRetention}
3021 \item [Volume Retention = \lt{}time-period-specification\gt{}]
3022    \index[dir]{Volume Retention}
3023    \index[dir]{Directive!Volume Retention}
3024    The Volume Retention directive defines the length of time that {\bf
3025    Bacula} will keep records associated with the Volume in
3026    the Catalog database after the End time of each Job written to the
3027    Volume.  When this time period expires, and if {\bf AutoPrune} is set to
3028    {\bf yes} Bacula may prune (remove) Job records that are older than the
3029    specified Volume Retention period if it is necessary to free up a
3030    Volume.  Recycling will not occur until it is absolutely necessary to
3031    free up a volume (i.e. no other writable volume exists).
3032    All File records associated with pruned Jobs are also
3033    pruned.  The time may be specified as seconds, minutes, hours, days,
3034    weeks, months, quarters, or years.  The {\bf Volume Retention} is
3035    applied independently of the {\bf Job Retention} and the {\bf File
3036    Retention} periods defined in the Client resource.  This means that all
3037    the retentions periods are applied in turn and that the shorter period
3038    is the one that effectively takes precedence.  Note, that when the {\bf
3039    Volume Retention} period has been reached, and it is necessary to obtain
3040    a new volume, Bacula will prune both the Job and the File records.  This
3041    pruning could also occur during a {\bf status dir} command because it
3042    uses similar algorithms for finding the next available Volume.
3043
3044    It is important to know that when the Volume Retention period expires,
3045    Bacula does not automatically recycle a Volume. It attempts to keep the
3046    Volume data intact as long as possible before over writing the Volume.
3047
3048    By defining multiple Pools with different Volume Retention periods, you
3049    may effectively have a set of tapes that is recycled weekly, another
3050    Pool of tapes that is recycled monthly and so on.  However, one must
3051    keep in mind that if your {\bf Volume Retention} period is too short, it
3052    may prune the last valid Full backup, and hence until the next Full
3053    backup is done, you will not have a complete backup of your system, and
3054    in addition, the next Incremental or Differential backup will be
3055    promoted to a Full backup.  As a consequence, the minimum {\bf Volume
3056    Retention} period should be at twice the interval of your Full backups.
3057    This means that if you do a Full backup once a month, the minimum Volume
3058    retention period should be two months.
3059
3060    The default Volume retention period is 365 days, and either the default
3061    or the value defined by this directive in the bacula-dir.conf file is
3062    the default value used when a Volume is created.  Once the volume is
3063    created, changing the value in the bacula-dir.conf file will not change
3064    what is stored for the Volume.  To change the value for an existing
3065    Volume you must use the {\bf update} command in the Console.
3066
3067 \label{Director:Pool:ActionOnPurge}
3068 \item [Action On Purge = \lt{Truncate}]
3069 \index[dir]{actiononpurge}
3070
3071 This directive \textbf{ActionOnPurge=Truncate} instructs Bacula to truncate the
3072 volume when it is purged with the \texttt{purge volume action=truncate}
3073 command. It is useful to prevent disk based volumes from consuming too much
3074 space.
3075
3076 \begin{lstlisting}
3077 Pool {
3078   Name = Default
3079   Action On Purge = Truncate
3080   ...
3081 }
3082 \end{lstlisting}
3083
3084 You can schedule the truncate operation at the end of your CatalogBackup job
3085 like in this example:
3086
3087 \begin{lstlisting}
3088 Job {
3089  Name = CatalogBackup
3090  ...
3091  RunScript {
3092    RunsWhen=After
3093    RunsOnClient=No
3094    Console = "purge volume action=all allpools storage=File"
3095  }
3096 }
3097 \end{lstlisting}
3098 \label{PoolScratchPool}
3099
3100    \label{Director:Pool:ScratchPool}
3101 \item [ScratchPool = \lt{}pool-resource-name\gt{}]
3102    \index[dir]{ScrachPool}
3103    \index[dir]{Directive!ScrachPool}
3104    This directive permits to specify a dedicate \textsl{Scratch} for the
3105    current pool. This pool will replace the special pool named \textsl{Scrach}
3106    for volume selection. For more information about \textsl{Scratch} see
3107    \ilink{Scratch Pool}{TheScratchPool} section of this manual. This is useful
3108    when using multiple storage sharing the same mediatype or when you want to
3109    dedicate volumes to a particular set of pool.
3110 \label{PoolRecyclePool}
3111
3112    \label{Director:Pool:RecyclePool}
3113 \item [RecyclePool = \lt{}pool-resource-name\gt{}]
3114    \index[dir]{RecyclePool}
3115    \index[dir]{Directive!RecyclePool}
3116    This directive defines to which pool
3117    the Volume will be placed (moved) when it is recycled. Without
3118    this directive, a Volume will remain in the same pool when it is
3119    recycled. With this directive, it can be moved automatically to any
3120    existing pool during a recycle. This directive is probably most
3121    useful when defined in the Scratch pool, so that volumes will
3122    be recycled back into the Scratch pool. For more on the see the
3123    \ilink{Scratch Pool}{TheScratchPool} section of this manual.
3124
3125    Although this directive is called RecyclePool, the Volume in
3126    question is actually moved from its current pool to the one
3127    you specify on this directive when Bacula prunes the Volume and
3128    discovers that there are no records left in the catalog and hence
3129    marks it as {\bf Purged}.
3130
3131 \label{PoolRecycle}
3132
3133    \label{Director:Pool:Recycle}
3134 \item [Recycle = \lt{}yes\vb{}no\gt{}]
3135    \index[dir]{Recycle}
3136    \index[dir]{Directive!Recycle}
3137    This directive specifies whether or not Purged Volumes may be recycled.
3138    If it is set to {\bf yes} (default) and Bacula needs a volume but finds
3139    none that are appendable, it will search for and recycle (reuse) Purged
3140    Volumes (i.e.  volumes with all the Jobs and Files expired and thus
3141    deleted from the Catalog).  If the Volume is recycled, all previous data
3142    written to that Volume will be overwritten. If Recycle is set to {\bf
3143    no}, the Volume will not be recycled, and hence, the data will remain
3144    valid.  If you want to reuse (re-write) the Volume, and the recycle flag
3145    is no (0 in the catalog), you may manually set the recycle flag (update
3146    command) for a Volume to be reused.
3147
3148    Please note that the value defined by this directive in the
3149    bacula-dir.conf file is the default value used when a Volume is created.
3150    Once the volume is created, changing the value in the bacula-dir.conf
3151    file will not change what is stored for the Volume.  To change the value
3152    for an existing Volume you must use the {\bf update} command in the
3153    Console.
3154
3155    When all Job and File records have been pruned or purged from the
3156    catalog for a particular Volume, if that Volume is marked as
3157    Append, Full, Used, or Error, it will then be marked as Purged. Only
3158    Volumes marked as Purged will be considered to be converted to the
3159    Recycled state if the {\bf Recycle} directive is set to {\bf yes}.
3160
3161 \label{RecycleOldest}
3162
3163    \label{Director:Pool:RecycleOldestVolume}
3164 \item [Recycle Oldest Volume = \lt{}yes\vb{}no\gt{}]
3165    \index[dir]{Recycle Oldest Volume}
3166    \index[dir]{Directive!Recycle Oldest Volume}
3167    This directive instructs the Director to search for the oldest used
3168    Volume in the Pool when another Volume is requested by the Storage
3169    daemon and none are available.  The catalog is then {\bf pruned}
3170    respecting the retention periods of all Files and Jobs written to this
3171    Volume.  If all Jobs are pruned (i.e. the volume is Purged), then the
3172    Volume is recycled and will be used as the next Volume to be written.
3173    This directive respects any Job, File, or Volume retention periods that
3174    you may have specified, and as such it is {\bf much} better to use this
3175    directive than the Purge Oldest Volume.
3176
3177    This directive can be useful if you have a fixed number of Volumes in the
3178    Pool and you want to cycle through them and you have specified the correct
3179    retention periods.
3180
3181    However, if you use this directive and have only one
3182    Volume in the Pool, you will immediately recycle your Volume if you fill
3183    it and Bacula needs another one. Thus your backup will be totally invalid.
3184    Please use this directive with care. The default is {\bf no}.
3185 \label{RecycleCurrent}
3186
3187
3188    \label{Director:Pool:RecycleCurrentVolume}
3189 \item [Recycle Current Volume = \lt{}yes\vb{}no\gt{}]
3190    \index[dir]{Recycle Current Volume}
3191    \index[dir]{Directive!Recycle Current Volume}
3192    If Bacula needs a new Volume, this directive instructs Bacula to Prune
3193    the volume respecting the Job and File retention periods.  If all Jobs
3194    are pruned (i.e.  the volume is Purged), then the Volume is recycled and
3195    will be used as the next Volume to be written.  This directive respects
3196    any Job, File, or Volume retention periods that you may have specified,
3197    and thus it is {\bf much} better to use it rather than the Purge Oldest
3198    Volume directive.
3199
3200    This directive can be useful if you have: a fixed number of Volumes in
3201    the Pool, you want to cycle through them, and you have specified
3202    retention periods that prune Volumes before you have cycled through the
3203    Volume in the Pool.
3204
3205    However, if you use this directive and have only one Volume in the Pool,
3206    you will immediately recycle your Volume if you fill it and Bacula needs
3207    another one.  Thus your backup will be totally invalid.  Please use this
3208    directive with care.  The default is {\bf no}.
3209 \label{PurgeOldest}
3210
3211
3212    \label{Director:Pool:PurgeOldestVolume}
3213 \item [Purge Oldest Volume = \lt{}yes\vb{}no\gt{}]
3214    \index[dir]{Purge Oldest Volume}
3215    \index[dir]{Directive!Purge Oldest Volume}
3216    This directive instructs the Director to search for the oldest used
3217    Volume in the Pool when another Volume is requested by the Storage
3218    daemon and none are available.  The catalog is then {\bf purged}
3219    irrespective of retention periods of all Files and Jobs written to this
3220    Volume.  The Volume is then recycled and will be used as the next Volume
3221    to be written.  This directive overrides any Job, File, or Volume
3222    retention periods that you may have specified.
3223
3224    This directive can be useful if you have a fixed number of Volumes in
3225    the Pool and you want to cycle through them and reusing the oldest one
3226    when all Volumes are full, but you don't want to worry about setting
3227    proper retention periods.  However, by using this option you risk losing
3228    valuable data.
3229
3230    Please be aware that {\bf Purge Oldest Volume} disregards all retention
3231    periods. If you have only a single Volume defined and you turn this
3232    variable on, that Volume will always be immediately overwritten when it
3233    fills!  So at a minimum, ensure that you have a decent number of Volumes
3234    in your Pool before running any jobs.  If you want retention periods to
3235    apply do not use this directive.  To specify a retention period, use the
3236    {\bf Volume Retention} directive (see above).
3237
3238    We {\bf highly} recommend against using this directive, because it is
3239    sure that some day, Bacula will recycle a Volume that contains current
3240    data.  The default is {\bf no}.
3241
3242    \label{Director:Pool:FileRetention}
3243 \item [File Retention = \lt{}time-period-specification\gt{}]
3244    \index[dir]{File Retention}
3245    \index[dir]{Directive!File Retention}
3246    The File Retention directive defines the length of time that  Bacula will
3247    keep File records in the Catalog database after the End time of the
3248    Job corresponding to the File records.
3249
3250    This directive takes precedence over Client directives of the same name. For
3251    example, you can decide to increase Retention times for Archive or OffSite
3252    Pool.
3253
3254    Note, this affects only records in the catalog database. It does not affect
3255    your archive backups.
3256
3257    For more information see Client documentation about
3258    \ilink{FileRetention}{FileRetention}
3259
3260    \label{Director:Pool:JobRetention}
3261 \item [Job Retention = \lt{}time-period-specification\gt{}]
3262    \index[dir]{Job Retention}
3263    \index[dir]{Directive!Job Retention}
3264
3265    The Job Retention directive defines the length of time that Bacula will keep
3266    Job records in the Catalog database after the Job End time.  As with the
3267    other retention periods, this affects only records in the catalog and not
3268    data in your archive backup.
3269
3270    This directive takes precedence over Client directives of the same name.
3271    For example, you can decide to increase Retention times for Archive or
3272    OffSite Pool.
3273
3274    For more information see Client side documentation
3275    \ilink{JobRetention}{JobRetention}
3276
3277    \label{Director:Pool:CleaningPrefix}
3278 \item [Cleaning Prefix = \lt{}string\gt{}]
3279    \index[dir]{Cleaning Prefix}
3280    \index[dir]{Directive!Cleaning Prefix}
3281    This directive defines a prefix string, which if it matches the
3282    beginning of a Volume name during labeling of a Volume, the Volume will
3283    be defined with the VolStatus set to {\bf Cleaning} and thus Bacula will
3284    never attempt to use this tape.  This is primarily for use with
3285    autochangers that accept barcodes where the convention is that barcodes
3286    beginning with {\bf CLN} are treated as cleaning tapes.
3287 \label{Label}
3288
3289    \label{Director:Pool:LabelFormat}
3290 \item [Label Format = \lt{}format\gt{}]
3291    \index[dir]{Label Format}
3292    \index[dir]{Directive!Label Format}
3293    This directive specifies the format of the labels contained in this
3294    pool.  The format directive is used as a sort of template to create new
3295    Volume names during automatic Volume labeling.
3296
3297    The {\bf format} should be specified in double quotes, and consists of
3298    letters, numbers and the special characters hyphen ({\bf -}), underscore
3299    ({\bf \_}), colon ({\bf :}), and period ({\bf .}), which are the legal
3300    characters for a Volume name.  The {\bf format} should be enclosed in
3301    double quotes (").
3302
3303    In addition, the format may contain a number of variable expansion
3304    characters which will be expanded by a complex algorithm allowing you to
3305    create Volume names of many different formats.  In all cases, the
3306    expansion process must resolve to the set of characters noted above that
3307    are legal Volume names.  Generally, these variable expansion characters
3308    begin with a dollar sign ({\bf \$}) or a left bracket ({\bf [}).  If you
3309    specify variable expansion characters, you should always enclose the
3310    format with double quote characters ({\bf "}).  For more details on
3311    variable expansion, please see the \bsysxrlink{Variable
3312    Expansion}{VarsChapter}{misc}{chapter} of the \miscman{}.
3313
3314    If no variable expansion characters are found in the string, the Volume
3315    name will be formed from the {\bf format} string appended with the
3316    a unique number that increases.  If you do not remove volumes from the
3317    pool, this number should be the number of volumes plus one, but this
3318    is not guaranteed. The unique number will be edited as four
3319    digits with leading zeros.  For example, with a {\bf Label Format =
3320    "File-"}, the first volumes will be named {\bf File-0001}, {\bf
3321    File-0002}, \ldots{}
3322
3323    With the exception of Job specific variables, you can test your {\bf
3324    LabelFormat} by using the \bsysxrlink{var}{var}{console}{command} in the
3325  \consoleman{}.
3326
3327    In almost all cases, you should enclose the format specification (part
3328    after the equal sign) in double quotes.  Please note that this directive
3329    is deprecated and is replaced in version 1.37 and greater with a Python
3330    script for creating volume names.
3331
3332 \label{Director:Pool:End}
3333 \end{description}
3334
3335 In order for a Pool to be used during a Backup Job, the Pool must have at
3336 least one Volume associated with it.  Volumes are created for a Pool using
3337 the {\bf label} or the {\bf add} commands in the {\bf Bacula Console},
3338 program.  In addition to adding Volumes to the Pool (i.e.  putting the
3339 Volume names in the Catalog database), the physical Volume must be labeled
3340 with a valid Bacula software volume label before {\bf Bacula} will accept
3341 the Volume.  This will be automatically done if you use the {\bf label}
3342 command.  Bacula can automatically label Volumes if instructed to do so,
3343 but this feature is not yet fully implemented.
3344
3345 The following is an example of a valid Pool resource definition:
3346
3347 \footnotesize
3348 \begin{lstlisting}
3349
3350 Pool {
3351   Name = Default
3352   Pool Type = Backup
3353 }
3354 \end{lstlisting}
3355 \normalsize
3356
3357 \label{TheScratchPool}
3358 \subsection{The Scratch Pool}
3359 \index[general]{Scratch Pool}
3360 In general, you can give your Pools any name you wish, but there is one
3361 important restriction: the Pool named {\bf Scratch}, if it exists behaves
3362 like a scratch pool of Volumes in that when Bacula needs a new Volume for
3363 writing and it cannot find one, it will look in the Scratch pool, and if
3364 it finds an available Volume, it will move it out of the Scratch pool into
3365 the Pool currently being used by the job.
3366
3367
3368 \label{CatalogResource}
3369 \section{The Catalog Resource}
3370 \index[general]{Resource!Catalog}
3371 \index[general]{Catalog Resource}
3372
3373 The Catalog Resource defines what catalog to use for the current job.
3374 Currently, Bacula can only handle a single database server (SQLite, MySQL,
3375 PostgreSQL) that is defined when configuring {\bf Bacula}.  However, there
3376 may be as many Catalogs (databases) defined as you wish.  For example, you
3377 may want each Client to have its own Catalog database, or you may want
3378 backup jobs to use one database and verify or restore jobs to use another
3379 database.
3380
3381 Since SQLite is compiled in, it always runs on the same machine
3382 as the Director and the database must be directly accessible (mounted) from
3383 the Director.  However, since both MySQL and PostgreSQL are networked
3384 databases, they may reside either on the same machine as the Director
3385 or on a different machine on the network.  See below for more details.
3386
3387 \begin{description}
3388
3389 \item [Catalog]
3390    \index[dir]{Catalog}
3391    \index[dir]{Directive!Catalog}
3392    Start of the Catalog resource.  At least one Catalog resource must be
3393 defined.
3394
3395
3396    \label{Director:Catalog:Name}
3397 \item [Name = \lt{}name\gt{}]
3398    \index[dir]{Name}
3399    \index[dir]{Directive!Name}
3400    The name of the Catalog.  No necessary relation to the database server
3401    name.  This name will be specified in the Client resource directive
3402    indicating that all catalog data for that Client is maintained in this
3403    Catalog.  This directive is required.
3404
3405    \label{Director:Catalog:Password}
3406 \item [password = \lt{}password\gt{}]
3407    \index[dir]{password}
3408    \index[dir]{Directive!password}
3409    This specifies the password to use when logging into the database.  This
3410    directive is required.
3411
3412    \label{Director:Catalog:DbName}
3413 \item [DB Name = \lt{}name\gt{}]
3414    \index[dir]{DB Name}
3415    \index[dir]{Directive!DB Name}
3416    This specifies the name of the database.  If you use multiple catalogs
3417    (databases), you specify which one here.  If you are using an external
3418    database server rather than the internal one, you must specify a name
3419    that is known to the server (i.e.  you explicitly created the Bacula
3420    tables using this name.  This directive is required.
3421
3422    \label{Director:Catalog:User}
3423 \item [user = \lt{}user\gt{}]
3424    \index[dir]{user}
3425    \index[dir]{Directive!user}
3426    This specifies what user name to use to log into the database.  This
3427    directive is required.
3428
3429    \label{Director:Catalog:DbSocket}
3430 \item [DB Socket = \lt{}socket-name\gt{}]
3431    \index[dir]{DB Socket}
3432    \index[dir]{Directive!DB Socket}
3433    This is the name of  a socket to use on the local host to connect to the
3434    database. This directive is used only by MySQL and is ignored by  SQLite.
3435    Normally, if neither {\bf DB Socket} or {\bf DB Address}  are specified, MySQL
3436    will use the default socket. If the DB Socket is specified, the
3437    MySQL server must reside on the same machine as the Director.
3438
3439    \label{Director:Catalog:DBAddress}
3440 \item [DB Address = \lt{}address\gt{}]
3441    \index[dir]{DB Address}
3442    \index[dir]{Directive!DB Address}
3443    This is the host address  of the database server. Normally, you would specify
3444    this instead  of {\bf DB Socket} if the database server is on another machine.
3445    In that case, you will also specify {\bf DB Port}. This directive  is used
3446    only by MySQL and PostgreSQL and is ignored by SQLite if provided.
3447    This directive is optional.
3448
3449    \label{Director:Catalog:DbPort}
3450 \item [DB Port = \lt{}port\gt{}]
3451    \index[dir]{DB Port}
3452    \index[dir]{Directive!DB Port}
3453    This defines the port to  be used in conjunction with {\bf DB Address} to
3454    access the  database if it is on another machine. This directive is used  only
3455    by MySQL and PostgreSQL and is ignored by SQLite if provided.  This
3456    directive is optional.
3457
3458 \label{Director:Catalog:End}
3459
3460 %% \item [Multiple Connections = \lt{}yes\vb{}no\gt{}]
3461
3462 %% \index[dir]{Directive!Multiple Connections}
3463 %% By default, this  directive is set to no. In that case, each job that uses
3464 the
3465 %% same Catalog will use a single connection to the catalog. It will  be shared,
3466 %% and Bacula will allow only one Job at a time to  communicate. If you set this
3467 %% directive to yes, Bacula will  permit multiple connections to the database,
3468 %% and the database  must be multi-thread capable. For SQLite and PostgreSQL,
3469 %% this is  no problem. For MySQL, you must be *very* careful to have the
3470 %% multi-thread version of the client library loaded on your system.  When this
3471 %% directive is set yes, each Job will have a separate  connection to the
3472 %% database, and the database will control the  interaction between the
3473 different
3474 %% Jobs. This can significantly  speed up the database operations if you are
3475 %% running multiple  simultaneous jobs. In addition, for SQLite and PostgreSQL,
3476 %% Bacula  will automatically enable transactions. This can significantly  speed
3477 %% up insertion of attributes in the database either for  a single Job or
3478 %% multiple simultaneous Jobs.
3479
3480 %% This directive has not been tested. Please test carefully  before running it
3481 %% in production and report back your results.
3482
3483 \end{description}
3484
3485 The following is an example of a valid Catalog resource definition:
3486
3487 \footnotesize
3488 \begin{lstlisting}
3489 Catalog
3490 {
3491   Name = SQLite
3492   dbname = bacula;
3493   user = bacula;
3494   password = ""                       # no password = no security
3495 }
3496 \end{lstlisting}
3497 \normalsize
3498
3499 or for a Catalog on another machine:
3500
3501 \footnotesize
3502 \begin{lstlisting}
3503 Catalog
3504 {
3505   Name = MySQL
3506   dbname = bacula
3507   user = bacula
3508   password = ""
3509   DB Address = remote.acme.com
3510   DB Port = 1234
3511 }
3512 \end{lstlisting}
3513 \normalsize
3514
3515 \label{MessagesResource2}
3516 \section{The Messages Resource}
3517 \index[general]{Resource!Messages}
3518 \index[general]{Messages Resource}
3519
3520 For the details of the Messages Resource, please see the
3521 \ilink{Messages Resource Chapter}{MessagesChapter} of this
3522 manual.
3523
3524 \label{ConsoleResource1}
3525 \section{The Console Resource}
3526 \index[general]{Console Resource}
3527 \index[general]{Resource!Console}
3528
3529 As of Bacula version 1.33 and higher, there are three different kinds of
3530 consoles, which the administrator or user can use to interact with the
3531 Director. These three kinds of consoles comprise three different security
3532 levels.
3533
3534 \begin{bsysitemize}
3535 \item The first console type is an {\bf anonymous} or {\bf default}  console,
3536    which has full privileges.  There is no console resource necessary for
3537    this type since the password is specified in the Director's resource and
3538    consequently such consoles do not have a name as defined on a {\bf Name
3539    =} directive.  This is the kind of console that was initially
3540    implemented in versions prior to 1.33 and remains valid.  Typically you
3541    would use it only for  administrators.
3542
3543 \item The second type of console, and new to version 1.33 and  higher is a
3544    ``named'' console defined within a Console resource in both the Director's
3545    configuration file and in the Console's configuration file.  Both the
3546    names and the passwords in these two entries must match much as is the
3547    case for Client programs.
3548
3549    This second type of console begins with absolutely no privileges except
3550    those explicitly specified in the Director's Console resource.  Thus you
3551    can have multiple Consoles with different names and passwords, sort of
3552    like multiple users, each with different privileges.  As a default,
3553    these consoles can do absolutely nothing -- no commands whatsoever.  You
3554    give them privileges or rather access to commands and resources by
3555    specifying access control lists in the Director's Console resource.  The
3556    ACLs are specified by a directive followed by a list of access names.
3557    Examples of this are shown below.
3558
3559 \item The third type of console is similar to the above mentioned  one in that
3560    it requires a Console resource definition in both the Director and the
3561    Console.  In addition, if the console name, provided on the {\bf Name =}
3562    directive, is the same as a Client name, that console is permitted to
3563    use the {\bf SetIP} command to change the Address directive in the
3564    Director's client resource to the IP address of the Console.  This
3565    permits portables or other machines using DHCP (non-fixed IP addresses)
3566    to ``notify'' the Director of their current IP address.
3567 \end{bsysitemize}
3568
3569 The Console resource is optional and need not be specified. The following
3570 directives are permitted within the Director's configuration resource:
3571
3572 \begin{description}
3573
3574    \label{Director:Console:Name}
3575 \item [Name = \lt{}name\gt{}]
3576    \index[dir]{Name}
3577    \index[dir]{Directive!Name}
3578    The name of the console. This  name must match the name specified in the
3579 Console's configuration  resource (much as is the case with Client
3580 definitions).
3581
3582    \label{Director:Console:Password}
3583 \item [Password = \lt{}password\gt{}]
3584    \index[dir]{Password}
3585    \index[dir]{Directive!Password}
3586    Specifies the password that must be supplied for a named Bacula Console
3587    to be authorized.  The same password must appear in the {\bf Console}
3588    resource of the Console configuration file.  For added security, the
3589    password is never actually passed across the network but rather a
3590    challenge response hash code created with the password.  This directive
3591    is required.  If you have either {\bf /dev/random} {\bf bc} on your
3592    machine, Bacula will generate a random password during the configuration
3593    process, otherwise it will be left blank.
3594
3595    The password is plain text.  It is not generated through any special
3596    process.  However, it is preferable for security reasons to choose
3597    random text.
3598
3599    \label{Director:Console:JobAcl}
3600 \item [JobACL = \lt{}name-list\gt{}]
3601    \index[dir]{JobACL}
3602    \index[dir]{Directive!JobACL}
3603    This directive is used to specify a list of Job resource names that can
3604    be accessed by the console.  Without this directive, the console cannot
3605    access any of the Director's Job resources.  Multiple Job resource names
3606    may be specified by separating them with commas, and/or by specifying
3607    multiple JobACL directives.  For example, the directive may be specified
3608    as:
3609
3610 \footnotesize
3611 \begin{lstlisting}
3612     JobACL = kernsave, "Backup client 1", "Backup client 2"
3613     JobACL = "RestoreFiles"
3614
3615 \end{lstlisting}
3616 \normalsize
3617
3618 With the above specification, the console can access the Director's  resources
3619 for the four jobs named on the JobACL directives,  but for no others.
3620
3621    \label{Director:Console:ClientAcl}
3622 \item [ClientACL = \lt{}name-list\gt{}]
3623    \index[dir]{ClientACL}
3624    \index[dir]{Directive!ClientACL}
3625    This directive is used to  specify a list of Client resource names that can
3626 be
3627 accessed by  the console.
3628
3629    \label{Director:Console:StorageAcl}
3630 \item [StorageACL = \lt{}name-list\gt{}]
3631    \index[dir]{StorageACL}
3632    \index[dir]{Directive!StorageACL}
3633    This directive is used to  specify a list of Storage resource names that can
3634 be accessed by  the console.
3635
3636    \label{Director:Console:ScheduleAcl}
3637 \item [ScheduleACL = \lt{}name-list\gt{}]
3638    \index[dir]{ScheduleACL}
3639    \index[dir]{Directive!ScheduleACL}
3640    This directive is used to  specify a list of Schedule resource names that can
3641    be accessed by the console.
3642
3643    \label{Director:Console:PoolAcl}
3644 \item [PoolACL = \lt{}name-list\gt{}]
3645    \index[dir]{PoolACL}
3646    \index[dir]{Directive!PoolACL}
3647    This directive is used to  specify a list of Pool resource names that can be
3648    accessed by the console.
3649
3650    \label{Director:Console:FileSetAcl}
3651 \item [FileSetACL = \lt{}name-list\gt{}]
3652    \index[dir]{FileSetACL}
3653    \index[dir]{Directive!FileSetACL}
3654    This directive is used to specify a list of FileSet resource names that
3655    can be accessed by the console.
3656
3657    \label{Director:Console:CatalogAcl}
3658 \item [CatalogACL = \lt{}name-list\gt{}]
3659    \index[dir]{CatalogACL}
3660    \index[dir]{Directive!CatalogACL}
3661    This directive is used to specify a list of Catalog resource names that
3662    can be accessed by the console.
3663
3664    \label{Director:Console:CommandAcl}
3665 \item [CommandACL = \lt{}name-list\gt{}]
3666    \index[dir]{CommandACL}
3667    \index[dir]{Directive!CommandACL}
3668    This directive is used to specify a list of of console commands that can
3669    be executed by the console.
3670
3671    \label{Director:Console:WhereAcl}
3672 \item [WhereACL = \lt{}string\gt{}]
3673    \index[dir]{WhereACL}
3674    \index[dir]{Directive!WhereACL}
3675    This directive permits you to specify where a restricted console
3676    can restore files. If this directive is not specified, only the
3677    default restore location is permitted (normally {\bf
3678    /tmp/bacula-restores}. If {\bf *all*} is specified any path the
3679    user enters will be accepted (not very secure), any other
3680    value specified (there may be multiple WhereACL directives) will
3681    restrict the user to use that path. For example, on a Unix system,
3682    if you specify ``/'', the file will be restored to the original
3683    location.  This directive is untested.
3684
3685 \end{description}
3686
3687 Aside from Director resource names and console command names, the special
3688 keyword {\bf *all*} can be specified in any of the above access control lists.
3689 When this keyword is present, any resource or command name (which ever is
3690 appropriate) will be accepted. For an example configuration file, please see
3691 the
3692 \ilink{Console Configuration}{ConsoleConfChapter} chapter of this
3693 manual.
3694
3695 \label{CounterResource}
3696 \section{The Counter Resource}
3697 \index[general]{Resource!Counter}
3698 \index[general]{Counter Resource}
3699
3700 The Counter Resource defines a counter variable that can be accessed by
3701 variable expansion used for creating Volume labels with the {\bf LabelFormat}
3702 directive. See the
3703 \ilink{LabelFormat}{Label} directive in this chapter for more
3704 details.
3705
3706 \begin{description}
3707
3708 \item [Counter]
3709    \index[dir]{Counter}
3710    \index[dir]{Directive!Counter}
3711    Start of the Counter resource.  Counter directives are optional.
3712
3713    \label{Director:Counter:Name}
3714 \item [Name = \lt{}name\gt{}]
3715    \index[dir]{Name}
3716    \index[dir]{Directive!Name}
3717    The name of the Counter.  This is the name you will use in the variable
3718 expansion  to reference the counter value.
3719
3720    \label{Director:Counter:Minimum}
3721 \item [Minimum = \lt{}integer\gt{}]
3722    \index[dir]{Minimum}
3723    \index[dir]{Directive!Minimum}
3724    This specifies the minimum  value that the counter can have. It also becomes
3725 the default.  If not supplied, zero is assumed.
3726
3727    \label{Director:Counter:Maximum}
3728 \item [Maximum = \lt{}integer\gt{}]
3729    \index[dir]{Maximum}
3730    \index[dir]{Directive!Maximum}
3731    \index[dir]{Directive!Maximum}
3732    This is the maximum value  value that the counter can have. If not specified
3733 or set to  zero, the counter can have a maximum value of 2,147,483,648  (2 to
3734 the 31 power). When the counter is incremented past  this value, it is reset
3735 to the Minimum.
3736
3737    \label{Director:Counter:*WrapCounter}
3738 \item [*WrapCounter = \lt{}counter-name\gt{}]
3739    \index[dir]{*WrapCounter}
3740    \index[dir]{Directive!*WrapCounter}
3741    If this value  is specified, when the counter is incremented past the
3742 maximum
3743 and thus reset to the minimum, the counter specified on the  {\bf WrapCounter}
3744 is incremented. (This is not currently  implemented).
3745
3746    \label{Director:Counter:Catalog}
3747 \item [Catalog = \lt{}catalog-name\gt{}]
3748    \index[dir]{Catalog}
3749    \index[dir]{Directive!Catalog}
3750    If this directive is  specified, the counter and its values will be saved in
3751 the specified catalog. If this directive is not present, the  counter will be
3752 redefined each time that Bacula is started.
3753
3754 \label{Director:Counter:End}
3755 \end{description}
3756
3757 \label{SampleDirectorConfiguration}
3758 \section{Example Director Configuration File}
3759 \index[general]{File!Example Director Configuration}
3760 \index[general]{Example Director Configuration File}
3761
3762 An example Director configuration file might be the following:
3763
3764 \footnotesize
3765 \begin{lstlisting}
3766 #
3767 # Default Bacula Director Configuration file
3768 #
3769 #  The only thing that MUST be changed is to add one or more
3770 #   file or directory names in the Include directive of the
3771 #   FileSet resource.
3772 #
3773 #  For Bacula release 1.15 (5 March 2002) -- redhat
3774 #
3775 #  You might also want to change the default email address
3776 #   from root to your address.  See the "mail" and "operator"
3777 #   directives in the Messages resource.
3778 #
3779 Director {                            # define myself
3780   Name = rufus-dir
3781   QueryFile = "/home/kern/bacula/bin/query.sql"
3782   WorkingDirectory = "/home/kern/bacula/bin/working"
3783   PidDirectory = "/home/kern/bacula/bin/working"
3784   Password = "XkSfzu/Cf/wX4L8Zh4G4/yhCbpLcz3YVdmVoQvU3EyF/"
3785 }
3786 # Define the backup Job
3787 Job {
3788   Name = "NightlySave"
3789   Type = Backup
3790   Level = Incremental                 # default
3791   Client=rufus-fd
3792   FileSet="Full Set"
3793   Schedule = "WeeklyCycle"
3794   Storage = DLTDrive
3795   Messages = Standard
3796   Pool = Default
3797 }
3798 Job {
3799   Name = "Restore"
3800   Type = Restore
3801   Client=rufus-fd
3802   FileSet="Full Set"
3803   Where = /tmp/bacula-restores
3804   Storage = DLTDrive
3805   Messages = Standard
3806   Pool = Default
3807 }
3808
3809 # List of files to be backed up
3810 FileSet {
3811   Name = "Full Set"
3812   Include {
3813     Options { signature=SHA1}
3814 #
3815 #  Put your list of files here, one per line or include an
3816 #    external list with:
3817 #
3818 #    @file-name
3819 #
3820 #  Note: / backs up everything
3821   File = /
3822 }
3823   Exclude {}
3824 }
3825 # When to do the backups
3826 Schedule {
3827   Name = "WeeklyCycle"
3828   Run = level=Full sun at 2:05
3829   Run = level=Incremental mon-sat at 2:05
3830 }
3831 # Client (File Services) to backup
3832 Client {
3833   Name = rufus-fd
3834   Address = rufus
3835   Catalog = MyCatalog
3836   Password = "MQk6lVinz4GG2hdIZk1dsKE/LxMZGo6znMHiD7t7vzF+"
3837   File Retention = 60d      # sixty day file retention
3838   Job Retention = 1y        # 1 year Job retention
3839   AutoPrune = yes           # Auto apply retention periods
3840 }
3841 # Definition of DLT tape storage device
3842 Storage {
3843   Name = DLTDrive
3844   Address = rufus
3845   Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
3846   Device = "HP DLT 80"      # same as Device in Storage daemon
3847   Media Type = DLT8000      # same as MediaType in Storage daemon
3848 }
3849 # Definition for a DLT autochanger device
3850 Storage {
3851   Name = Autochanger
3852   Address = rufus
3853   Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
3854   Device = "Autochanger"    # same as Device in Storage daemon
3855   Media Type = DLT-8000     # Different from DLTDrive
3856   Autochanger = yes
3857 }
3858 # Definition of DDS tape storage device
3859 Storage {
3860   Name = SDT-10000
3861   Address = rufus
3862   Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
3863   Device = SDT-10000        # same as Device in Storage daemon
3864   Media Type = DDS-4        # same as MediaType in Storage daemon
3865 }
3866 # Definition of 8mm tape storage device
3867 Storage {
3868   Name = "8mmDrive"
3869   Address = rufus
3870   Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
3871   Device = "Exabyte 8mm"
3872   MediaType = "8mm"
3873 }
3874 # Definition of file storage device
3875 Storage {
3876   Name = File
3877   Address = rufus
3878   Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
3879   Device = FileStorage
3880   Media Type = File
3881 }
3882 # Generic catalog service
3883 Catalog {
3884   Name = MyCatalog
3885   dbname = bacula; user = bacula; password = ""
3886 }
3887 # Reasonable message delivery -- send most everything to
3888 #   the email address and to the console
3889 Messages {
3890   Name = Standard
3891   mail = root@localhost = all, !skipped, !terminate
3892   operator = root@localhost = mount
3893   console = all, !skipped, !saved
3894 }
3895
3896 # Default pool definition
3897 Pool {
3898   Name = Default
3899   Pool Type = Backup
3900   AutoPrune = yes
3901   Recycle = yes
3902 }
3903 #
3904 # Restricted console used by tray-monitor to get the status of the director
3905 #
3906 Console {
3907   Name = Monitor
3908   Password = "GN0uRo7PTUmlMbqrJ2Gr1p0fk0HQJTxwnFyE4WSST3MWZseR"
3909   CommandACL = status, .status
3910 }
3911 \end{lstlisting}
3912 \normalsize