4 \chapter{Configuring the Director}
5 \label{DirectorChapter}
6 \index[general]{Director!Configuring the}
7 \index[general]{Configuring the Director}
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.
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.
17 \section{Director Resource Types}
18 \index[general]{Types!Director Resource}
19 \index[general]{Director Resource Types}
21 Director resource type may be one of the following:
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:
26 Note, everything revolves around a job and is tied to a job in one
31 \ilink{Director}{DirectorResource4} -- 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.
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
44 \ilink{JobDefs}{JobDefsResource} -- optional resource for
45 providing defaults for Job resources.
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
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.
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.
60 \ilink{Storage}{StorageResource2} -- to define on what physical
61 device the Volumes should be mounted. You may have one or
62 more Storage definitions.
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.
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
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, ...).
86 \section{The Director Resource}
87 \label{DirectorResource4}
88 \index[general]{Director Resource}
89 \index[general]{Resource!Director}
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.
100 Start of the Director resource. One and only one director resource must be
103 \item [Name = \lt{}name\gt{}]
104 \label{Director:Name}
106 \index[dir]{Directive!Name}
107 The director name used by the system administrator. This directive is
110 \item [Description = \lt{}text\gt{}]
111 \label{Director:Description}
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.
117 \item [Password = \lt{}UA-password\gt{}]
118 \label{Director:{Password}
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
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
135 \item [Messages = \lt{}Messages-resource-name\gt{}]
136 \label{Director:Messages}
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.
144 \item [Working Directory = \lt{}Directory\gt{}]
145 \label{Director:WorkingDirectory}
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.
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.
166 \item [Pid Directory = \lt{}Directory\gt{}]
167 \label{Director:PidDirectory}
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
177 The PID directory specified must already exist and be
178 readable and writable by the Bacula daemon referencing it
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.
184 \item [Scripts Directory = \lt{}Directory\gt{}]
185 \label{Director:ScriptsDirectory}
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
195 \item [QueryFile = \lt{}Path\gt{}]
196 \label{Director:QueryFile}
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.
205 \item [Heartbeat Interval = \lt{}time-interval\gt{}]
206 \label{Director:HeartbeatInterval}
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, ...) that provide the {\bf setsockopt} TCP\_KEEPIDLE function.
214 The default value is zero, which means no change is made to the socket.
217 \label{DirMaxConJobs}
218 \item [Maximum Concurrent Jobs = \lt{}number\gt{}]
219 \label{Director:MaximumConcurrentJobs}
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
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.
236 \item [FD Connect Timeout = \lt{}time\gt{}]
237 \label{Director:FdConnectTimeout}
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.
244 \item [SD Connect Timeout = \lt{}time\gt{}]
245 \label{Director:SdConnectTimeout}
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.
252 \item [DirAddresses = \lt{}IP-address-specification\gt{}]
253 \label{Director:DirAddresses}
254 \index[dir]{DirAddresses}
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:
265 ip = { addr = 1.2.3.4; port = 1205;}
267 addr = 1.2.3.4; port = http;}
276 ip = { addr = 1.2.3.4 }
277 ip = { addr = 201:220:222::2 }
279 addr = bluedot.thun.net
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.
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
297 \item [DirPort = \lt{}port-number\gt{}]
298 \label{Director: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)
308 \item [DirAddress = \lt{}IP-Address\gt{}]
309 \label{Director:DirAddress}
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.
321 \item [DirSourceAddress = \lt{}IP-Address\gt{}]
322 \label{Director:DirSourceAddress}
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).
331 \item[Statistics Retention = \lt{}time\gt{}]
332 \label{Director:StatisticsRetention}
333 \index[dir]{StatisticsRetention}
334 \index[dir]{Directive!StatisticsRetention}
335 \label{PruneStatistics}
337 The \texttt{Statistics Retention} directive defines the length of time that
338 Bacula will keep statistics job records in the Catalog database after the
339 Job End time. (In \texttt{JobHistory} table) When this time period expires,
340 and if user runs \texttt{prune stats} command, Bacula will prune (remove)
341 Job records that are older than the specified period.
343 Theses statistics records aren't use for restore purpose, but mainly for
344 capacity planning, billings, etc. See \ilink{Statistics chapter} for
345 additional information.
347 See the \ilink{ Configuration chapter}{Time} of this manual for additional
348 details of time specification.
350 The default is 5 years.
352 \item[VerId = \lt{}string\gt{}]
353 \label{Director:VerId}
354 \index[dir]{Directive!VerId}
355 where \lt{}string\gt{} is an identifier which can be used for support purpose.
356 This string is displayed using the \texttt{version} command.
358 \item[MaximumConsoleConnections = \lt{}number\gt{}]
359 \label{Director:MaximumConsoleConnections}
360 \index[dir]{MaximumConsoleConnections}
361 \index[dir]{Directive!MaximumConsoleConnections}
363 where \lt{}number\gt{} is the maximum number of Console Connections that
364 could run concurrently. The default is set to 20, but you may set it to a
367 \item[MaximumReloadRequests = \lt{}number\gt{}]
368 \label{Director:MaximumReloadRequests}
369 \index[dir]{MaximumReloadRequests}
370 \index[dir]{Directive!MaximumReloadRequests}
373 Where \lt{}number\gt{} is the maximum number of \texttt{reload} command that
374 can be done while jobs are running. The default is set to 32 and is usually
377 %\item[SharedStorage = \lt{}yes\vb{}no\gt{}]
378 % \label{Director:SharedStorage}
379 % \index[dir]{SharedStorage}
380 % \index[dir]{Directive!SharedStorage}
382 % The \texttt{Shared Storage} directive is a Bacula Enterprise feature that
383 % allows you to share volumes between different Storage resources. This
384 % directive should be used \textbf{only} if all \texttt{Media Type} are
385 % correctly set across all Devices.
387 % The \texttt{Shared Storage} directive should be used when using the SAN
388 % Shared Storage plugin or when accessing from the Director Storage resources
389 % directly to Devices of an Autochanger.
391 % When sharing volumes between different Storage resources, you will
392 % need also to use the \texttt{reset-storageid} script before using the
393 % \texttt{update slots} command. This script can be scheduled once a day in
397 % $ /opt/bacula/scripts/reset-storageid MediaType StorageName
399 % * update slots storage=StorageName drive=0
402 % Please contact Bacula Systems support to get help on this advanced
407 The following is an example of a valid Director resource definition:
413 WorkingDirectory = "$HOME/bacula/bin/working"
414 Password = UA_password
415 PidDirectory = "$HOME/bacula/bin/working"
416 QueryFile = "$HOME/bacula/bin/query.sql"
422 \section{The Job Resource}
424 \index[general]{Resource!Job}
425 \index[general]{Job Resource}
427 The Job resource defines a Job (Backup, Restore, ...) that Bacula must
428 perform. Each Job resource definition contains the name of a Client and
429 a FileSet to backup, the Schedule for the Job, where the data
430 are to be stored, and what media Pool can be used. In effect, each Job
431 resource must specify What, Where, How, and When or FileSet, Storage,
432 Backup/Restore/Level, and Schedule respectively. Note, the FileSet must
433 be specified for a restore job for historical reasons, but it is no longer used.
435 Only a single type ({\bf Backup}, {\bf Restore}, ...) can be specified for any
436 job. If you want to backup multiple FileSets on the same Client or multiple
437 Clients, you must define a Job for each one.
439 Note, you define only a single Job to do the Full, Differential, and
440 Incremental backups since the different backup levels are tied together by
441 a unique Job name. Normally, you will have only one Job per Client, but
442 if a client has a really huge number of files (more than several million),
443 you might want to split it into to Jobs each with a different FileSet
444 covering only part of the total files.
446 Multiple Storage daemons are not currently supported for Jobs, so if
447 you do want to use multiple storage daemons, you will need to create
448 a different Job and ensure that for each Job that the combination of
449 Client and FileSet are unique. The Client and FileSet are what Bacula
450 uses to restore a client, so if there are multiple Jobs with the same
451 Client and FileSet or multiple Storage daemons that are used, the
452 restore will not work. This problem can be resolved by defining multiple
453 FileSet definitions (the names must be different, but the contents of
454 the FileSets may be the same).
461 \index[dir]{Directive!Job}
462 Start of the Job resource. At least one Job resource is required.
464 \item [Name = \lt{}name\gt{}]
467 \index[dir]{Directive!Name}
468 The Job name. This name can be specified on the {\bf Run} command in the
469 console program to start a job. If the name contains spaces, it must be
470 specified between quotes. It is generally a good idea to give your job the
471 same name as the Client that it will backup. This permits easy
472 identification of jobs.
474 When the job actually runs, the unique Job Name will consist of the name you
475 specify here followed by the date and time the job was scheduled for
476 execution. This directive is required.
478 \item [Enabled = \lt{}yes\vb{}no\gt{}]
481 \index[dir]{Directive!Enable}
482 This directive allows you to enable or disable automatic execution
483 via the scheduler of a Job.
485 \item [Type = \lt{}job-type\gt{}]
488 \index[dir]{Directive!Type}
489 The {\bf Type} directive specifies the Job type, which may be one of the
490 following: {\bf Backup}, {\bf Restore}, {\bf Verify}, or {\bf Admin}. This
491 directive is required. Within a particular Job Type, there are also Levels
492 as discussed in the next item.
498 Run a backup Job. Normally you will have at least one Backup job for each
499 client you want to save. Normally, unless you turn off cataloging, most all
500 the important statistics and data concerning files backed up will be placed
505 Run a restore Job. Normally, you will specify only one Restore job
506 which acts as a sort of prototype that you will modify using the console
507 program in order to perform restores. Although certain basic
508 information from a Restore job is saved in the catalog, it is very
509 minimal compared to the information stored for a Backup job -- for
510 example, no File database entries are generated since no Files are
513 {\bf Restore} jobs cannot be
514 automatically started by the scheduler as is the case for Backup, Verify
515 and Admin jobs. To restore files, you must use the {\bf restore} command
521 Run a verify Job. In general, {\bf verify} jobs permit you to compare the
522 contents of the catalog to the file system, or to what was backed up. In
523 addition, to verifying that a tape that was written can be read, you can
524 also use {\bf verify} as a sort of tripwire intrusion detection.
528 Run an admin Job. An {\bf Admin} job can be used to periodically run catalog
529 pruning, if you do not want to do it at the end of each {\bf Backup} Job.
530 Although an Admin job is recorded in the catalog, very little data is saved.
535 \item [Level = \lt{}job-level\gt{}]
538 \index[dir]{Directive!Level}
539 The Level directive specifies the default Job level to be run. Each
540 different Job Type (Backup, Restore, ...) has a different set of Levels
541 that can be specified. The Level is normally overridden by a different
542 value that is specified in the {\bf Schedule} resource. This directive
543 is not required, but must be specified either by a {\bf Level} directive
544 or as an override specified in the {\bf Schedule} resource.
546 For a {\bf Backup} Job, the Level may be one of the following:
552 When the Level is set to Full all files in the FileSet whether or not
553 they have changed will be backed up.
556 \index[dir]{Incremental}
557 When the Level is set to Incremental all files specified in the FileSet
558 that have changed since the last successful backup of the the same Job
559 using the same FileSet and Client, will be backed up. If the Director
560 cannot find a previous valid Full backup then the job will be upgraded
561 into a Full backup. When the Director looks for a valid backup record
562 in the catalog database, it looks for a previous Job with:
565 \item The same Job name.
566 \item The same Client name.
567 \item The same FileSet (any change to the definition of the FileSet such as
568 adding or deleting a file in the Include or Exclude sections constitutes a
570 \item The Job was a Full, Differential, or Incremental backup.
571 \item The Job terminated normally (i.e. did not fail or was not canceled).
572 \item The Job started no longer ago than {\bf Max Full Interval}.
575 If all the above conditions do not hold, the Director will upgrade the
576 Incremental to a Full save. Otherwise, the Incremental backup will be
577 performed as requested.
579 The File daemon (Client) decides which files to backup for an
580 Incremental backup by comparing start time of the prior Job (Full,
581 Differential, or Incremental) against the time each file was last
582 "modified" (st\_mtime) and the time its attributes were last
583 "changed"(st\_ctime). If the file was modified or its attributes
584 changed on or after this start time, it will then be backed up.
586 Some virus scanning software may change st\_ctime while
587 doing the scan. For example, if the virus scanning program attempts to
588 reset the access time (st\_atime), which Bacula does not use, it will
589 cause st\_ctime to change and hence Bacula will backup the file during
590 an Incremental or Differential backup. In the case of Sophos virus
591 scanning, you can prevent it from resetting the access time (st\_atime)
592 and hence changing st\_ctime by using the {\bf \verb:--:no-reset-atime}
593 option. For other software, please see their manual.
595 When Bacula does an Incremental backup, all modified files that are
596 still on the system are backed up. However, any file that has been
597 deleted since the last Full backup remains in the Bacula catalog,
598 which means that if between a Full save and the time you do a
599 restore, some files are deleted, those deleted files will also be
600 restored. The deleted files will no longer appear in the catalog
601 after doing another Full save.
603 In addition, if you move a directory rather than copy it, the files in
604 it do not have their modification time (st\_mtime) or their attribute
605 change time (st\_ctime) changed. As a consequence, those files will
606 probably not be backed up by an Incremental or Differential backup which
607 depend solely on these time stamps. If you move a directory, and wish
608 it to be properly backed up, it is generally preferable to copy it, then
611 However, to manage deleted files or directories changes in the
612 catalog during an Incremental backup you can use \texttt{accurate}
613 mode. This is quite memory consuming process. See \ilink{Accurate
614 mode}{accuratemode} for more details.
617 \index[dir]{Differential}
618 When the Level is set to Differential
619 all files specified in the FileSet that have changed since the last
620 successful Full backup of the same Job will be backed up.
621 If the Director cannot find a
622 valid previous Full backup for the same Job, FileSet, and Client,
623 backup, then the Differential job will be upgraded into a Full backup.
624 When the Director looks for a valid Full backup record in the catalog
625 database, it looks for a previous Job with:
628 \item The same Job name.
629 \item The same Client name.
630 \item The same FileSet (any change to the definition of the FileSet such as
631 adding or deleting a file in the Include or Exclude sections constitutes a
633 \item The Job was a FULL backup.
634 \item The Job terminated normally (i.e. did not fail or was not canceled).
635 \item The Job started no longer ago than {\bf Max Full Interval}.
638 If all the above conditions do not hold, the Director will upgrade the
639 Differential to a Full save. Otherwise, the Differential backup will be
640 performed as requested.
642 The File daemon (Client) decides which files to backup for a
643 differential backup by comparing the start time of the prior Full backup
644 Job against the time each file was last "modified" (st\_mtime) and the
645 time its attributes were last "changed" (st\_ctime). If the file was
646 modified or its attributes were changed on or after this start time, it
647 will then be backed up. The start time used is displayed after the {\bf
648 Since} on the Job report. In rare cases, using the start time of the
649 prior backup may cause some files to be backed up twice, but it ensures
650 that no change is missed. As with the Incremental option, you should
651 ensure that the clocks on your server and client are synchronized or as
652 close as possible to avoid the possibility of a file being skipped.
653 Note, on versions 1.33 or greater Bacula automatically makes the
654 necessary adjustments to the time between the server and the client so
655 that the times Bacula uses are synchronized.
657 When Bacula does a Differential backup, all modified files that are
658 still on the system are backed up. However, any file that has been
659 deleted since the last Full backup remains in the Bacula catalog, which
660 means that if between a Full save and the time you do a restore, some
661 files are deleted, those deleted files will also be restored. The
662 deleted files will no longer appear in the catalog after doing another
663 Full save. However, to remove deleted files from the catalog during a
664 Differential backup is quite a time consuming process and not currently
665 implemented in Bacula. It is, however, a planned future feature.
667 As noted above, if you move a directory rather than copy it, the
668 files in it do not have their modification time (st\_mtime) or
669 their attribute change time (st\_ctime) changed. As a
670 consequence, those files will probably not be backed up by an
671 Incremental or Differential backup which depend solely on these
672 time stamps. If you move a directory, and wish it to be
673 properly backed up, it is generally preferable to copy it, then
674 delete the original. Alternatively, you can move the directory, then
675 use the {\bf touch} program to update the timestamps.
677 %% TODO: merge this with incremental
678 However, to manage deleted files or directories changes in the
679 catalog during an Differential backup you can use \texttt{accurate}
680 mode. This is quite memory consuming process. See \ilink{Accurate
681 mode}{accuratemode} for more details.
683 Every once and a while, someone asks why we need Differential
684 backups as long as Incremental backups pickup all changed files.
685 There are possibly many answers to this question, but the one
686 that is the most important for me is that a Differential backup
688 all the Incremental and Differential backups since the last Full backup
689 into a single Differential backup. This has two effects: 1. It gives
690 some redundancy since the old backups could be used if the merged backup
691 cannot be read. 2. More importantly, it reduces the number of Volumes
692 that are needed to do a restore effectively eliminating the need to read
693 all the volumes on which the preceding Incremental and Differential
694 backups since the last Full are done.
698 For a {\bf Restore} Job, no level needs to be specified.
700 For a {\bf Verify} Job, the Level may be one of the following:
705 \index[dir]{InitCatalog}
706 does a scan of the specified {\bf FileSet} and stores the file
707 attributes in the Catalog database. Since no file data is saved, you
708 might ask why you would want to do this. It turns out to be a very
709 simple and easy way to have a {\bf Tripwire} like feature using {\bf
710 Bacula}. In other words, it allows you to save the state of a set of
711 files defined by the {\bf FileSet} and later check to see if those files
712 have been modified or deleted and if any new files have been added.
713 This can be used to detect system intrusion. Typically you would
714 specify a {\bf FileSet} that contains the set of system files that
715 should not change (e.g. /sbin, /boot, /lib, /bin, ...). Normally, you
716 run the {\bf InitCatalog} level verify one time when your system is
717 first setup, and then once again after each modification (upgrade) to
718 your system. Thereafter, when your want to check the state of your
719 system files, you use a {\bf Verify} {\bf level = Catalog}. This
720 compares the results of your {\bf InitCatalog} with the current state of
725 Compares the current state of the files against the state previously
726 saved during an {\bf InitCatalog}. Any discrepancies are reported. The
727 items reported are determined by the {\bf verify} options specified on
728 the {\bf Include} directive in the specified {\bf FileSet} (see the {\bf
729 FileSet} resource below for more details). Typically this command will
730 be run once a day (or night) to check for any changes to your system
733 Please note! If you run two Verify Catalog jobs on the same client at
734 the same time, the results will certainly be incorrect. This is because
735 Verify Catalog modifies the Catalog database while running in order to
738 \item [VolumeToCatalog]
739 \index[dir]{VolumeToCatalog}
740 This level causes Bacula to read the file attribute data written to the
741 Volume from the last backup Job for the job specified on the {\bf VerifyJob}
742 directive. The file attribute data are compared to the
743 values saved in the Catalog database and any differences are reported.
744 This is similar to the {\bf DiskToCatalog} level except that instead of
745 comparing the disk file attributes to the catalog database, the
746 attribute data written to the Volume is read and compared to the catalog
747 database. Although the attribute data including the signatures (MD5 or
748 SHA1) are compared, the actual file data is not compared (it is not in
751 Please note! If you run two Verify VolumeToCatalog jobs on the same
752 client at the same time, the results will certainly be incorrect. This
753 is because the Verify VolumeToCatalog modifies the Catalog database
756 \item [DiskToCatalog]
757 \index[dir]{DiskToCatalog}
758 This level causes Bacula to read the files as they currently are on
759 disk, and to compare the current file attributes with the attributes
760 saved in the catalog from the last backup for the job specified on the
761 {\bf VerifyJob} directive. This level differs from the {\bf VolumeToCatalog}
762 level described above by the fact that it doesn't compare against a
763 previous Verify job but against a previous backup. When you run this
764 level, you must supply the verify options on your Include statements.
765 Those options determine what attribute fields are compared.
767 This command can be very useful if you have disk problems because it
768 will compare the current state of your disk against the last successful
769 backup, which may be several jobs.
771 Note, the current implementation (1.32c) does not identify files that
775 \item [Accurate = \lt{}yes\vb{}no\gt{}]
777 \index[dir]{Accurate}
778 In accurate mode, the File daemon knowns exactly which files were present
779 after the last backup. So it is able to handle deleted or renamed files.
781 When restoring a FileSet for a specified date (including "most
782 recent"), Bacula is able to restore exactly the files and
783 directories that existed at the time of the last backup prior to
784 that date including ensuring that deleted files are actually deleted,
785 and renamed directories are restored properly.
787 In this mode, the File daemon must keep data concerning all files in
788 memory. So If you do not have sufficient memory, the backup may
789 either be terribly slow or fail.
791 %% $$ memory = \sum_{i=1}^{n}(strlen(path_i + file_i) + sizeof(CurFile))$$
793 For 500.000 files (a typical desktop linux system), it will require
794 approximately 64 Megabytes of RAM on your File daemon to hold the
795 required information.
797 \item [Verify Job = \lt{}Job-Resource-Name\gt{}]
798 \label{Job:VerifyJob}
799 \index[dir]{Verify Job}
800 \index[dir]{Directive!Verify Job}
801 If you run a verify job without this directive, the last job run will be
802 compared with the catalog, which means that you must immediately follow
803 a backup by a verify command. If you specify a {\bf Verify Job} Bacula
804 will find the last job with that name that ran. This permits you to run
805 all your backups, then run Verify jobs on those that you wish to be
806 verified (most often a {\bf VolumeToCatalog}) so that the tape just
809 \item [JobDefs = \lt{}JobDefs-Resource-Name\gt{}]
812 \index[dir]{Directive!JobDefs}
813 If a JobDefs-Resource-Name is specified, all the values contained in the
814 named JobDefs resource will be used as the defaults for the current Job.
815 Any value that you explicitly define in the current Job resource, will
816 override any defaults specified in the JobDefs resource. The use of
817 this directive permits writing much more compact Job resources where the
818 bulk of the directives are defined in one or more JobDefs. This is
819 particularly useful if you have many similar Jobs but with minor
820 variations such as different Clients. A simple example of the use of
821 JobDefs is provided in the default bacula-dir.conf file.
823 \item [Bootstrap = \lt{}bootstrap-file\gt{}]
824 \label{Job:Bootstrap}
825 \index[dir]{Bootstrap}
826 \index[dir]{Directive!Bootstrap}
827 The Bootstrap directive specifies a bootstrap file that, if provided,
828 will be used during {\bf Restore} Jobs and is ignored in other Job
829 types. The {\bf bootstrap} file contains the list of tapes to be used
830 in a restore Job as well as which files are to be restored.
831 Specification of this directive is optional, and if specified, it is
832 used only for a restore job. In addition, when running a Restore job
833 from the console, this value can be changed.
835 If you use the {\bf Restore} command in the Console program, to start a
836 restore job, the {\bf bootstrap} file will be created automatically from
837 the files you select to be restored.
839 For additional details of the {\bf bootstrap} file, please see
840 \ilink{Restoring Files with the Bootstrap File}{BootstrapChapter} chapter
843 \label{writebootstrap}
844 \item [Write Bootstrap = \lt{}bootstrap-file-specification\gt{}]
845 \label{Job:WriteBootstrap}
846 \index[dir]{Write Bootstrap}
847 \index[dir]{Directive!Write Bootstrap}
848 The {\bf writebootstrap} directive specifies a file name where Bacula
849 will write a {\bf bootstrap} file for each Backup job run. This
850 directive applies only to Backup Jobs. If the Backup job is a Full
851 save, Bacula will erase any current contents of the specified file
852 before writing the bootstrap records. If the Job is an Incremental
854 save, Bacula will append the current bootstrap record to the end of the
857 Using this feature, permits you to constantly have a bootstrap file that
858 can recover the current state of your system. Normally, the file
859 specified should be a mounted drive on another machine, so that if your
860 hard disk is lost, you will immediately have a bootstrap record
861 available. Alternatively, you should copy the bootstrap file to another
862 machine after it is updated. Note, it is a good idea to write a separate
863 bootstrap file for each Job backed up including the job that backs up
864 your catalog database.
866 If the {\bf bootstrap-file-specification} begins with a vertical bar
867 (\verb+|+), Bacula will use the specification as the name of a program to which
868 it will pipe the bootstrap record. It could for example be a shell
869 script that emails you the bootstrap record.
871 On versions 1.39.22 or greater, before opening the file or executing the
872 specified command, Bacula performs
873 \ilink{character substitution}{character substitution} like in RunScript
874 directive. To automatically manage your bootstrap files, you can use
875 this in your {\bf JobDefs} resources:
878 Write Bootstrap = "%c_%n.bsr"
883 For more details on using this file, please see the chapter entitled
884 \ilink{The Bootstrap File}{BootstrapChapter} of this manual.
886 \item [Client = \lt{}client-resource-name\gt{}]
889 \index[dir]{Directive!Client}
890 The Client directive specifies the Client (File daemon) that will be used in
891 the current Job. Only a single Client may be specified in any one Job. The
892 Client runs on the machine to be backed up, and sends the requested files to
893 the Storage daemon for backup, or receives them when restoring. For
894 additional details, see the
895 \ilink{Client Resource section}{ClientResource2} of this chapter.
896 This directive is required.
898 \item [FileSet = \lt{}FileSet-resource-name\gt{}]
901 \index[dir]{Directive!FileSet}
902 The FileSet directive specifies the FileSet that will be used in the
903 current Job. The FileSet specifies which directories (or files) are to
904 be backed up, and what options to use (e.g. compression, ...). Only a
905 single FileSet resource may be specified in any one Job. For additional
906 details, see the \ilink{FileSet Resource section}{FileSetResource} of
907 this chapter. This directive is required.
909 \item [Base = \lt{}job-resource-name, ...\gt{}]
912 \index[dir]{Directive!Base}
913 The Base directive permits to specify the list of jobs that will be used during
914 Full backup as base. This directive is optional. See the \ilink{Base Job
915 chapter}{basejobs} for more information.
917 \item [Messages = \lt{}messages-resource-name\gt{}]
919 \index[dir]{Messages}
920 \index[dir]{Directive!Messages}
921 The Messages directive defines what Messages resource should be used for
922 this job, and thus how and where the various messages are to be
923 delivered. For example, you can direct some messages to a log file, and
924 others can be sent by email. For additional details, see the
925 \ilink{Messages Resource}{MessagesChapter} Chapter of this manual. This
926 directive is required.
928 \item [Pool = \lt{}pool-resource-name\gt{}]
931 \index[dir]{Directive!Pool}
932 The Pool directive defines the pool of Volumes where your data can be
933 backed up. Many Bacula installations will use only the {\bf Default}
934 pool. However, if you want to specify a different set of Volumes for
935 different Clients or different Jobs, you will probably want to use
936 Pools. For additional details, see the \ilink{Pool Resource
937 section}{PoolResource} of this chapter. This directive is required.
939 \item [Full Backup Pool = \lt{}pool-resource-name\gt{}]
940 \label{Job:FullBackupPool}
941 \index[dir]{Full Backup Pool}
942 \index[dir]{Directive!Full Backup Pool}
943 The {\it Full Backup Pool} specifies a Pool to be used for Full backups.
944 It will override any Pool specification during a Full backup. This
945 directive is optional.
947 \item [Differential Backup Pool = \lt{}pool-resource-name\gt{}]
948 \label{Job:DifferentialBackupPool}
949 \index[dir]{Differential Backup Pool}
950 \index[dir]{Directive!Differential Backup Pool}
951 The {\it Differential Backup Pool} specifies a Pool to be used for
952 Differential backups. It will override any Pool specification during a
953 Differential backup. This directive is optional.
955 \item [Incremental Backup Pool = \lt{}pool-resource-name\gt{}]
956 \label{Job:IncrementalBackupPool}
957 \index[dir]{Incremental Backup Pool}
958 \index[dir]{Directive!Incremental Backup Pool}
959 The {\it Incremental Backup Pool} specifies a Pool to be used for
960 Incremental backups. It will override any Pool specification during an
961 Incremental backup. This directive is optional.
963 \item [Schedule = \lt{}schedule-name\gt{}]
965 \index[dir]{Schedule}
966 \index[dir]{Directive!Schedule}
967 The Schedule directive defines what schedule is to be used for the Job.
968 The schedule in turn determines when the Job will be automatically
969 started and what Job level (i.e. Full, Incremental, ...) is to be run.
970 This directive is optional, and if left out, the Job can only be started
971 manually using the Console program. Although you may specify only a
972 single Schedule resource for any one job, the Schedule resource may
973 contain multiple {\bf Run} directives, which allow you to run the Job at
974 many different times, and each {\bf run} directive permits overriding
975 the default Job Level Pool, Storage, and Messages resources. This gives
976 considerable flexibility in what can be done with a single Job. For
977 additional details, see the \ilink{Schedule Resource
978 Chapter}{ScheduleResource} of this manual.
981 \item [Storage = \lt{}storage-resource-name\gt{}]
984 \index[dir]{Directive!Storage}
985 The Storage directive defines the name of the storage services where you
986 want to backup the FileSet data. For additional details, see the
987 \ilink{Storage Resource Chapter}{StorageResource2} of this manual.
988 The Storage resource may also be specified in the Job's Pool resource,
989 in which case the value in the Pool resource overrides any value
990 in the Job. This Storage resource definition is not required by either
991 the Job resource or in the Pool, but it must be specified in
992 one or the other, if not an error will result.
994 \item [Max Start Delay = \lt{}time\gt{}]
995 \label{Job:MaxStartDelay}
996 \index[dir]{Max Start Delay}
997 \index[dir]{Directive!Max Start Delay}
998 The time specifies the maximum delay between the scheduled time and the
999 actual start time for the Job. For example, a job can be scheduled to
1000 run at 1:00am, but because other jobs are running, it may wait to run.
1001 If the delay is set to 3600 (one hour) and the job has not begun to run
1002 by 2:00am, the job will be canceled. This can be useful, for example,
1003 to prevent jobs from running during day time hours. The default is 0
1004 which indicates no limit.
1006 \item [Max Run Time = \lt{}time\gt{}]
1007 \label{Job:MaxRunTime}
1008 \index[dir]{Max Run Time}
1009 \index[dir]{Directive!Max Run Time}
1010 The time specifies the maximum allowed time that a job may run, counted
1011 from when the job starts, ({\bf not} necessarily the same as when the
1014 By default, the the watchdog thread will kill any Job that has run more
1015 than 6 days. The maximum watchdog timeout is independent of MaxRunTime
1016 and cannot be changed.
1019 \item [Incremental|Differential Max Wait Time = \lt{}time\gt{}]
1020 \label{Job:IncrementalWaitRunTime}
1021 \index[dir]{Incremental Wait Run Time}
1022 \index[dir]{Differential Wait Run Time}
1023 \index[dir]{Directive!Differential Max Wait Time}
1024 Theses directives have been deprecated in favor of
1025 \texttt{Incremental|Differential Max Run Time} since bacula 2.3.18.
1027 \item [Incremental Max Run Time = \lt{}time\gt{}]
1028 \label{Job:IncrementalMaxRunTime}
1029 \index[dir]{Incremental Max Run Time}
1030 \index[dir]{Directive!Incremental Max Run Time}
1031 The time specifies the maximum allowed time that an Incremental backup job may
1032 run, counted from when the job starts, ({\bf not} necessarily the same as when
1033 the job was scheduled).
1035 \item [Differential Max Wait Time = \lt{}time\gt{}]
1036 \label{Job:DifferentialMaxRunTime}
1037 \index[dir]{Differential Max Run Time}
1038 \index[dir]{Directive!Differential Max Run Time}
1039 The time specifies the maximum allowed time that a Differential backup job may
1040 run, counted from when the job starts, ({\bf not} necessarily the same as when
1041 the job was scheduled).
1043 \item [Max Run Sched Time = \lt{}time\gt{}]
1044 \label{Job:MaxRunSchedTime}
1045 \index[dir]{Max Run Sched Time}
1046 \index[dir]{Directive!Max Run Sched Time}
1048 The time specifies the maximum allowed time that a job may run, counted from
1049 when the job was scheduled. This can be useful to prevent jobs from running
1050 during working hours. We can see it like \texttt{Max Start Delay + Max Run
1053 \item [Max Wait Time = \lt{}time\gt{}]
1054 \label{Job:MaxWaitTime}
1055 \index[dir]{Max Wait Time}
1056 \index[dir]{Directive!Max Wait Time}
1057 The time specifies the maximum allowed time that a job may block waiting
1058 for a resource (such as waiting for a tape to be mounted, or waiting for
1059 the storage or file daemons to perform their duties), counted from the
1060 when the job starts, ({\bf not} necessarily the same as when the job was
1061 scheduled). This directive works as expected since bacula 2.3.18.
1063 \begin{figure}[htbp]
1065 \includegraphics[width=13cm]{\idir different_time.eps}
1066 \caption{Job time control directives}
1067 \label{fig:differenttime}
1070 \item [Maximum Bandwidth = \lt{}speed\gt{}]
1071 \label{Job:MaximumBandwidth}
1072 \index[dir]{Maximum Bandwidth}
1073 \index[dir]{Directive!Maximum Bandwidth}
1075 The speed parameter specifies the maximum allowed bandwidth that a job may
1076 use. The speed parameter should be specified in k/s, kb/s, m/s or mb/s.
1078 \item [Max Full Interval = \lt{}time\gt{}]
1079 \label{Job:MaxFullInterval}
1080 \index[dir]{Max Full Interval}
1081 \index[dir]{Directive!Max Full Interval}
1082 The time specifies the maximum allowed age (counting from start time) of
1083 the most recent successful Full backup that is required in order to run
1084 Incremental or Differential backup jobs. If the most recent Full backup
1085 is older than this interval, Incremental and Differential backups will be
1086 upgraded to Full backups automatically. If this directive is not present,
1087 or specified as 0, then the age of the previous Full backup is not
1090 \label{PreferMountedVolumes}
1091 \item [Prefer Mounted Volumes = \lt{}yes\vb{}no\gt{}]
1092 \label{Job:Prefer Mounted Volumes}
1093 \index[dir]{Prefer Mounted Volumes}
1094 \index[dir]{Directive!Prefer Mounted Volumes}
1095 If the Prefer Mounted Volumes directive is set to {\bf yes} (default
1096 yes), the Storage daemon is requested to select either an Autochanger or
1097 a drive with a valid Volume already mounted in preference to a drive
1098 that is not ready. This means that all jobs will attempt to append
1099 to the same Volume (providing the Volume is appropriate -- right Pool,
1100 ... for that job), unless you are using multiple pools.
1101 If no drive with a suitable Volume is available, it
1102 will select the first available drive. Note, any Volume that has
1103 been requested to be mounted, will be considered valid as a mounted
1104 volume by another job. This if multiple jobs start at the same time
1105 and they all prefer mounted volumes, the first job will request the
1106 mount, and the other jobs will use the same volume.
1108 If the directive is set to {\bf no}, the Storage daemon will prefer
1109 finding an unused drive, otherwise, each job started will append to the
1110 same Volume (assuming the Pool is the same for all jobs). Setting
1111 Prefer Mounted Volumes to no can be useful for those sites
1112 with multiple drive autochangers that prefer to maximize backup
1113 throughput at the expense of using additional drives and Volumes.
1114 This means that the job will prefer to use an unused drive rather
1115 than use a drive that is already in use.
1117 Despite the above, we recommend against setting this directive to
1119 it tends to add a lot of swapping of Volumes between the different
1120 drives and can easily lead to deadlock situations in the Storage
1121 daemon. We will accept bug reports against it, but we cannot guarantee
1122 that we will be able to fix the problem in a reasonable time.
1124 A better alternative for using multiple drives is to use multiple
1125 pools so that Bacula will be forced to mount Volumes from those Pools
1126 on different drives.
1128 \item [Prune Jobs = \lt{}yes\vb{}no\gt{}]
1129 \label{Job:PruneJobs}
1130 \index[dir]{Prune Jobs}
1131 \index[dir]{Directive!Prune Jobs}
1132 Normally, pruning of Jobs from the Catalog is specified on a Client by
1133 Client basis in the Client resource with the {\bf AutoPrune} directive.
1134 If this directive is specified (not normally) and the value is {\bf
1135 yes}, it will override the value specified in the Client resource. The
1136 default is {\bf no}.
1139 \item [Prune Files = \lt{}yes\vb{}no\gt{}]
1140 \label{Job:PruneFiles}
1141 \index[dir]{Prune Files}
1142 \index[dir]{Directive!Prune Files}
1143 Normally, pruning of Files from the Catalog is specified on a Client by
1144 Client basis in the Client resource with the {\bf AutoPrune} directive.
1145 If this directive is specified (not normally) and the value is {\bf
1146 yes}, it will override the value specified in the Client resource. The
1147 default is {\bf no}.
1149 \item [Prune Volumes = \lt{}yes\vb{}no\gt{}]
1150 \label{Job:PruneVolumes}
1151 \index[dir]{Prune Volumes}
1152 \index[dir]{Directive!Prune Volumes}
1153 Normally, pruning of Volumes from the Catalog is specified on a Pool by
1154 Pool basis in the Pool resource with the {\bf AutoPrune} directive.
1155 Note, this is different from File and Job pruning which is done on a
1156 Client by Client basis. If this directive is specified (not normally)
1157 and the value is {\bf yes}, it will override the value specified in the
1158 Pool resource. The default is {\bf no}.
1160 \item [RunScript \{\lt{}body-of-runscript\gt{}\}]
1161 \label{Job:RunScript}
1162 \index[dir]{RunScript}
1163 \index[dir]{Directive!Run Script}
1165 The RunScript directive behaves like a resource in that it
1166 requires opening and closing braces around a number of directives
1167 that make up the body of the runscript.
1169 The specified {\bf Command} (see below for details) is run as an external
1170 program prior or after the current Job. This is optional. By default, the
1171 program is executed on the Client side like in \texttt{ClientRunXXXJob}.
1173 \textbf{Console} options are special commands that are sent to the director instead
1174 of the OS. At this time, console command ouputs are redirected to log with
1177 You can use following console command : \texttt{delete}, \texttt{disable},
1178 \texttt{enable}, \texttt{estimate}, \texttt{list}, \texttt{llist},
1179 \texttt{memory}, \texttt{prune}, \texttt{purge}, \texttt{reload},
1180 \texttt{status}, \texttt{setdebug}, \texttt{show}, \texttt{time},
1181 \texttt{trace}, \texttt{update}, \texttt{version}, \texttt{.client},
1182 \texttt{.jobs}, \texttt{.pool}, \texttt{.storage}. See console chapter for
1183 more information. You need to specify needed information on command line, nothing
1184 will be prompted. Example :
1187 Console = "prune files client=%c"
1188 Console = "update stats age=3"
1191 You can specify more than one Command/Console option per RunScript.
1193 You can use following options may be specified in the body
1196 \begin{tabular}{|c|c|c|l}
1197 Options & Value & Default & Information \\
1200 Runs On Success & Yes/No & {\it Yes} & Run command if JobStatus is successful\\
1202 Runs On Failure & Yes/No & {\it No} & Run command if JobStatus isn't successful\\
1204 Runs On Client & Yes/No & {\it Yes} & Run command on client\\
1206 Runs When & Before|After|Always|\textsl{AfterVSS} & {\it Never} & When run commands\\
1208 Fail Job On Error & Yes/No & {\it Yes} & Fail job if script returns
1209 something different from 0 \\
1211 Command & & & Path to your script\\
1213 Console & & & Console command\\
1218 Any output sent by the command to standard output will be included in the
1219 Bacula job report. The command string must be a valid program name or name
1222 In addition, the command string is parsed then fed to the OS,
1223 which means that the path will be searched to execute your specified
1224 command, but there is no shell interpretation, as a consequence, if you
1225 invoke complicated commands or want any shell features such as redirection
1226 or piping, you must call a shell script and do it inside that script.
1228 Before submitting the specified command to the operating system, Bacula
1229 performs character substitution of the following characters:
1231 \label{character substitution}
1237 %d = Daemon's name (Such as host-dir or host-fd)
1238 %D = Director's name (Also valid on file daemon)
1239 %e = Job Exit Status
1240 %f = Job FileSet (Only on director side)
1247 %p = Pool name (Only on director side)
1249 %t = Job type (Backup, ...)
1250 %v = Volume name (Only on director side)
1251 %w = Storage name (Only on director side)
1252 %x = Spooling enabled? ("yes" or "no")
1257 Some character substitutions are not available in all situations. The Job Exit
1258 Status code \%e edits the following values:
1261 \index[dir]{Exit Status}
1268 \item Unknown term code
1271 Thus if you edit it on a command line, you will need to enclose
1272 it within some sort of quotes.
1275 You can use these following shortcuts:\\
1277 \begin{tabular}{|c|c|c|c|c|c}
1278 Keyword & RunsOnSuccess & RunsOnFailure & FailJobOnError & Runs On Client & RunsWhen \\
1280 Run Before Job & & & Yes & No & Before \\
1282 Run After Job & Yes & No & & No & After \\
1284 Run After Failed Job & No & Yes & & No & After \\
1286 Client Run Before Job & & & Yes & Yes & Before \\
1288 Client Run After Job & Yes & No & & Yes & After \\
1296 Command = "/etc/init.d/apache stop"
1302 Command = "/etc/init.d/apache start"
1306 {\bf Notes about ClientRunBeforeJob}
1308 For compatibility reasons, with this shortcut, the command is executed
1309 directly when the client recieve it. And if the command is in error, other
1310 remote runscripts will be discarded. To be sure that all commands will be
1311 sent and executed, you have to use RunScript syntax.
1313 {\bf Special Windows Considerations}
1315 You can run scripts just after snapshots initializations with
1316 \textsl{AfterVSS} keyword.
1318 In addition, for a Windows client, please take
1319 note that you must ensure a correct path to your script. The script or
1320 program can be a .com, .exe or a .bat file. If you just put the program
1321 name in then Bacula will search using the same rules that cmd.exe uses
1322 (current directory, Bacula bin directory, and PATH). It will even try the
1323 different extensions in the same order as cmd.exe.
1324 The command can be anything that cmd.exe or command.com will recognize
1325 as an executable file.
1327 However, if you have slashes in the program name then Bacula figures you
1328 are fully specifying the name, so you must also explicitly add the three
1329 character extension.
1331 The command is run in a Win32 environment, so Unix like commands will not
1332 work unless you have installed and properly configured Cygwin in addition
1333 to and separately from Bacula.
1335 The System \%Path\% will be searched for the command. (under the
1336 environment variable dialog you have have both System Environment and
1337 User Environment, we believe that only the System environment will be
1338 available to bacula-fd, if it is running as a service.)
1340 System environment variables can be referenced with \%var\% and
1341 used as either part of the command name or arguments.
1343 So if you have a script in the Bacula\\bin directory then the following lines
1348 Client Run Before Job = systemstate
1350 Client Run Before Job = systemstate.bat
1352 Client Run Before Job = "systemstate"
1354 Client Run Before Job = "systemstate.bat"
1356 ClientRunBeforeJob = "\"C:/Program Files/Bacula/systemstate.bat\""
1360 The outer set of quotes is removed when the configuration file is parsed.
1361 You need to escape the inner quotes so that they are there when the code
1362 that parses the command line for execution runs so it can tell what the
1368 ClientRunBeforeJob = "\"C:/Program Files/Software
1369 Vendor/Executable\" /arg1 /arg2 \"foo bar\""
1373 The special characters
1377 will need to be quoted,
1378 if they are part of a filename or argument.
1380 If someone is logged in, a blank "command" window running the commands
1381 will be present during the execution of the command.
1383 Some Suggestions from Phil Stracchino for running on Win32 machines with
1384 the native Win32 File daemon:
1387 \item You might want the ClientRunBeforeJob directive to specify a .bat
1388 file which runs the actual client-side commands, rather than trying
1389 to run (for example) regedit /e directly.
1390 \item The batch file should explicitly 'exit 0' on successful completion.
1391 \item The path to the batch file should be specified in Unix form:
1393 ClientRunBeforeJob = "c:/bacula/bin/systemstate.bat"
1395 rather than DOS/Windows form:
1397 ClientRunBeforeJob =
1399 "c:\textbackslash{}bacula\textbackslash{}bin\textbackslash{}systemstate.bat"
1403 For Win32, please note that there are certain limitations:
1405 ClientRunBeforeJob = "C:/Program Files/Bacula/bin/pre-exec.bat"
1407 Lines like the above do not work because there are limitations of
1408 cmd.exe that is used to execute the command.
1409 Bacula prefixes the string you supply with {\bf cmd.exe /c }. To test that
1410 your command works you should type {\bf cmd /c "C:/Program Files/test.exe"} at a
1411 cmd prompt and see what happens. Once the command is correct insert a
1412 backslash (\textbackslash{}) before each double quote ("), and
1413 then put quotes around the whole thing when putting it in
1414 the director's .conf file. You either need to have only one set of quotes
1415 or else use the short name and don't put quotes around the command path.
1417 Below is the output from cmd's help as it relates to the command line
1418 passed to the /c option.
1421 If /C or /K is specified, then the remainder of the command line after
1422 the switch is processed as a command line, where the following logic is
1423 used to process quote (") characters:
1427 If all of the following conditions are met, then quote characters
1428 on the command line are preserved:
1431 \item exactly two quote characters.
1432 \item no special characters between the two quote characters,
1433 where special is one of:
1437 \item there are one or more whitespace characters between the
1438 the two quote characters.
1439 \item the string between the two quote characters is the name
1440 of an executable file.
1443 \item Otherwise, old behavior is to see if the first character is
1444 a quote character and if so, strip the leading character and
1445 remove the last quote character on the command line, preserving
1446 any text after the last quote character.
1451 The following example of the use of the Client Run Before Job directive was
1452 submitted by a user:\\
1453 You could write a shell script to back up a DB2 database to a FIFO. The shell
1463 db2 BACKUP DATABASE mercuryd TO $DIR/dbpipe WITHOUT PROMPTING &
1468 The following line in the Job resource in the bacula-dir.conf file:
1471 Client Run Before Job = "su - mercuryd -c \"/u01/mercuryd/backupdb.sh '%t'
1476 When the job is run, you will get messages from the output of the script
1477 stating that the backup has started. Even though the command being run is
1478 backgrounded with \&, the job will block until the "db2 BACKUP DATABASE"
1479 command, thus the backup stalls.
1481 To remedy this situation, the "db2 BACKUP DATABASE" line should be changed to
1486 db2 BACKUP DATABASE mercuryd TO $DIR/dbpipe WITHOUT PROMPTING > $DIR/backup.log
1491 It is important to redirect the input and outputs of a backgrounded command to
1492 /dev/null to prevent the script from blocking.
1494 \item [Run Before Job = \lt{}command\gt{}]
1495 \label{Job:RunBeforeJob}
1496 \index[dir]{Run Before Job}
1497 \index[dir]{Directive!Run Before Job}
1498 \index[dir]{Directive!Run Before Job}
1499 The specified {\bf command} is run as an external program prior to running the
1500 current Job. This directive is not required, but if it is defined, and if the
1501 exit code of the program run is non-zero, the current Bacula job will be
1505 Run Before Job = "echo test"
1507 it's equivalent to :
1510 Command = "echo test"
1516 Lutz Kittler has pointed out that using the RunBeforeJob directive can be a
1517 simple way to modify your schedules during a holiday. For example, suppose
1518 that you normally do Full backups on Fridays, but Thursday and Friday are
1519 holidays. To avoid having to change tapes between Thursday and Friday when
1520 no one is in the office, you can create a RunBeforeJob that returns a
1521 non-zero status on Thursday and zero on all other days. That way, the
1522 Thursday job will not run, and on Friday the tape you inserted on Wednesday
1523 before leaving will be used.
1525 \item [Run After Job = \lt{}command\gt{}]
1526 \label{Job:RunAfterJob}
1527 \index[dir]{Run After Job}
1528 \index[dir]{Directive!Run After Job}
1529 The specified {\bf command} is run as an external program if the current
1530 job terminates normally (without error or without being canceled). This
1531 directive is not required. If the exit code of the program run is
1532 non-zero, Bacula will print a warning message. Before submitting the
1533 specified command to the operating system, Bacula performs character
1534 substitution as described above for the {\bf RunScript} directive.
1536 An example of the use of this directive is given in the
1537 \ilink{Tips Chapter}{JobNotification} of this manual.
1539 See the {\bf Run After Failed Job} if you
1540 want to run a script after the job has terminated with any
1543 \item [Run After Failed Job = \lt{}command\gt{}]
1544 \label{Job:RunAfterJob}
1545 \index[dir]{Run After Job}
1546 \index[dir]{Directive!Run After Job}
1547 The specified {\bf command} is run as an external program after the current
1548 job terminates with any error status. This directive is not required. The
1549 command string must be a valid program name or name of a shell script. If
1550 the exit code of the program run is non-zero, Bacula will print a
1551 warning message. Before submitting the specified command to the
1552 operating system, Bacula performs character substitution as described above
1553 for the {\bf RunScript} directive. Note, if you wish that your script
1554 will run regardless of the exit status of the Job, you can use this :
1557 Command = "echo test"
1561 RunsOnSuccess = yes # default, you can drop this line
1565 An example of the use of this directive is given in the
1566 \ilink{Tips Chapter}{JobNotification} of this manual.
1569 \item [Client Run Before Job = \lt{}command\gt{}]
1570 \label{Job:ClientRunBeforeJob}
1571 \index[dir]{Client Run Before Job}
1572 \index[dir]{Directive!Client Run Before Job}
1573 This directive is the same as {\bf Run Before Job} except that the
1574 program is run on the client machine. The same restrictions apply to
1575 Unix systems as noted above for the {\bf RunScript}.
1577 \item [Client Run After Job = \lt{}command\gt{}]
1578 \label{Job:ClientRunAfterJob}
1579 \index[dir]{Client Run After Job}
1580 \index[dir]{Directive!Client Run After Job}
1581 The specified {\bf command} is run on the client machine as soon
1582 as data spooling is complete in order to allow restarting applications
1583 on the client as soon as possible. .
1585 Note, please see the notes above in {\bf RunScript}
1586 concerning Windows clients.
1588 \item [Rerun Failed Levels = \lt{}yes\vb{}no\gt{}]
1589 \label{Job:RerunFailedLevels}
1590 \index[dir]{Rerun Failed Levels}
1591 \index[dir]{Directive!Rerun Failed Levels}
1592 If this directive is set to {\bf yes} (default no), and Bacula detects that
1593 a previous job at a higher level (i.e. Full or Differential) has failed,
1594 the current job level will be upgraded to the higher level. This is
1595 particularly useful for Laptops where they may often be unreachable, and if
1596 a prior Full save has failed, you wish the very next backup to be a Full
1597 save rather than whatever level it is started as.
1599 There are several points that must be taken into account when using this
1600 directive: first, a failed job is defined as one that has not terminated
1601 normally, which includes any running job of the same name (you need to
1602 ensure that two jobs of the same name do not run simultaneously);
1603 secondly, the {\bf Ignore FileSet Changes} directive is not considered
1604 when checking for failed levels, which means that any FileSet change will
1607 \item [Spool Data = \lt{}yes\vb{}no\gt{}]
1608 \label{Job:SpoolData}
1609 \index[dir]{Spool Data}
1610 \index[dir]{Directive!Spool Data}
1612 If this directive is set to {\bf yes} (default no), the Storage daemon will
1613 be requested to spool the data for this Job to disk rather than write it
1614 directly to the Volume (normally a tape).
1616 Thus the data is written in large blocks to the Volume rather than small
1617 blocks. This directive is particularly useful when running multiple
1618 simultaneous backups to tape. Once all the data arrives or the spool
1619 files' maximum sizes are reached, the data will be despooled and written
1622 Spooling data prevents interleaving date from several job and reduces or
1623 eliminates tape drive stop and start commonly known as "shoe-shine".
1625 We don't recommend using this option if you are writing to a disk file
1626 using this option will probably just slow down the backup jobs.
1628 NOTE: When this directive is set to yes, Spool Attributes is also
1629 automatically set to yes.
1631 \item [SpoolData=yes\vb{}no]
1632 \label{Job:SpoolData}
1633 \index[dir]{SpoolData}
1634 \index[dir]{Directive!SpoolData}
1635 tells Bacula to request the Storage daemon to spool data to a disk file
1636 before writing it to the Volume (normally a tape).
1638 \item [Spool Attributes = \lt{}yes\vb{}no\gt{}]
1639 \label{Job:SpoolAttributes}
1640 \index[dir]{Spool Attributes}
1641 \index[dir]{Directive!Spool Attributes}
1643 \index[general]{slow}
1644 \index[dir]{Backups!slow}
1645 \index[general]{Backups!slow}
1646 The default is set to {\bf no}, which means that the File attributes are
1647 sent by the Storage daemon to the Director as they are stored on tape.
1648 However, if you want to avoid the possibility that database updates will
1649 slow down writing to the tape, you may want to set the value to {\bf
1650 yes}, in which case the Storage daemon will buffer the File attributes
1651 and Storage coordinates to a temporary file in the Working Directory,
1652 then when writing the Job data to the tape is completed, the attributes
1653 and storage coordinates will be sent to the Director.
1655 NOTE: When Spool Data is set to yes, Spool Attributes is also
1656 automatically set to yes.
1658 \item [SpoolSize={\it bytes}]
1659 \label{Job:SpoolSize}
1660 \index[dir]{SpoolSize}
1661 \index[dir]{Directive!SpoolSize}
1662 where the bytes specify the maximum spool size for this job.
1663 The default is take from Device Maximum Spool Size limit.
1664 This directive is available only in Bacula version 2.3.5 or
1668 \item [Where = \lt{}directory\gt{}]
1671 \index[dir]{Directive!Where}
1672 This directive applies only to a Restore job and specifies a prefix to
1673 the directory name of all files being restored. This permits files to
1674 be restored in a different location from which they were saved. If {\bf
1675 Where} is not specified or is set to backslash ({\bf /}), the files will
1676 be restored to their original location. By default, we have set {\bf
1677 Where} in the example configuration files to be {\bf
1678 /tmp/bacula-restores}. This is to prevent accidental overwriting of
1681 \item [Add Prefix = \lt{}directory\gt{}]
1682 \label{confaddprefix}
1683 \label{Job:AddPrefix}
1684 \index[dir]{AddPrefix}
1685 \index[dir]{Directive!AddPrefix}
1686 This directive applies only to a Restore job and specifies a prefix to the
1687 directory name of all files being restored. This will use \ilink{File
1688 Relocation}{filerelocation} feature implemented in Bacula 2.1.8 or later.
1690 \item [Add Suffix = \lt{}extention\gt{}]
1691 \label{Job:AddSuffix}
1692 \index[dir]{AddSuffix}
1693 \index[dir]{Directive!AddSuffix}
1694 This directive applies only to a Restore job and specifies a suffix to all
1695 files being restored. This will use \ilink{File Relocation}{filerelocation}
1696 feature implemented in Bacula 2.1.8 or later.
1698 Using \texttt{Add Suffix=.old}, \texttt{/etc/passwd} will be restored to
1699 \texttt{/etc/passwsd.old}
1701 \item [Strip Prefix = \lt{}directory\gt{}]
1702 \label{Job:StripPrefix}
1703 \index[dir]{StripPrefix}
1704 \index[dir]{Directive!StripPrefix}
1705 This directive applies only to a Restore job and specifies a prefix to remove
1706 from the directory name of all files being restored. This will use the
1707 \ilink{File Relocation}{filerelocation} feature implemented in Bacula 2.1.8
1710 Using \texttt{Strip Prefix=/etc}, \texttt{/etc/passwd} will be restored to
1713 Under Windows, if you want to restore \texttt{c:/files} to \texttt{d:/files},
1721 \item [RegexWhere = \lt{}expressions\gt{}]
1722 \label{Job:RegexWhere}
1723 \index[dir]{RegexWhere}
1724 \index[dir]{Directive!RegexWhere}
1725 This directive applies only to a Restore job and specifies a regex filename
1726 manipulation of all files being restored. This will use \ilink{File
1727 Relocation}{filerelocation} feature implemented in Bacula 2.1.8 or later.
1729 For more informations about how use this option, see
1730 \ilink{this}{useregexwhere}.
1732 \item [Replace = \lt{}replace-option\gt{}]
1734 \index[dir]{Replace}
1735 \index[dir]{Directive!Replace}
1736 This directive applies only to a Restore job and specifies what happens
1737 when Bacula wants to restore a file or directory that already exists.
1738 You have the following options for {\bf replace-option}:
1744 when the file to be restored already exists, it is deleted and then
1745 replaced by the copy that was backed up. This is the default value.
1748 \index[dir]{ifnewer}
1749 if the backed up file (on tape) is newer than the existing file, the
1750 existing file is deleted and replaced by the back up.
1753 \index[dir]{ifolder}
1754 if the backed up file (on tape) is older than the existing file, the
1755 existing file is deleted and replaced by the back up.
1759 if the backed up file already exists, Bacula skips restoring this file.
1762 \item [Prefix Links=\lt{}yes\vb{}no\gt{}]
1763 \label{Job:PrefixLinks}
1764 \index[dir]{Prefix Links}
1765 \index[dir]{Directive!Prefix Links}
1766 If a {\bf Where} path prefix is specified for a recovery job, apply it
1767 to absolute links as well. The default is {\bf No}. When set to {\bf
1768 Yes} then while restoring files to an alternate directory, any absolute
1769 soft links will also be modified to point to the new alternate
1770 directory. Normally this is what is desired -- i.e. everything is self
1771 consistent. However, if you wish to later move the files to their
1772 original locations, all files linked with absolute names will be broken.
1774 \item [Maximum Concurrent Jobs = \lt{}number\gt{}]
1775 \label{Job:MaximumConcurrentJobs}
1776 \index[dir]{Maximum Concurrent Jobs}
1777 \index[dir]{Directive!Maximum Concurrent Jobs}
1778 where \lt{}number\gt{} is the maximum number of Jobs from the current
1779 Job resource that can run concurrently. Note, this directive limits
1780 only Jobs with the same name as the resource in which it appears. Any
1781 other restrictions on the maximum concurrent jobs such as in the
1782 Director, Client, or Storage resources will also apply in addition to
1783 the limit specified here. The default is set to 1, but you may set it
1784 to a larger number. We strongly recommend that you read the WARNING
1785 documented under \ilink{ Maximum Concurrent Jobs}{DirMaxConJobs} in the
1786 Director's resource.
1788 \item [Reschedule On Error = \lt{}yes\vb{}no\gt{}]
1789 \label{Job:RescheduleOnError}
1790 \index[dir]{Reschedule On Error}
1791 \index[dir]{Directive!Reschedule On Error}
1792 If this directive is enabled, and the job terminates in error, the job
1793 will be rescheduled as determined by the {\bf Reschedule Interval} and
1794 {\bf Reschedule Times} directives. If you cancel the job, it will not
1795 be rescheduled. The default is {\bf no} (i.e. the job will not be
1798 This specification can be useful for portables, laptops, or other
1799 machines that are not always connected to the network or switched on.
1801 \item [Reschedule Interval = \lt{}time-specification\gt{}]
1802 \label{Job:RescheduleInterval}
1803 \index[dir]{Reschedule Interval}
1804 \index[dir]{Directive!Reschedule Interval}
1805 If you have specified {\bf Reschedule On Error = yes} and the job
1806 terminates in error, it will be rescheduled after the interval of time
1807 specified by {\bf time-specification}. See \ilink{the time
1808 specification formats}{Time} in the Configure chapter for details of
1809 time specifications. If no interval is specified, the job will not be
1810 rescheduled on error.
1812 \item [Reschedule Times = \lt{}count\gt{}]
1813 \label{Job:RescheduleTimes}
1814 \index[dir]{Reschedule Times}
1815 \index[dir]{Directive!Reschedule Times}
1816 This directive specifies the maximum number of times to reschedule the
1817 job. If it is set to zero (the default) the job will be rescheduled an
1818 indefinite number of times.
1820 \item [Allow Duplicate Jobs = \lt{}yes\vb{}no\gt{}]
1821 \label{Job:AllowDuplicateJobs}
1822 \index[general]{Allow Duplicate Jobs}
1824 \begin{figure}[htbp]
1826 \includegraphics[width=13cm]{\idir duplicate-real.eps}
1827 \caption{Allow Duplicate Jobs usage}
1828 \label{fig:allowduplicatejobs}
1831 A duplicate job in the sense we use it here means a second or subsequent job
1832 with the same name starts. This happens most frequently when the first job
1833 runs longer than expected because no tapes are available.
1835 If this directive is enabled duplicate jobs will be run. If
1836 the directive is set to {\bf no} (default) then only one job of a given name
1837 may run at one time, and the action that Bacula takes to ensure only
1838 one job runs is determined by the other directives (see below).
1840 If {\bf Allow Duplicate Jobs} is set to {\bf no} and two jobs
1841 are present and none of the three directives given below permit
1842 cancelling a job, then the current job (the second one started)
1845 \item [Allow Higher Duplicates = \lt{}yes\vb{}no\gt{}]
1846 \label{Job:AllowHigherDuplicates}
1847 \index[general]{Allow Higher Duplicates}
1848 This directive was implemented in version 5.0.0, but does not work
1849 as expected. If used, it should always be set to no. In later versions
1850 of Bacula the directive is disabled (disregarded).
1853 \item [Cancel Lower Level Duplicates = \lt{}yes\vb{}no\gt{}]
1854 \label{Job:CancelLowerLevelDuplicates}
1855 \index[general]{Cancel Lower Level Duplicates}
1856 If \textbf{Allow Duplicates Jobs} is set to \textbf{no} and this
1857 directive is set to \textbf{yes}, Bacula will choose between duplicated
1858 jobs the one with the highest level. For example, it will cancel a
1859 previous Incremental to run a Full backup. It works only for Backup
1860 jobs. The default is \texttt{no}. If the levels of the duplicated
1861 jobs are the same, nothing is done and the other
1862 Cancel XXX Duplicate directives will be examined.
1864 \item [Cancel Queued Duplicates = \lt{}yes\vb{}no\gt{}]
1865 \label{Job:CancelQueuedDuplicates}
1866 \index[general]{Cancel Queued Duplicates}
1867 If {\bf Allow Duplicate Jobs} is set to {\bf no} and
1868 if this directive is set to {\bf yes} any job that is
1869 already queued to run but not yet running will be canceled.
1870 The default is {\bf no}.
1872 \item[Cancel Running Duplicates = \lt{}yes\vb{}no\gt{}]
1873 \label{Job:CancelRunningDuplicates}
1874 \index[general]{Cancel Running Duplicates}
1875 If {\bf Allow Duplicate Jobs} is set to {\bf no} and
1876 if this directive is set to {\bf yes} any job that is already running
1877 will be canceled. The default is {\bf no}.
1880 %%\item[DuplicateJobProximity = \lt{}time-specification\gt{}]
1881 %%\index[general]{Duplicate Job Proximity}
1882 %% This directive permits to determine if two jobs are really duplicated.
1883 %% If the first one is running for long time, this is probably not a good
1884 %% idea to cancel it.
1886 \item [Run = \lt{}job-name\gt{}]
1889 \index[dir]{Directive!Run}
1890 \index[dir]{Clone a Job}
1891 The Run directive (not to be confused with the Run option in a
1892 Schedule) allows you to start other jobs or to clone jobs. By using the
1893 cloning keywords (see below), you can backup
1894 the same data (or almost the same data) to two or more drives
1895 at the same time. The {\bf job-name} is normally the same name
1896 as the current Job resource (thus creating a clone). However, it
1897 may be any Job name, so one job may start other related jobs.
1899 The part after the equal sign must be enclosed in double quotes,
1900 and can contain any string or set of options (overrides) that you
1901 can specify when entering the Run command from the console. For
1902 example {\bf storage=DDS-4 ...}. In addition, there are two special
1903 keywords that permit you to clone the current job. They are {\bf level=\%l}
1904 and {\bf since=\%s}. The \%l in the level keyword permits
1905 entering the actual level of the current job and the \%s in the since
1906 keyword permits putting the same time for comparison as used on the
1907 current job. Note, in the case of the since keyword, the \%s must be
1908 enclosed in double quotes, and thus they must be preceded by a backslash
1909 since they are already inside quotes. For example:
1912 run = "Nightly-backup level=%l since=\"%s\" storage=DDS-4"
1915 A cloned job will not start additional clones, so it is not
1916 possible to recurse.
1918 Please note that all cloned jobs, as specified in the Run directives are
1919 submitted for running before the original job is run (while it is being
1920 initialized). This means that any clone job will actually start before
1921 the original job, and may even block the original job from starting
1922 until the original job finishes unless you allow multiple simultaneous
1923 jobs. Even if you set a lower priority on the clone job, if no other
1924 jobs are running, it will start before the original job.
1926 If you are trying to prioritize jobs by using the clone feature (Run
1927 directive), you will find it much easier to do using a RunScript
1928 resource, or a RunBeforeJob directive.
1931 \item [Priority = \lt{}number\gt{}]
1932 \label{Job:Priority}
1933 \index[dir]{Priority}
1934 \index[dir]{Directive!Priority}
1935 This directive permits you to control the order in which your jobs will
1936 be run by specifying a positive non-zero number. The higher the number,
1937 the lower the job priority. Assuming you are not running concurrent jobs,
1938 all queued jobs of priority 1 will run before queued jobs of priority 2
1939 and so on, regardless of the original scheduling order.
1941 The priority only affects waiting jobs that are queued to run, not jobs
1942 that are already running. If one or more jobs of priority 2 are already
1943 running, and a new job is scheduled with priority 1, the currently
1944 running priority 2 jobs must complete before the priority 1 job is
1945 run, unless Allow Mixed Priority is set.
1947 The default priority is 10.
1949 If you want to run concurrent jobs you should
1950 keep these points in mind:
1953 \item See \ilink{Running Concurrent Jobs}{ConcurrentJobs} on how to setup
1956 \item Bacula concurrently runs jobs of only one priority at a time. It
1957 will not simultaneously run a priority 1 and a priority 2 job.
1959 \item If Bacula is running a priority 2 job and a new priority 1 job is
1960 scheduled, it will wait until the running priority 2 job terminates even
1961 if the Maximum Concurrent Jobs settings would otherwise allow two jobs
1962 to run simultaneously.
1964 \item Suppose that bacula is running a priority 2 job and a new priority 1
1965 job is scheduled and queued waiting for the running priority 2 job to
1966 terminate. If you then start a second priority 2 job, the waiting
1967 priority 1 job will prevent the new priority 2 job from running
1968 concurrently with the running priority 2 job. That is: as long as there
1969 is a higher priority job waiting to run, no new lower priority jobs will
1970 start even if the Maximum Concurrent Jobs settings would normally allow
1971 them to run. This ensures that higher priority jobs will be run as soon
1975 If you have several jobs of different priority, it may not best to start
1976 them at exactly the same time, because Bacula must examine them one at a
1977 time. If by Bacula starts a lower priority job first, then it will run
1978 before your high priority jobs. If you experience this problem, you may
1979 avoid it by starting any higher priority jobs a few seconds before lower
1980 priority ones. This insures that Bacula will examine the jobs in the
1981 correct order, and that your priority scheme will be respected.
1983 \label{AllowMixedPriority}
1984 \item [Allow Mixed Priority = \lt{}yes\vb{}no\gt{}]
1985 \label{Job:AllowMixedPriority}
1986 \index[dir]{Allow Mixed Priority}
1987 This directive is only implemented in version 2.5 and later. When
1988 set to {\bf yes} (default {\bf no}), this job may run even if lower
1989 priority jobs are already running. This means a high priority job
1990 will not have to wait for other jobs to finish before starting.
1991 The scheduler will only mix priorities when all running jobs have
1994 Note that only higher priority jobs will start early. Suppose the
1995 director will allow two concurrent jobs, and that two jobs with
1996 priority 10 are running, with two more in the queue. If a job with
1997 priority 5 is added to the queue, it will be run as soon as one of
1998 the running jobs finishes. However, new priority 10 jobs will not
1999 be run until the priority 5 job has finished.
2001 \label{WritePartAfterJob}
2002 \item [Write Part After Job = \lt{}yes\vb{}no\gt{}]
2003 \label{Job:WritePartAfterJob}
2004 \index[dir]{Write Part After Job}
2005 \index[dir]{Directive!Write Part After Job}
2006 This directive is only implemented in version 1.37 and later.
2007 If this directive is set to {\bf yes} (default {\bf no}), a new part file
2008 will be created after the job is finished.
2010 It should be set to {\bf yes} when writing to devices that require mount
2011 (for example DVD), so you are sure that the current part, containing
2012 this job's data, is written to the device, and that no data is left in
2013 the temporary file on the hard disk. However, on some media, like DVD+R
2014 and DVD-R, a lot of space (about 10Mb) is lost every time a part is
2015 written. So, if you run several jobs each after another, you could set
2016 this directive to {\bf no} for all jobs, except the last one, to avoid
2017 wasting too much space, but to ensure that the data is written to the
2018 medium when all jobs are finished.
2020 This directive is ignored with tape and FIFO devices.
2024 The following is an example of a valid Job resource definition:
2031 Level = Incremental # default
2033 FileSet="Minou Full Set"
2036 Schedule = "MinouWeeklyCycle"
2042 \section{The JobDefs Resource}
2043 \label{JobDefsResource}
2044 \index[general]{JobDefs Resource}
2045 \index[general]{Resource!JobDefs}
2047 The JobDefs resource permits all the same directives that can appear in a Job
2048 resource. However, a JobDefs resource does not create a Job, rather it can be
2049 referenced within a Job to provide defaults for that Job. This permits you to
2050 concisely define several nearly identical Jobs, each one referencing a JobDefs
2051 resource which contains the defaults. Only the changes from the defaults need to
2052 be mentioned in each Job.
2054 \section{The Schedule Resource}
2055 \label{ScheduleResource}
2056 \index[general]{Resource!Schedule}
2057 \index[general]{Schedule Resource}
2059 The Schedule resource provides a means of automatically scheduling a Job as
2060 well as the ability to override the default Level, Pool, Storage and Messages
2061 resources. If a Schedule resource is not referenced in a Job, the Job can only
2062 be run manually. In general, you specify an action to be taken and when.
2067 \index[dir]{Schedule}
2068 \index[dir]{Directive!Schedule}
2069 Start of the Schedule directives. No {\bf Schedule} resource is
2070 required, but you will need at least one if you want Jobs to be
2071 automatically started.
2073 \item [Name = \lt{}name\gt{}]
2074 \label{Schdedule:Name}
2076 \index[dir]{Directive!Name}
2077 The name of the schedule being defined. The Name directive is required.
2079 \item [Run = \lt{}Job-overrides\gt{} \lt{}Date-time-specification\gt{}]
2080 \label{Schdedule:Run}
2082 \index[dir]{Directive!Run}
2083 The Run directive defines when a Job is to be run, and what overrides if
2084 any to apply. You may specify multiple {\bf run} directives within a
2085 {\bf Schedule} resource. If you do, they will all be applied (i.e.
2086 multiple schedules). If you have two {\bf Run} directives that start at
2087 the same time, two Jobs will start at the same time (well, within one
2088 second of each other).
2090 The {\bf Job-overrides} permit overriding the Level, the Storage, the
2091 Messages, and the Pool specifications provided in the Job resource. In
2092 addition, the FullPool, the IncrementalPool, and the DifferentialPool
2093 specifications permit overriding the Pool specification according to
2094 what backup Job Level is in effect.
2096 By the use of overrides, you may customize a particular Job. For
2097 example, you may specify a Messages override for your Incremental
2098 backups that outputs messages to a log file, but for your weekly or
2099 monthly Full backups, you may send the output by email by using a
2100 different Messages override.
2102 {\bf Job-overrides} are specified as: {\bf keyword=value} where the
2103 keyword is Level, Storage, Messages, Pool, FullPool, DifferentialPool,
2104 or IncrementalPool, and the {\bf value} is as defined on the respective
2105 directive formats for the Job resource. You may specify multiple {\bf
2106 Job-overrides} on one {\bf Run} directive by separating them with one or
2107 more spaces or by separating them with a trailing comma. For example:
2113 \index[dir]{Directive!Level}
2114 is all files in the FileSet whether or not they have changed.
2116 \item [Level=Incremental]
2118 \index[dir]{Directive!Level}
2119 is all files that have changed since the last backup.
2123 \index[dir]{Directive!Pool}
2124 specifies to use the Pool named {\bf Weekly}.
2126 \item [Storage=DLT\_Drive]
2127 \index[dir]{Storage}
2128 \index[dir]{Directive!Storage}
2129 specifies to use {\bf DLT\_Drive} for the storage device.
2131 \item [Messages=Verbose]
2132 \index[dir]{Messages}
2133 \index[dir]{Directive!Messages}
2134 specifies to use the {\bf Verbose} message resource for the Job.
2136 \item [FullPool=Full]
2137 \index[dir]{FullPool}
2138 \index[dir]{Directive!FullPool}
2139 specifies to use the Pool named {\bf Full} if the job is a full backup, or
2141 upgraded from another type to a full backup.
2143 \item [DifferentialPool=Differential]
2144 \index[dir]{DifferentialPool}
2145 \index[dir]{Directive!DifferentialPool}
2146 specifies to use the Pool named {\bf Differential} if the job is a
2147 differential backup.
2149 \item [IncrementalPool=Incremental]
2150 \index[dir]{IncrementalPool}
2151 \index[dir]{Directive!IncrementalPool}
2152 specifies to use the Pool named {\bf Incremental} if the job is an
2156 \item [WritePartAfterJob=yes\vb{}no]
2157 \index[dir]{WritePartAfterJob}
2158 \index[dir]{Directive!WritePartAfterJob}
2159 tells Bacula to request the Storage daemon to write the current part
2160 file to the device when the job is finished (see \ilink{Write Part After
2161 Job directive in the Job resource}{WritePartAfterJob}). Please note,
2162 this directive is implemented only in version 1.37 and later. The
2163 default is yes. We strongly recommend that you keep this set to yes
2164 otherwise, when the last job has finished one part will remain in the
2165 spool file and restore may or may not work.
2169 {\bf Date-time-specification} determines when the Job is to be run. The
2170 specification is a repetition, and as a default Bacula is set to run a job at
2171 the beginning of the hour of every hour of every day of every week of every
2172 month of every year. This is not normally what you want, so you must specify
2173 or limit when you want the job to run. Any specification given is assumed to
2174 be repetitive in nature and will serve to override or limit the default
2175 repetition. This is done by specifying masks or times for the hour, day of the
2176 month, day of the week, week of the month, week of the year, and month when
2177 you want the job to run. By specifying one or more of the above, you can
2178 define a schedule to repeat at almost any frequency you want.
2180 Basically, you must supply a {\bf month}, {\bf day}, {\bf hour}, and {\bf
2181 minute} the Job is to be run. Of these four items to be specified, {\bf day}
2182 is special in that you may either specify a day of the month such as 1, 2,
2183 ... 31, or you may specify a day of the week such as Monday, Tuesday, ...
2184 Sunday. Finally, you may also specify a week qualifier to restrict the
2185 schedule to the first, second, third, fourth, or fifth week of the month.
2187 For example, if you specify only a day of the week, such as {\bf Tuesday} the
2188 Job will be run every hour of every Tuesday of every Month. That is the {\bf
2189 month} and {\bf hour} remain set to the defaults of every month and all
2192 Note, by default with no other specification, your job will run at the
2193 beginning of every hour. If you wish your job to run more than once in any
2194 given hour, you will need to specify multiple {\bf run} specifications each
2195 with a different minute.
2197 The date/time to run the Job can be specified in the following way in
2204 <week-keyword> = 1st | 2nd | 3rd | 4th | 5th | first |
2205 second | third | fourth | fifth
2206 <wday-keyword> = sun | mon | tue | wed | thu | fri | sat |
2207 sunday | monday | tuesday | wednesday |
2208 thursday | friday | saturday
2209 <week-of-year-keyword> = w00 | w01 | ... w52 | w53
2210 <month-keyword> = jan | feb | mar | apr | may | jun | jul |
2211 aug | sep | oct | nov | dec | january |
2212 february | ... | december
2213 <daily-keyword> = daily
2214 <weekly-keyword> = weekly
2215 <monthly-keyword> = monthly
2216 <hourly-keyword> = hourly
2217 <digit> = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0
2218 <number> = <digit> | <digit><number>
2219 <12hour> = 0 | 1 | 2 | ... 12
2220 <hour> = 0 | 1 | 2 | ... 23
2221 <minute> = 0 | 1 | 2 | ... 59
2222 <day> = 1 | 2 | ... 31
2223 <time> = <hour>:<minute> |
2224 <12hour>:<minute>am |
2226 <time-spec> = <at-keyword> <time> |
2228 <date-keyword> = <void-keyword> <weekly-keyword>
2229 <day-range> = <day>-<day>
2230 <month-range> = <month-keyword>-<month-keyword>
2231 <wday-range> = <wday-keyword>-<wday-keyword>
2232 <range> = <day-range> | <month-range> |
2234 <date> = <date-keyword> | <day> | <range>
2235 <date-spec> = <date> | <date-spec>
2236 <day-spec> = <day> | <wday-keyword> |
2237 <day> | <wday-range> |
2238 <week-keyword> <wday-keyword> |
2239 <week-keyword> <wday-range> |
2241 <month-spec> = <month-keyword> | <month-range> |
2243 <date-time-spec> = <month-spec> <day-spec> <time-spec>
2249 Note, the Week of Year specification wnn follows the ISO standard definition
2250 of the week of the year, where Week 1 is the week in which the first Thursday
2251 of the year occurs, or alternatively, the week which contains the 4th of
2252 January. Weeks are numbered w01 to w53. w00 for Bacula is the week that
2253 precedes the first ISO week (i.e. has the first few days of the year if any
2254 occur before Thursday). w00 is not defined by the ISO specification. A week
2255 starts with Monday and ends with Sunday.
2257 According to the NIST (US National Institute of Standards and Technology),
2258 12am and 12pm are ambiguous and can be defined to anything. However,
2259 12:01am is the same as 00:01 and 12:01pm is the same as 12:01, so Bacula
2260 defines 12am as 00:00 (midnight) and 12pm as 12:00 (noon). You can avoid
2261 this abiguity (confusion) by using 24 hour time specifications (i.e. no
2262 am/pm). This is the definition in Bacula version 2.0.3 and later.
2264 An example schedule resource that is named {\bf WeeklyCycle} and runs a job
2265 with level full each Sunday at 2:05am and an incremental job Monday through
2266 Saturday at 2:05am is:
2271 Name = "WeeklyCycle"
2272 Run = Level=Full sun at 2:05
2273 Run = Level=Incremental mon-sat at 2:05
2278 An example of a possible monthly cycle is as follows:
2283 Name = "MonthlyCycle"
2284 Run = Level=Full Pool=Monthly 1st sun at 2:05
2285 Run = Level=Differential 2nd-5th sun at 2:05
2286 Run = Level=Incremental Pool=Daily mon-sat at 2:05
2291 The first of every month:
2297 Run = Level=Full on 1 at 2:05
2298 Run = Level=Incremental on 2-31 at 2:05
2309 Run = Level=Full hourly at 0:05
2310 Run = Level=Full hourly at 0:15
2311 Run = Level=Full hourly at 0:25
2312 Run = Level=Full hourly at 0:35
2313 Run = Level=Full hourly at 0:45
2314 Run = Level=Full hourly at 0:55
2319 \section{Technical Notes on Schedules}
2320 \index[general]{Schedules!Technical Notes on}
2321 \index[general]{Technical Notes on Schedules}
2323 Internally Bacula keeps a schedule as a bit mask. There are six masks and a
2324 minute field to each schedule. The masks are hour, day of the month (mday),
2325 month, day of the week (wday), week of the month (wom), and week of the year
2326 (woy). The schedule is initialized to have the bits of each of these masks
2327 set, which means that at the beginning of every hour, the job will run. When
2328 you specify a month for the first time, the mask will be cleared and the bit
2329 corresponding to your selected month will be selected. If you specify a second
2330 month, the bit corresponding to it will also be added to the mask. Thus when
2331 Bacula checks the masks to see if the bits are set corresponding to the
2332 current time, your job will run only in the two months you have set. Likewise,
2333 if you set a time (hour), the hour mask will be cleared, and the hour you
2334 specify will be set in the bit mask and the minutes will be stored in the
2337 For any schedule you have defined, you can see how these bits are set by doing
2338 a {\bf show schedules} command in the Console program. Please note that the
2339 bit mask is zero based, and Sunday is the first day of the week (bit zero).
2344 \section{The Client Resource}
2345 \label{ClientResource2}
2346 \index[general]{Resource!Client}
2347 \index[general]{Client Resource}
2349 The Client resource defines the attributes of the Clients that are served by
2350 this Director; that is the machines that are to be backed up. You will need
2351 one Client resource definition for each machine to be backed up.
2355 \item [Client (or FileDaemon)]
2356 \index[dir]{Client (or FileDaemon)}
2357 \index[dir]{Directive!Client (or FileDaemon)}
2358 Start of the Client directives.
2360 \item [Name = \lt{}name\gt{}]
2363 \index[dir]{Directive!Name}
2364 The client name which will be used in the Job resource directive or in the
2365 console run command. This directive is required.
2367 \item [Address = \lt{}address\gt{}]
2368 \label{Client:Address}
2369 \index[dir]{Address}
2370 \index[dir]{Directive!FD Address}
2371 \index[dir]{File Daemon Address}
2372 \index[dir]{Client Address}
2373 Where the address is a host name, a fully qualified domain name, or a
2374 network address in dotted quad notation for a Bacula File server daemon.
2375 This directive is required.
2377 \item [FD Port = \lt{}port-number\gt{}]
2378 \label{Client:FdPort}
2379 \index[dir]{FD Port}
2380 \index[dir]{Directive!FD Port}
2381 Where the port is a port number at which the Bacula File server daemon can
2382 be contacted. The default is 9102.
2384 \item [Catalog = \lt{}Catalog-resource-name\gt{}]
2385 \label{Client:Catalog}
2386 \index[dir]{Catalog}
2387 \index[dir]{Directive!Catalog}
2388 This specifies the name of the catalog resource to be used for this Client.
2389 This directive is required.
2391 \item [Password = \lt{}password\gt{}]
2392 \label{Client:Password}
2393 \index[dir]{Password}
2394 \index[dir]{Directive!Password}
2395 This is the password to be used when establishing a connection with the File
2396 services, so the Client configuration file on the machine to be backed up
2397 must have the same password defined for this Director. This directive is
2398 required. If you have either {\bf /dev/random} {\bf bc} on your machine,
2399 Bacula will generate a random password during the configuration process,
2400 otherwise it will be left blank.
2402 The password is plain text. It is not generated through any special
2403 process, but it is preferable for security reasons to make the text
2406 \label{FileRetention}
2407 \item [File Retention = \lt{}time-period-specification\gt{}]
2408 \label{FileRetention}
2409 \label{Client:FileRetention}
2410 \index[dir]{File Retention}
2411 \index[dir]{Directive!File Retention}
2412 The File Retention directive defines the length of time that Bacula will
2413 keep File records in the Catalog database after the End time of the
2414 Job corresponding to the File records.
2415 When this time period expires, and if
2416 {\bf AutoPrune} is set to {\bf yes} Bacula will prune (remove) File records
2417 that are older than the specified File Retention period. Note, this affects
2418 only records in the catalog database. It does not affect your archive
2421 File records may actually be retained for a shorter period than you specify
2422 on this directive if you specify either a shorter {\bf Job Retention} or a
2423 shorter {\bf Volume Retention} period. The shortest retention period of the
2424 three takes precedence. The time may be expressed in seconds, minutes,
2425 hours, days, weeks, months, quarters, or years. See the
2426 \ilink{ Configuration chapter}{Time} of this manual for
2427 additional details of time specification.
2429 The default is 60 days.
2431 \item [Job Retention = \lt{}time-period-specification\gt{}]
2432 \label{JobRetention}
2433 \label{Client:JobRetention}
2434 \index[dir]{Job Retention}
2435 \index[dir]{Directive!Job Retention}
2436 The Job Retention directive defines the length of time that Bacula will keep
2437 Job records in the Catalog database after the Job End time. When
2438 this time period expires, and if {\bf AutoPrune} is set to {\bf yes}
2439 Bacula will prune (remove) Job records that are older than the specified
2440 File Retention period. As with the other retention periods, this
2441 affects only records in the catalog and not data in your archive backup.
2443 If a Job record is selected for pruning, all associated File and JobMedia
2444 records will also be pruned regardless of the File Retention period set.
2445 As a consequence, you normally will set the File retention period to be
2446 less than the Job retention period. The Job retention period can actually
2447 be less than the value you specify here if you set the {\bf Volume
2448 Retention} directive in the Pool resource to a smaller duration. This is
2449 because the Job retention period and the Volume retention period are
2450 independently applied, so the smaller of the two takes precedence.
2452 The Job retention period is specified as seconds, minutes, hours, days,
2453 weeks, months, quarters, or years. See the
2454 \ilink{ Configuration chapter}{Time} of this manual for
2455 additional details of time specification.
2457 The default is 180 days.
2460 \item [AutoPrune = \lt{}yes\vb{}no\gt{}]
2461 \label{Client:AutoPrune}
2462 \index[dir]{AutoPrune}
2463 \index[dir]{Directive!AutoPrune}
2464 If AutoPrune is set to {\bf yes} (default), Bacula (version 1.20 or greater)
2465 will automatically apply the File retention period and the Job retention
2466 period for the Client at the end of the Job. If you set {\bf AutoPrune = no},
2467 pruning will not be done, and your Catalog will grow in size each time you
2468 run a Job. Pruning affects only information in the catalog and not data
2469 stored in the backup archives (on Volumes).
2471 \item [Maximum Concurrent Jobs = \lt{}number\gt{}]
2472 \label{Client:MaximumConcurrentJobs}
2473 \index[dir]{Maximum Concurrent Jobs}
2474 \index[dir]{Directive!Maximum Concurrent Jobs}
2475 where \lt{}number\gt{} is the maximum number of Jobs with the current Client
2476 that can run concurrently. Note, this directive limits only Jobs for Clients
2477 with the same name as the resource in which it appears. Any other
2478 restrictions on the maximum concurrent jobs such as in the Director, Job, or
2479 Storage resources will also apply in addition to any limit specified here.
2480 The default is set to 1, but you may set it to a larger number.
2482 \item [Maximum Bandwidth Per Job = \lt{}speed\gt{}]
2483 \label{Client:MaximumBandwidthPerJob}
2484 \index[dir]{Maximum Bandwidth Per Job}
2485 \index[dir]{Directive!Maximum Bandwidth Per Job}
2487 The speed parameter specifies the maximum allowed bandwidth that a job may use
2488 when started for this Client. The speed parameter should be specified in
2489 k/s, Kb/s, m/s or Mb/s.
2491 % \item [FD Storage Address = \lt{}address\gt{}]
2492 % \index[dir]{FDStorageAddress}
2493 % \index[dir]{Directive!FD Storage Address}
2494 % \index[dir]{Storage daemon Address}
2496 % Where the address is a host name, a {\bf fully qualified domain name}, or an
2497 % {\bf IP address}. Please note that the \lt{}address\gt{} as specified here
2498 % will be transmitted to the File daemon instead of the Storage
2499 % \texttt{Address} who will then use it to contact the Storage daemon. This
2500 % directive can be used in NAT environment where the configuration of the
2501 % Client resolver is not possible. Note that using this directive will not allow
2502 % to use multiple Storage Daemon for Backup/Restore jobs.
2504 % \begin{figure}[htbp]
2506 % \includegraphics[width=10cm]{\idir BackupOverWan1}
2507 % \caption{Backup over WAN using FD Storage Address}
2510 \item [Priority = \lt{}number\gt{}]
2511 \label{Client:Priority}
2512 \index[dir]{Priority}
2513 \index[dir]{Directive!Priority}
2514 The number specifies the priority of this client relative to other clients
2515 that the Director is processing simultaneously. The priority can range from
2516 1 to 1000. The clients are ordered such that the smaller number priorities
2517 are performed first (not currently implemented).
2520 The following is an example of a valid Client resource definition:
2526 FDAddress = minimatou
2528 Password = very_good
2533 \section{The Storage Resource}
2534 \label{StorageResource2}
2535 \index[general]{Resource!Storage}
2536 \index[general]{Storage Resource}
2538 The Storage resource defines which Storage daemons are available for use by
2544 \index[dir]{Storage}
2545 \index[dir]{Directive!Storage}
2546 Start of the Storage resources. At least one storage resource must be
2549 \item [Name = \lt{}name\gt{}]
2550 \label{Storage:Name}
2552 \index[dir]{Directive!Name}
2553 The name of the storage resource. This name appears on the Storage directive
2554 specified in the Job resource and is required.
2556 \item [Address = \lt{}address\gt{}]
2557 \label{Storage:Address}
2558 \index[dir]{Address}
2559 \index[dir]{Directive!SD Address}
2560 \index[dir]{Storage daemon Address}
2561 Where the address is a host name, a {\bf fully qualified domain name}, or an
2562 {\bf IP address}. Please note that the \lt{}address\gt{} as specified here
2563 will be transmitted to the File daemon who will then use it to contact the
2564 Storage daemon. Hence, it is {\bf not}, a good idea to use {\bf localhost} as
2565 the name but rather a fully qualified machine name or an IP address. This
2566 directive is required.
2568 \item [FD Storage Address = \lt{}address\gt{}]
2569 \label{Storage:FDStorageAddress}
2570 \index[dir]{FDStorageAddress}
2571 \index[dir]{Directive!FD Storage Address} \index[dir]{Storage daemon
2572 Address} Where the address is a host name, a {\bf fully qualified domain
2573 name}, or an {\bf IP address}. Please note that the \lt{}address\gt{} as
2574 specified here will be transmitted to the File daemon instead of the
2575 \texttt{Address} who will then use it to contact the Storage daemon. This
2576 directive can be used in NAT environment where the configuration of the
2577 Client resolver is not possible.
2579 \begin{figure}[htbp]
2581 \includegraphics[width=10cm]{\idir BackupOverWan1}
2582 \caption{Backup over WAN using FD Storage Address}
2585 \item [SD Port = \lt{}port\gt{}]
2586 \label{Storage:SdPort}
2587 \index[dir]{SD Port}
2588 \index[dir]{Directive!SD Port}
2589 Where port is the port to use to contact the storage daemon for information
2590 and to start jobs. This same port number must appear in the Storage resource
2591 of the Storage daemon's configuration file. The default is 9103.
2593 \item [Password = \lt{}password\gt{}]
2594 \label{Storage:Password}
2595 \index[dir]{Password}
2596 \index[dir]{Directive!Password}
2597 This is the password to be used when establishing a connection with the
2598 Storage services. This same password also must appear in the Director
2599 resource of the Storage daemon's configuration file. This directive is
2600 required. If you have either {\bf /dev/random} {\bf bc} on your machine,
2601 Bacula will generate a random password during the configuration process,
2602 otherwise it will be left blank.
2604 The password is plain text. It is not generated through any special
2605 process, but it is preferable for security reasons to use random text.
2607 \item [Device = \lt{}device-name\gt{}]
2608 \label{Storage:Device}
2610 \index[dir]{Directive!Device}
2611 This directive specifies the Storage daemon's name of the device
2612 resource to be used for the storage. If you are using an Autochanger,
2613 the name specified here should be the name of the Storage daemon's
2614 Autochanger resource rather than the name of an individual device. This
2615 name is not the physical device name, but the logical device name as
2616 defined on the {\bf Name} directive contained in the {\bf Device} or the
2617 {\bf Autochanger} resource definition of the {\bf Storage daemon}
2618 configuration file. You can specify any name you would like (even the
2619 device name if you prefer) up to a maximum of 127 characters in length.
2620 The physical device name associated with this device is specified in the
2621 {\bf Storage daemon} configuration file (as {\bf Archive Device}).
2622 Please take care not to define two different Storage resource directives
2623 in the Director that point to the same Device in the Storage daemon.
2624 Doing so may cause the Storage daemon to block (or hang) attempting to
2625 open the same device that is already open. This directive is required.
2628 \item [Media Type = \lt{}MediaType\gt{}]
2629 \label{Storage:MediaType}
2630 \index[dir]{Media Type}
2631 \index[dir]{Directive!Media Type}
2632 This directive specifies the Media Type to be used to store the data.
2633 This is an arbitrary string of characters up to 127 maximum that you
2634 define. It can be anything you want. However, it is best to make it
2635 descriptive of the storage media (e.g. File, DAT, "HP DLT8000", 8mm,
2636 ...). In addition, it is essential that you make the {\bf Media Type}
2637 specification unique for each storage media type. If you have two DDS-4
2638 drives that have incompatible formats, or if you have a DDS-4 drive and
2639 a DDS-4 autochanger, you almost certainly should specify different {\bf
2640 Media Types}. During a restore, assuming a {\bf DDS-4} Media Type is
2641 associated with the Job, Bacula can decide to use any Storage daemon
2642 that supports Media Type {\bf DDS-4} and on any drive that supports it.
2644 If you are writing to disk Volumes, you must make doubly sure that each
2645 Device resource defined in the Storage daemon (and hence in the
2646 Director's conf file) has a unique media type. Otherwise for Bacula
2647 versions 1.38 and older, your restores may not work because Bacula
2648 will assume that you can mount any Media Type with the same name on
2649 any Device associated with that Media Type. This is possible with
2650 tape drives, but with disk drives, unless you are very clever you
2651 cannot mount a Volume in any directory -- this can be done by creating
2652 an appropriate soft link.
2654 Currently Bacula permits only a single Media Type per Storage
2655 and Device definition. Consequently, if
2656 you have a drive that supports more than one Media Type, you can
2657 give a unique string to Volumes with different intrinsic Media
2658 Type (Media Type = DDS-3-4 for DDS-3 and DDS-4 types), but then
2659 those volumes will only be mounted on drives indicated with the
2660 dual type (DDS-3-4).
2662 If you want to tie Bacula to using a single Storage daemon or drive, you
2663 must specify a unique Media Type for that drive. This is an important
2664 point that should be carefully understood. Note, this applies equally
2665 to Disk Volumes. If you define more than one disk Device resource in
2666 your Storage daemon's conf file, the Volumes on those two devices are in
2667 fact incompatible because one can not be mounted on the other device
2668 since they are found in different directories. For this reason, you
2669 probably should use two different Media Types for your two disk Devices
2670 (even though you might think of them as both being File types). You can
2671 find more on this subject in the \ilink{Basic Volume
2672 Management}{DiskChapter} chapter of this manual.
2674 The {\bf MediaType} specified in the Director's Storage resource, {\bf
2675 must} correspond to the {\bf Media Type} specified in the {\bf Device}
2676 resource of the {\bf Storage daemon} configuration file. This directive
2677 is required, and it is used by the Director and the Storage daemon to
2678 ensure that a Volume automatically selected from the Pool corresponds to
2679 the physical device. If a Storage daemon handles multiple devices (e.g.
2680 will write to various file Volumes on different partitions), this
2681 directive allows you to specify exactly which device.
2683 As mentioned above, the value specified in the Director's Storage
2684 resource must agree with the value specified in the Device resource in
2685 the {\bf Storage daemon's} configuration file. It is also an additional
2686 check so that you don't try to write data for a DLT onto an 8mm device.
2688 \label{Autochanger1}
2689 \item [Autochanger = \lt{}yes\vb{}no\gt{}]
2690 \label{Storage:Autochanger}
2691 \index[dir]{Autochanger}
2692 \index[dir]{Directive!Autochanger}
2693 If you specify {\bf yes} for this command (the default is {\bf no}),
2694 when you use the {\bf label} command or the {\bf add} command to create
2695 a new Volume, {\bf Bacula} will also request the Autochanger Slot
2696 number. This simplifies creating database entries for Volumes in an
2697 autochanger. If you forget to specify the Slot, the autochanger will
2698 not be used. However, you may modify the Slot associated with a Volume
2699 at any time by using the {\bf update volume} or {\bf update slots}
2700 command in the console program. When {\bf autochanger} is enabled, the
2701 algorithm used by Bacula to search for available volumes will be
2702 modified to consider only Volumes that are known to be in the
2703 autochanger's magazine. If no {\bf in changer} volume is found, Bacula
2704 will attempt recycling, pruning, ..., and if still no volume is found,
2705 Bacula will search for any volume whether or not in the magazine. By
2706 privileging in changer volumes, this procedure minimizes operator
2707 intervention. The default is {\bf no}.
2709 For the autochanger to be used, you must also specify {\bf Autochanger =
2710 yes} in the \ilink{Device Resource}{Autochanger} in the Storage daemon's
2711 configuration file as well as other important Storage daemon
2712 configuration information. Please consult the \ilink{Using
2713 Autochangers}{AutochangersChapter} manual of this chapter for the
2714 details of using autochangers.
2716 \item [Maximum Concurrent Jobs = \lt{}number\gt{}]
2717 \label{Storage:MaximumConcurrentJobs}
2718 \index[dir]{Maximum Concurrent Jobs}
2719 \index[dir]{Directive!Maximum Concurrent Jobs}
2720 where \lt{}number\gt{} is the maximum number of Jobs with the current
2721 Storage resource that can run concurrently. Note, this directive limits
2722 only Jobs for Jobs using this Storage daemon. Any other restrictions on
2723 the maximum concurrent jobs such as in the Director, Job, or Client
2724 resources will also apply in addition to any limit specified here. The
2725 default is set to 1, but you may set it to a larger number. However, if
2726 you set the Storage daemon's number of concurrent jobs greater than one,
2727 we recommend that you read the waring documented under \ilink{Maximum
2728 Concurrent Jobs}{DirMaxConJobs} in the Director's resource or simply
2729 turn data spooling on as documented in the \ilink{Data
2730 Spooling}{SpoolingChapter} chapter of this manual.
2732 \item [AllowCompression = \lt{}yes\vb{}no\gt{}]
2733 \label{AllowCompression}
2734 \label{Storage:AllowCompression}
2735 \index[dir]{AllowCompression}
2736 \index[dir]{Directive!AllowCompression}
2738 This directive is optional, and if you specify {\bf No} (the default is {\bf
2739 Yes}), it will cause backups jobs running on this storage resource to run
2740 without client File Daemon compression. This effectively overrides
2741 compression options in FileSets used by jobs which use this storage
2744 \item [Heartbeat Interval = \lt{}time-interval\gt{}]
2745 \label{Storage:Heartbeat Interval}
2746 \index[dir]{Heartbeat Interval}
2747 \index[dir]{Directive!Heartbeat}
2748 This directive is optional and if specified will cause the Director to
2749 set a keepalive interval (heartbeat) in seconds on each of the sockets
2750 it opens for the Storage resource. This value will override any
2751 specified at the Director level. It is implemented only on systems
2752 (Linux, ...) that provide the {\bf setsockopt} TCP\_KEEPIDLE function.
2753 The default value is zero, which means no change is made to the socket.
2757 The following is an example of a valid Storage resource definition:
2761 # Definition of tape storage device
2765 Password = storage_password # password for Storage daemon
2766 Device = "HP DLT 80" # same as Device in Storage daemon
2767 Media Type = DLT8000 # same as MediaType in Storage daemon
2772 \section{The Pool Resource}
2773 \label{PoolResource}
2774 \index[general]{Resource!Pool}
2775 \index[general]{Pool Resource}
2777 The Pool resource defines the set of storage Volumes (tapes or files) to be
2778 used by Bacula to write the data. By configuring different Pools, you can
2779 determine which set of Volumes (media) receives the backup data. This permits,
2780 for example, to store all full backup data on one set of Volumes and all
2781 incremental backups on another set of Volumes. Alternatively, you could assign
2782 a different set of Volumes to each machine that you backup. This is most
2783 easily done by defining multiple Pools.
2785 Another important aspect of a Pool is that it contains the default attributes
2786 (Maximum Jobs, Retention Period, Recycle flag, ...) that will be given to a
2787 Volume when it is created. This avoids the need for you to answer a large
2788 number of questions when labeling a new Volume. Each of these attributes can
2789 later be changed on a Volume by Volume basis using the {\bf update} command in
2790 the console program. Note that you must explicitly specify which Pool Bacula
2791 is to use with each Job. Bacula will not automatically search for the correct
2794 Most often in Bacula installations all backups for all machines (Clients) go
2795 to a single set of Volumes. In this case, you will probably only use the {\bf
2796 Default} Pool. If your backup strategy calls for you to mount a different tape
2797 each day, you will probably want to define a separate Pool for each day. For
2798 more information on this subject, please see the
2799 \ilink{Backup Strategies}{StrategiesChapter} chapter of this
2803 To use a Pool, there are three distinct steps. First the Pool must be defined
2804 in the Director's configuration file. Then the Pool must be written to the
2805 Catalog database. This is done automatically by the Director each time that it
2806 starts, or alternatively can be done using the {\bf create} command in the
2807 console program. Finally, if you change the Pool definition in the Director's
2808 configuration file and restart Bacula, the pool will be updated alternatively
2809 you can use the {\bf update pool} console command to refresh the database
2810 image. It is this database image rather than the Director's resource image
2811 that is used for the default Volume attributes. Note, for the pool to be
2812 automatically created or updated, it must be explicitly referenced by a Job
2815 Next the physical media must be labeled. The labeling can either be done with
2816 the {\bf label} command in the {\bf console} program or using the {\bf btape}
2817 program. The preferred method is to use the {\bf label} command in the {\bf
2820 Finally, you must add Volume names (and their attributes) to the Pool. For
2821 Volumes to be used by Bacula they must be of the same {\bf Media Type} as the
2822 archive device specified for the job (i.e. if you are going to back up to a
2823 DLT device, the Pool must have DLT volumes defined since 8mm volumes cannot be
2824 mounted on a DLT drive). The {\bf Media Type} has particular importance if you
2825 are backing up to files. When running a Job, you must explicitly specify which
2826 Pool to use. Bacula will then automatically select the next Volume to use from
2827 the Pool, but it will ensure that the {\bf Media Type} of any Volume selected
2828 from the Pool is identical to that required by the Storage resource you have
2829 specified for the Job.
2831 If you use the {\bf label} command in the console program to label the
2832 Volumes, they will automatically be added to the Pool, so this last step is
2833 not normally required.
2835 It is also possible to add Volumes to the database without explicitly labeling
2836 the physical volume. This is done with the {\bf add} console command.
2838 As previously mentioned, each time Bacula starts, it scans all the Pools
2839 associated with each Catalog, and if the database record does not already
2840 exist, it will be created from the Pool Resource definition. {\bf Bacula}
2841 probably should do an {\bf update pool} if you change the Pool definition, but
2842 currently, you must do this manually using the {\bf update pool} command in
2843 the Console program.
2845 The Pool Resource defined in the Director's configuration file
2846 (bacula-dir.conf) may contain the following directives:
2852 \index[dir]{Directive!Pool}
2853 Start of the Pool resource. There must be at least one Pool resource
2857 \item [Name = \lt{}name\gt{}]
2860 \index[dir]{Directive!Name}
2861 The name of the pool. For most applications, you will use the default
2862 pool name {\bf Default}. This directive is required.
2865 \item [Maximum Volumes = \lt{}number\gt{}]
2866 \label{Pool:MaximumVolumes}
2867 \index[dir]{Maximum Volumes}
2868 \index[dir]{Directive!Maximum Volumes}
2869 This directive specifies the maximum number of volumes (tapes or files)
2870 contained in the pool. This directive is optional, if omitted or set to
2871 zero, any number of volumes will be permitted. In general, this
2872 directive is useful for Autochangers where there is a fixed number of
2873 Volumes, or for File storage where you wish to ensure that the backups
2874 made to disk files do not become too numerous or consume too much space.
2876 \item [Pool Type = \lt{}type\gt{}]
2877 \label{Pool:PoolType}
2878 \index[dir]{Pool Type}
2879 \index[dir]{Directive!Pool Type}
2880 This directive defines the pool type, which corresponds to the type of
2881 Job being run. It is required and may be one of the following:
2891 Note, only Backup is current implemented.
2893 \item [Storage = \lt{}storage-resource-name\gt{}]
2894 \label{Pool:Storage}
2895 \index[dir]{Storage}
2896 \index[dir]{Directive!Storage}
2897 The Storage directive defines the name of the storage services where you
2898 want to backup the FileSet data. For additional details, see the
2899 \ilink{Storage Resource Chapter}{StorageResource2} of this manual.
2900 The Storage resource may also be specified in the Job resource,
2901 but the value, if any, in the Pool resource overrides any value
2902 in the Job. This Storage resource definition is not required by either
2903 the Job resource or in the Pool, but it must be specified in
2904 one or the other. If not configuration error will result.
2906 \item [Use Volume Once = \lt{}yes\vb{}no\gt{}]
2907 \label{Pool:UseVolumeOnce}
2908 \index[dir]{Use Volume Once}
2909 \index[dir]{Directive!Use Volume Once}
2910 This directive if set to {\bf yes} specifies that each volume is to be
2911 used only once. This is most useful when the Media is a file and you
2912 want a new file for each backup that is done. The default is {\bf no}
2913 (i.e. use volume any number of times). This directive will most likely
2914 be phased out (deprecated), so you are recommended to use {\bf Maximum
2915 Volume Jobs = 1} instead.
2917 The value defined by this directive in the bacula-dir.conf file is the
2918 default value used when a Volume is created. Once the volume is
2919 created, changing the value in the bacula-dir.conf file will not change
2920 what is stored for the Volume. To change the value for an existing
2921 Volume you must use the {\bf update} command in the Console.
2923 Please see the notes below under {\bf Maximum Volume Jobs} concerning
2924 using this directive with multiple simultaneous jobs.
2926 \item [Maximum Volume Jobs = \lt{}positive-integer\gt{}]
2927 \label{Pool:MaximumVolumeJobs}
2928 \index[dir]{Maximum Volume Jobs}
2929 \index[dir]{Directive!Maximum Volume Jobs}
2930 This directive specifies the maximum number of Jobs that can be written
2931 to the Volume. If you specify zero (the default), there is no limit.
2932 Otherwise, when the number of Jobs backed up to the Volume equals {\bf
2933 positive-integer} the Volume will be marked {\bf Used}. When the Volume
2934 is marked {\bf Used} it can no longer be used for appending Jobs, much
2935 like the {\bf Full} status but it can be recycled if recycling is
2936 enabled, and thus used again. By setting {\bf MaximumVolumeJobs} to
2937 one, you get the same effect as setting {\bf UseVolumeOnce = yes}.
2939 The value defined by this directive in the bacula-dir.conf
2940 file is the default value used when a Volume is created. Once the volume is
2941 created, changing the value in the bacula-dir.conf file will not change what
2942 is stored for the Volume. To change the value for an existing Volume you
2943 must use the {\bf update} command in the Console.
2945 If you are running multiple simultaneous jobs, this directive may not
2946 work correctly because when a drive is reserved for a job, this
2947 directive is not taken into account, so multiple jobs may try to
2948 start writing to the Volume. At some point, when the Media record is
2949 updated, multiple simultaneous jobs may fail since the Volume can no
2952 \item [Maximum Volume Files = \lt{}positive-integer\gt{}]
2953 \label{Pool:MaximumVolumeFiles}
2954 \index[dir]{Maximum Volume Files}
2955 \index[dir]{Directive!Maximum Volume Files}
2956 This directive specifies the maximum number of files that can be written
2957 to the Volume. If you specify zero (the default), there is no limit.
2958 Otherwise, when the number of files written to the Volume equals {\bf
2959 positive-integer} the Volume will be marked {\bf Used}. When the Volume
2960 is marked {\bf Used} it can no longer be used for appending Jobs, much
2961 like the {\bf Full} status but it can be recycled if recycling is
2962 enabled and thus used again. This value is checked and the {\bf Used}
2963 status is set only at the end of a job that writes to the particular
2966 The value defined by this directive in the bacula-dir.conf file is the
2967 default value used when a Volume is created. Once the volume is
2968 created, changing the value in the bacula-dir.conf file will not change
2969 what is stored for the Volume. To change the value for an existing
2970 Volume you must use the {\bf update} command in the Console.
2972 \item [Maximum Volume Bytes = \lt{}size\gt{}]
2973 \label{Pool:MaximumVolumeBytes}
2974 \index[dir]{Maximum Volume Bytes}
2975 \index[dir]{Directive!Maximum Volume Bytes}
2976 This directive specifies the maximum number of bytes that can be written
2977 to the Volume. If you specify zero (the default), there is no limit
2978 except the physical size of the Volume. Otherwise, when the number of
2979 bytes written to the Volume equals {\bf size} the Volume will be marked
2980 {\bf Used}. When the Volume is marked {\bf Used} it can no longer be
2981 used for appending Jobs, much like the {\bf Full} status but it can be
2982 recycled if recycling is enabled, and thus the Volume can be re-used
2983 after recycling. This value is checked and the {\bf Used} status set
2984 while the job is writing to the particular volume.
2986 This directive is particularly useful for restricting the size
2987 of disk volumes, and will work correctly even in the case of
2988 multiple simultaneous jobs writing to the volume.
2990 The value defined by this directive in the bacula-dir.conf file is the
2991 default value used when a Volume is created. Once the volume is
2992 created, changing the value in the bacula-dir.conf file will not change
2993 what is stored for the Volume. To change the value for an existing
2994 Volume you must use the {\bf update} command in the Console.
2996 \item [Volume Use Duration = \lt{}time-period-specification\gt{}]
2997 \label{Pool:VolumeUseDuration}
2998 \index[dir]{Volume Use Duration}
2999 \index[dir]{Directive!Volume Use Duration}
3000 The Volume Use Duration directive defines the time period that the
3001 Volume can be written beginning from the time of first data write to the
3002 Volume. If the time-period specified is zero (the default), the Volume
3003 can be written indefinitely. Otherwise, the next time a job
3004 runs that wants to access this Volume, and the time period from the
3005 first write to the volume (the first Job written) exceeds the
3006 time-period-specification, the Volume will be marked {\bf Used}, which
3007 means that no more Jobs can be appended to the Volume, but it may be
3008 recycled if recycling is enabled. Using the command {\bf
3009 status dir} applies algorithms similar to running jobs, so
3010 during such a command, the Volume status may also be changed.
3012 recycled, it will be available for use again.
3014 You might use this directive, for example, if you have a Volume used for
3015 Incremental backups, and Volumes used for Weekly Full backups. Once the
3016 Full backup is done, you will want to use a different Incremental
3017 Volume. This can be accomplished by setting the Volume Use Duration for
3018 the Incremental Volume to six days. I.e. it will be used for the 6
3019 days following a Full save, then a different Incremental volume will be
3020 used. Be careful about setting the duration to short periods such as 23
3021 hours, or you might experience problems of Bacula waiting for a tape
3022 over the weekend only to complete the backups Monday morning when an
3023 operator mounts a new tape.
3025 The use duration is checked and the {\bf Used} status is set only at the
3026 end of a job that writes to the particular volume, which means that even
3027 though the use duration may have expired, the catalog entry will not be
3028 updated until the next job that uses this volume is run. This
3029 directive is not intended to be used to limit volume sizes
3030 and will not work correctly (i.e. will fail jobs) if the use
3031 duration expires while multiple simultaneous jobs are writing
3034 Please note that the value defined by this directive in the bacula-dir.conf
3035 file is the default value used when a Volume is created. Once the volume is
3036 created, changing the value in the bacula-dir.conf file will not change what
3037 is stored for the Volume. To change the value for an existing Volume you
3039 \ilink{\bf update volume}{UpdateCommand} command in the Console.
3041 \item [Catalog Files = \lt{}yes\vb{}no\gt{}]
3042 \label{Pool:CatalogFiles}
3043 \index[dir]{Catalog Files}
3044 \index[dir]{Directive!Catalog Files}
3045 This directive defines whether or not you want the names of the files
3046 that were saved to be put into the catalog. The default is {\bf yes}.
3047 The advantage of specifying {\bf Catalog Files = No} is that you will
3048 have a significantly smaller Catalog database. The disadvantage is that
3049 you will not be able to produce a Catalog listing of the files backed up
3050 for each Job (this is often called Browsing). Also, without the File
3051 entries in the catalog, you will not be able to use the Console {\bf
3052 restore} command nor any other command that references File entries.
3054 \label{PoolAutoPrune}
3055 \item [AutoPrune = \lt{}yes\vb{}no\gt{}]
3056 \label{Pool:AutoPrune}
3057 \index[dir]{AutoPrune}
3058 \index[dir]{Directive!AutoPrune}
3059 If AutoPrune is set to {\bf yes} (default), Bacula (version 1.20 or
3060 greater) will automatically apply the Volume Retention period when new
3061 Volume is needed and no appendable Volumes exist in the Pool. Volume
3062 pruning causes expired Jobs (older than the {\bf Volume Retention}
3063 period) to be deleted from the Catalog and permits possible recycling of
3066 \label{VolRetention}
3067 \item [Volume Retention = \lt{}time-period-specification\gt{}]
3068 \label{Pool:VolumeRetention}
3069 \index[dir]{Volume Retention}
3070 \index[dir]{Directive!Volume Retention}
3071 The Volume Retention directive defines the length of time that {\bf
3072 Bacula} will keep records associated with the Volume in
3073 the Catalog database after the End time of each Job written to the
3074 Volume. When this time period expires, and if {\bf AutoPrune} is set to
3075 {\bf yes} Bacula may prune (remove) Job records that are older than the
3076 specified Volume Retention period if it is necessary to free up a
3077 Volume. Recycling will not occur until it is absolutely necessary to
3078 free up a volume (i.e. no other writable volume exists).
3079 All File records associated with pruned Jobs are also
3080 pruned. The time may be specified as seconds, minutes, hours, days,
3081 weeks, months, quarters, or years. The {\bf Volume Retention} is
3082 applied independently of the {\bf Job Retention} and the {\bf File
3083 Retention} periods defined in the Client resource. This means that all
3084 the retentions periods are applied in turn and that the shorter period
3085 is the one that effectively takes precedence. Note, that when the {\bf
3086 Volume Retention} period has been reached, and it is necessary to obtain
3087 a new volume, Bacula will prune both the Job and the File records. This
3088 pruning could also occur during a {\bf status dir} command because it
3089 uses similar algorithms for finding the next available Volume.
3091 It is important to know that when the Volume Retention period expires,
3092 Bacula does not automatically recycle a Volume. It attempts to keep the
3093 Volume data intact as long as possible before over writing the Volume.
3095 By defining multiple Pools with different Volume Retention periods, you
3096 may effectively have a set of tapes that is recycled weekly, another
3097 Pool of tapes that is recycled monthly and so on. However, one must
3098 keep in mind that if your {\bf Volume Retention} period is too short, it
3099 may prune the last valid Full backup, and hence until the next Full
3100 backup is done, you will not have a complete backup of your system, and
3101 in addition, the next Incremental or Differential backup will be
3102 promoted to a Full backup. As a consequence, the minimum {\bf Volume
3103 Retention} period should be at twice the interval of your Full backups.
3104 This means that if you do a Full backup once a month, the minimum Volume
3105 retention period should be two months.
3107 The default Volume retention period is 365 days, and either the default
3108 or the value defined by this directive in the bacula-dir.conf file is
3109 the default value used when a Volume is created. Once the volume is
3110 created, changing the value in the bacula-dir.conf file will not change
3111 what is stored for the Volume. To change the value for an existing
3112 Volume you must use the {\bf update} command in the Console.
3114 \item [Action On Purge = \lt{Truncate}]
3115 \label{Pool:ActionOnPurge}
3116 \index[dir]{actiononpurge}
3118 This directive \textbf{ActionOnPurge=Truncate} instructs Bacula to truncate the
3119 volume when it is purged with the \texttt{purge volume action=truncate}
3120 command. It is useful to prevent disk based volumes from consuming too much
3126 Action On Purge = Truncate
3131 You can schedule the truncate operation at the end of your CatalogBackup job
3132 like in this example:
3136 Name = CatalogBackup
3141 Console = "purge volume action=all allpools storage=File"
3146 \label{PoolScratchPool}
3147 \item [ScratchPool = \lt{}pool-resource-name\gt{}]
3148 \label{Pool:ScrachPool}
3149 \index[dir]{ScrachPool}
3150 \index[dir]{Directive!ScrachPool}
3151 This directive permits to specify a dedicate \textsl{Scratch} for the
3152 current pool. This pool will replace the special pool named \textsl{Scrach}
3153 for volume selection. For more information about \textsl{Scratch} see
3154 \ilink{Scratch Pool}{TheScratchPool} section of this manual. This is useful
3155 when using multiple storage sharing the same mediatype or when you want to
3156 dedicate volumes to a particular set of pool.
3158 \label{PoolRecyclePool}
3159 \item [RecyclePool = \lt{}pool-resource-name\gt{}]
3160 \label{Pool:RecyclePool}
3161 \index[dir]{RecyclePool}
3162 \index[dir]{Directive!RecyclePool}
3163 This directive defines to which pool
3164 the Volume will be placed (moved) when it is recycled. Without
3165 this directive, a Volume will remain in the same pool when it is
3166 recycled. With this directive, it can be moved automatically to any
3167 existing pool during a recycle. This directive is probably most
3168 useful when defined in the Scratch pool, so that volumes will
3169 be recycled back into the Scratch pool. For more on the see the
3170 \ilink{Scratch Pool}{TheScratchPool} section of this manual.
3172 Although this directive is called RecyclePool, the Volume in
3173 question is actually moved from its current pool to the one
3174 you specify on this directive when Bacula prunes the Volume and
3175 discovers that there are no records left in the catalog and hence
3176 marks it as {\bf Purged}.
3180 \item [Recycle = \lt{}yes\vb{}no\gt{}]
3181 \label{Pool:Recycle}
3182 \index[dir]{Recycle}
3183 \index[dir]{Directive!Recycle}
3184 This directive specifies whether or not Purged Volumes may be recycled.
3185 If it is set to {\bf yes} (default) and Bacula needs a volume but finds
3186 none that are appendable, it will search for and recycle (reuse) Purged
3187 Volumes (i.e. volumes with all the Jobs and Files expired and thus
3188 deleted from the Catalog). If the Volume is recycled, all previous data
3189 written to that Volume will be overwritten. If Recycle is set to {\bf
3190 no}, the Volume will not be recycled, and hence, the data will remain
3191 valid. If you want to reuse (re-write) the Volume, and the recycle flag
3192 is no (0 in the catalog), you may manually set the recycle flag (update
3193 command) for a Volume to be reused.
3195 Please note that the value defined by this directive in the
3196 bacula-dir.conf file is the default value used when a Volume is created.
3197 Once the volume is created, changing the value in the bacula-dir.conf
3198 file will not change what is stored for the Volume. To change the value
3199 for an existing Volume you must use the {\bf update} command in the
3202 When all Job and File records have been pruned or purged from the
3203 catalog for a particular Volume, if that Volume is marked as
3204 Append, Full, Used, or Error, it will then be marked as Purged. Only
3205 Volumes marked as Purged will be considered to be converted to the
3206 Recycled state if the {\bf Recycle} directive is set to {\bf yes}.
3209 \label{RecycleOldest}
3210 \item [Recycle Oldest Volume = \lt{}yes\vb{}no\gt{}]
3211 \label{Pool:RecycleOldestVolume}
3212 \index[dir]{Recycle Oldest Volume}
3213 \index[dir]{Directive!Recycle Oldest Volume}
3214 This directive instructs the Director to search for the oldest used
3215 Volume in the Pool when another Volume is requested by the Storage
3216 daemon and none are available. The catalog is then {\bf pruned}
3217 respecting the retention periods of all Files and Jobs written to this
3218 Volume. If all Jobs are pruned (i.e. the volume is Purged), then the
3219 Volume is recycled and will be used as the next Volume to be written.
3220 This directive respects any Job, File, or Volume retention periods that
3221 you may have specified, and as such it is {\bf much} better to use this
3222 directive than the Purge Oldest Volume.
3224 This directive can be useful if you have a fixed number of Volumes in the
3225 Pool and you want to cycle through them and you have specified the correct
3228 However, if you use this directive and have only one
3229 Volume in the Pool, you will immediately recycle your Volume if you fill
3230 it and Bacula needs another one. Thus your backup will be totally invalid.
3231 Please use this directive with care. The default is {\bf no}.
3233 \label{RecycleCurrent}
3235 \item [Recycle Current Volume = \lt{}yes\vb{}no\gt{}]
3236 \label{Pool:RecycleCurrentVolume}
3237 \index[dir]{Recycle Current Volume}
3238 \index[dir]{Directive!Recycle Current Volume}
3239 If Bacula needs a new Volume, this directive instructs Bacula to Prune
3240 the volume respecting the Job and File retention periods. If all Jobs
3241 are pruned (i.e. the volume is Purged), then the Volume is recycled and
3242 will be used as the next Volume to be written. This directive respects
3243 any Job, File, or Volume retention periods that you may have specified,
3244 and thus it is {\bf much} better to use it rather than the Purge Oldest
3247 This directive can be useful if you have: a fixed number of Volumes in
3248 the Pool, you want to cycle through them, and you have specified
3249 retention periods that prune Volumes before you have cycled through the
3252 However, if you use this directive and have only one Volume in the Pool,
3253 you will immediately recycle your Volume if you fill it and Bacula needs
3254 another one. Thus your backup will be totally invalid. Please use this
3255 directive with care. The default is {\bf no}.
3259 \item [Purge Oldest Volume = \lt{}yes\vb{}no\gt{}]
3260 \label{Pool:PurgeOldestVolume}
3261 \index[dir]{Purge Oldest Volume}
3262 \index[dir]{Directive!Purge Oldest Volume}
3263 This directive instructs the Director to search for the oldest used
3264 Volume in the Pool when another Volume is requested by the Storage
3265 daemon and none are available. The catalog is then {\bf purged}
3266 irrespective of retention periods of all Files and Jobs written to this
3267 Volume. The Volume is then recycled and will be used as the next Volume
3268 to be written. This directive overrides any Job, File, or Volume
3269 retention periods that you may have specified.
3271 This directive can be useful if you have a fixed number of Volumes in
3272 the Pool and you want to cycle through them and reusing the oldest one
3273 when all Volumes are full, but you don't want to worry about setting
3274 proper retention periods. However, by using this option you risk losing
3277 Please be aware that {\bf Purge Oldest Volume} disregards all retention
3278 periods. If you have only a single Volume defined and you turn this
3279 variable on, that Volume will always be immediately overwritten when it
3280 fills! So at a minimum, ensure that you have a decent number of Volumes
3281 in your Pool before running any jobs. If you want retention periods to
3282 apply do not use this directive. To specify a retention period, use the
3283 {\bf Volume Retention} directive (see above).
3285 We {\bf highly} recommend against using this directive, because it is
3286 sure that some day, Bacula will recycle a Volume that contains current
3287 data. The default is {\bf no}.
3289 \item [File Retention = \lt{}time-period-specification\gt{}]
3290 \label{Pool:FileRetention}
3291 \index[dir]{File Retention}
3292 \index[dir]{Directive!File Retention}
3293 The File Retention directive defines the length of time that Bacula will
3294 keep File records in the Catalog database after the End time of the
3295 Job corresponding to the File records.
3297 This directive takes precedence over Client directives of the same name. For
3298 example, you can decide to increase Retention times for Archive or OffSite
3301 Note, this affects only records in the catalog database. It does not affect
3302 your archive backups.
3304 For more information see Client documentation about
3305 \ilink{FileRetention}{FileRetention}
3307 \item [Job Retention = \lt{}time-period-specification\gt{}]
3308 \label{Pool:JobRetention}
3309 \index[dir]{Job Retention}
3310 \index[dir]{Directive!Job Retention}
3312 The Job Retention directive defines the length of time that Bacula will keep
3313 Job records in the Catalog database after the Job End time. As with the
3314 other retention periods, this affects only records in the catalog and not
3315 data in your archive backup.
3317 This directive takes precedence over Client directives of the same name.
3318 For example, you can decide to increase Retention times for Archive or
3321 For more information see Client side documentation
3322 \ilink{JobRetention}{JobRetention}
3324 \item [Cleaning Prefix = \lt{}string\gt{}]
3325 \label{Pool:CleaningPrefix}
3326 \index[dir]{Cleaning Prefix}
3327 \index[dir]{Directive!Cleaning Prefix}
3328 This directive defines a prefix string, which if it matches the
3329 beginning of a Volume name during labeling of a Volume, the Volume will
3330 be defined with the VolStatus set to {\bf Cleaning} and thus Bacula will
3331 never attempt to use this tape. This is primarily for use with
3332 autochangers that accept barcodes where the convention is that barcodes
3333 beginning with {\bf CLN} are treated as cleaning tapes.
3336 \item [Label Format = \lt{}format\gt{}]
3337 \label{Pool:LabelFormat}
3338 \index[dir]{Label Format}
3339 \index[dir]{Directive!Label Format}
3340 This directive specifies the format of the labels contained in this
3341 pool. The format directive is used as a sort of template to create new
3342 Volume names during automatic Volume labeling.
3344 The {\bf format} should be specified in double quotes, and consists of
3345 letters, numbers and the special characters hyphen ({\bf -}), underscore
3346 ({\bf \_}), colon ({\bf :}), and period ({\bf .}), which are the legal
3347 characters for a Volume name. The {\bf format} should be enclosed in
3350 In addition, the format may contain a number of variable expansion
3351 characters which will be expanded by a complex algorithm allowing you to
3352 create Volume names of many different formats. In all cases, the
3353 expansion process must resolve to the set of characters noted above that
3354 are legal Volume names. Generally, these variable expansion characters
3355 begin with a dollar sign ({\bf \$}) or a left bracket ({\bf [}). If you
3356 specify variable expansion characters, you should always enclose the
3357 format with double quote characters ({\bf "}). For more details on
3358 variable expansion, please see the \ilink{Variable
3359 Expansion}{VarsChapter} Chapter of this manual.
3361 If no variable expansion characters are found in the string, the Volume
3362 name will be formed from the {\bf format} string appended with the
3363 a unique number that increases. If you do not remove volumes from the
3364 pool, this number should be the number of volumes plus one, but this
3365 is not guaranteed. The unique number will be edited as four
3366 digits with leading zeros. For example, with a {\bf Label Format =
3367 "File-"}, the first volumes will be named {\bf File-0001}, {\bf
3370 With the exception of Job specific variables, you can test your {\bf
3371 LabelFormat} by using the \ilink{ var command}{var} the Console Chapter
3374 In almost all cases, you should enclose the format specification (part
3375 after the equal sign) in double quotes. Please note that this directive
3376 is deprecated and is replaced in version 1.37 and greater with a Python
3377 script for creating volume names.
3381 In order for a Pool to be used during a Backup Job, the Pool must have at
3382 least one Volume associated with it. Volumes are created for a Pool using
3383 the {\bf label} or the {\bf add} commands in the {\bf Bacula Console},
3384 program. In addition to adding Volumes to the Pool (i.e. putting the
3385 Volume names in the Catalog database), the physical Volume must be labeled
3386 with a valid Bacula software volume label before {\bf Bacula} will accept
3387 the Volume. This will be automatically done if you use the {\bf label}
3388 command. Bacula can automatically label Volumes if instructed to do so,
3389 but this feature is not yet fully implemented.
3391 The following is an example of a valid Pool resource definition:
3403 \subsection{The Scratch Pool}
3404 \label{TheScratchPool}
3405 \index[general]{Scratch Pool}
3406 In general, you can give your Pools any name you wish, but there is one
3407 important restriction: the Pool named {\bf Scratch}, if it exists behaves
3408 like a scratch pool of Volumes in that when Bacula needs a new Volume for
3409 writing and it cannot find one, it will look in the Scratch pool, and if
3410 it finds an available Volume, it will move it out of the Scratch pool into
3411 the Pool currently being used by the job.
3414 \section{The Catalog Resource}
3415 \label{CatalogResource}
3416 \index[general]{Resource!Catalog}
3417 \index[general]{Catalog Resource}
3419 The Catalog Resource defines what catalog to use for the current job.
3420 Currently, Bacula can only handle a single database server (SQLite, MySQL,
3421 PostgreSQL) that is defined when configuring {\bf Bacula}. However, there
3422 may be as many Catalogs (databases) defined as you wish. For example, you
3423 may want each Client to have its own Catalog database, or you may want
3424 backup jobs to use one database and verify or restore jobs to use another
3427 Since SQLite is compiled in, it always runs on the same machine
3428 as the Director and the database must be directly accessible (mounted) from
3429 the Director. However, since both MySQL and PostgreSQL are networked
3430 databases, they may reside either on the same machine as the Director
3431 or on a different machine on the network. See below for more details.
3436 \index[dir]{Catalog}
3437 \index[dir]{Directive!Catalog}
3438 Start of the Catalog resource. At least one Catalog resource must be
3442 \item [Name = \lt{}name\gt{}]
3443 \label{Catalog:Name}
3445 \index[dir]{Directive!Name}
3446 The name of the Catalog. No necessary relation to the database server
3447 name. This name will be specified in the Client resource directive
3448 indicating that all catalog data for that Client is maintained in this
3449 Catalog. This directive is required.
3451 \item [password = \lt{}password\gt{}]
3452 \label{Catalog:Password}
3453 \index[dir]{password}
3454 \index[dir]{Directive!password}
3455 This specifies the password to use when logging into the database. This
3456 directive is required.
3458 \item [DB Name = \lt{}name\gt{}]
3459 \label{Catalog:DbName}
3460 \index[dir]{DB Name}
3461 \index[dir]{Directive!DB Name}
3462 This specifies the name of the database. If you use multiple catalogs
3463 (databases), you specify which one here. If you are using an external
3464 database server rather than the internal one, you must specify a name
3465 that is known to the server (i.e. you explicitly created the Bacula
3466 tables using this name. This directive is required.
3468 \item [user = \lt{}user\gt{}]
3469 \label{Catalog:User}
3471 \index[dir]{Directive!user}
3472 This specifies what user name to use to log into the database. This
3473 directive is required.
3475 \item [DB Socket = \lt{}socket-name\gt{}]
3476 \label{Catalog:DbSocket}
3477 \index[dir]{DB Socket}
3478 \index[dir]{Directive!DB Socket}
3479 This is the name of a socket to use on the local host to connect to the
3480 database. This directive is used only by MySQL and is ignored by SQLite.
3481 Normally, if neither {\bf DB Socket} or {\bf DB Address} are specified, MySQL
3482 will use the default socket. If the DB Socket is specified, the
3483 MySQL server must reside on the same machine as the Director.
3485 \item [DB Address = \lt{}address\gt{}]
3486 \label{Catalog:DBAddress}
3487 \index[dir]{DB Address}
3488 \index[dir]{Directive!DB Address}
3489 This is the host address of the database server. Normally, you would specify
3490 this instead of {\bf DB Socket} if the database server is on another machine.
3491 In that case, you will also specify {\bf DB Port}. This directive is used
3492 only by MySQL and PostgreSQL and is ignored by SQLite if provided.
3493 This directive is optional.
3495 \item [DB Port = \lt{}port\gt{}]
3496 \label{Catalog:DbPort}
3497 \index[dir]{DB Port}
3498 \index[dir]{Directive!DB Port}
3499 This defines the port to be used in conjunction with {\bf DB Address} to
3500 access the database if it is on another machine. This directive is used only
3501 by MySQL and PostgreSQL and is ignored by SQLite if provided. This
3502 directive is optional.
3504 %% \item [Multiple Connections = \lt{}yes\vb{}no\gt{}]
3506 %% \index[dir]{Directive!Multiple Connections}
3507 %% By default, this directive is set to no. In that case, each job that uses
3509 %% same Catalog will use a single connection to the catalog. It will be shared,
3510 %% and Bacula will allow only one Job at a time to communicate. If you set this
3511 %% directive to yes, Bacula will permit multiple connections to the database,
3512 %% and the database must be multi-thread capable. For SQLite and PostgreSQL,
3513 %% this is no problem. For MySQL, you must be *very* careful to have the
3514 %% multi-thread version of the client library loaded on your system. When this
3515 %% directive is set yes, each Job will have a separate connection to the
3516 %% database, and the database will control the interaction between the
3518 %% Jobs. This can significantly speed up the database operations if you are
3519 %% running multiple simultaneous jobs. In addition, for SQLite and PostgreSQL,
3520 %% Bacula will automatically enable transactions. This can significantly speed
3521 %% up insertion of attributes in the database either for a single Job or
3522 %% multiple simultaneous Jobs.
3524 %% This directive has not been tested. Please test carefully before running it
3525 %% in production and report back your results.
3529 The following is an example of a valid Catalog resource definition:
3538 password = "" # no password = no security
3543 or for a Catalog on another machine:
3553 DB Address = remote.acme.com
3559 \section{The Messages Resource}
3560 \label{MessagesResource2}
3561 \index[general]{Resource!Messages}
3562 \index[general]{Messages Resource}
3564 For the details of the Messages Resource, please see the
3565 \ilink{Messages Resource Chapter}{MessagesChapter} of this
3568 \section{The Console Resource}
3569 \label{ConsoleResource1}
3570 \index[general]{Console Resource}
3571 \index[general]{Resource!Console}
3573 As of Bacula version 1.33 and higher, there are three different kinds of
3574 consoles, which the administrator or user can use to interact with the
3575 Director. These three kinds of consoles comprise three different security
3579 \item The first console type is an {\bf anonymous} or {\bf default} console,
3580 which has full privileges. There is no console resource necessary for
3581 this type since the password is specified in the Director's resource and
3582 consequently such consoles do not have a name as defined on a {\bf Name
3583 =} directive. This is the kind of console that was initially
3584 implemented in versions prior to 1.33 and remains valid. Typically you
3585 would use it only for administrators.
3587 \item The second type of console, and new to version 1.33 and higher is a
3588 "named" console defined within a Console resource in both the Director's
3589 configuration file and in the Console's configuration file. Both the
3590 names and the passwords in these two entries must match much as is the
3591 case for Client programs.
3593 This second type of console begins with absolutely no privileges except
3594 those explicitly specified in the Director's Console resource. Thus you
3595 can have multiple Consoles with different names and passwords, sort of
3596 like multiple users, each with different privileges. As a default,
3597 these consoles can do absolutely nothing -- no commands whatsoever. You
3598 give them privileges or rather access to commands and resources by
3599 specifying access control lists in the Director's Console resource. The
3600 ACLs are specified by a directive followed by a list of access names.
3601 Examples of this are shown below.
3603 \item The third type of console is similar to the above mentioned one in that
3604 it requires a Console resource definition in both the Director and the
3605 Console. In addition, if the console name, provided on the {\bf Name =}
3606 directive, is the same as a Client name, that console is permitted to
3607 use the {\bf SetIP} command to change the Address directive in the
3608 Director's client resource to the IP address of the Console. This
3609 permits portables or other machines using DHCP (non-fixed IP addresses)
3610 to "notify" the Director of their current IP address.
3613 The Console resource is optional and need not be specified. The following
3614 directives are permitted within the Director's configuration resource:
3618 \item [Name = \lt{}name\gt{}]
3619 \label{Console:Name}
3621 \index[dir]{Directive!Name}
3622 The name of the console. This name must match the name specified in the
3623 Console's configuration resource (much as is the case with Client
3626 \item [Password = \lt{}password\gt{}]
3627 \label{Console:Password}
3628 \index[dir]{Password}
3629 \index[dir]{Directive!Password}
3630 Specifies the password that must be supplied for a named Bacula Console
3631 to be authorized. The same password must appear in the {\bf Console}
3632 resource of the Console configuration file. For added security, the
3633 password is never actually passed across the network but rather a
3634 challenge response hash code created with the password. This directive
3635 is required. If you have either {\bf /dev/random} {\bf bc} on your
3636 machine, Bacula will generate a random password during the configuration
3637 process, otherwise it will be left blank.
3639 The password is plain text. It is not generated through any special
3640 process. However, it is preferable for security reasons to choose
3643 \item [JobACL = \lt{}name-list\gt{}]
3644 \label{Console:JobAcl}
3646 \index[dir]{Directive!JobACL}
3647 This directive is used to specify a list of Job resource names that can
3648 be accessed by the console. Without this directive, the console cannot
3649 access any of the Director's Job resources. Multiple Job resource names
3650 may be specified by separating them with commas, and/or by specifying
3651 multiple JobACL directives. For example, the directive may be specified
3656 JobACL = kernsave, "Backup client 1", "Backup client 2"
3657 JobACL = "RestoreFiles"
3662 With the above specification, the console can access the Director's resources
3663 for the four jobs named on the JobACL directives, but for no others.
3665 \item [ClientACL = \lt{}name-list\gt{}]
3666 \label{Console:ClientAcl}
3667 \index[dir]{ClientACL}
3668 \index[dir]{Directive!ClientACL}
3669 This directive is used to specify a list of Client resource names that can
3671 accessed by the console.
3673 \item [StorageACL = \lt{}name-list\gt{}]
3674 \label{Console:StorageAcl}
3675 \index[dir]{StorageACL}
3676 \index[dir]{Directive!StorageACL}
3677 This directive is used to specify a list of Storage resource names that can
3678 be accessed by the console.
3680 \item [ScheduleACL = \lt{}name-list\gt{}]
3681 \label{Console:ScheduleAcl}
3682 \index[dir]{ScheduleACL}
3683 \index[dir]{Directive!ScheduleACL}
3684 This directive is used to specify a list of Schedule resource names that can
3685 be accessed by the console.
3687 \item [PoolACL = \lt{}name-list\gt{}]
3688 \label{Console:PoolAcl}
3689 \index[dir]{PoolACL}
3690 \index[dir]{Directive!PoolACL}
3691 This directive is used to specify a list of Pool resource names that can be
3692 accessed by the console.
3694 \item [FileSetACL = \lt{}name-list\gt{}]
3695 \label{Console:FileSetAcl}
3696 \index[dir]{FileSetACL}
3697 \index[dir]{Directive!FileSetACL}
3698 This directive is used to specify a list of FileSet resource names that
3699 can be accessed by the console.
3701 \item [CatalogACL = \lt{}name-list\gt{}]
3702 \label{Console:CatalogAcl}
3703 \index[dir]{CatalogACL}
3704 \index[dir]{Directive!CatalogACL}
3705 This directive is used to specify a list of Catalog resource names that
3706 can be accessed by the console.
3708 \item [CommandACL = \lt{}name-list\gt{}]
3709 \label{Console:CommandAcl}
3710 \index[dir]{CommandACL}
3711 \index[dir]{Directive!CommandACL}
3712 This directive is used to specify a list of of console commands that can
3713 be executed by the console.
3715 \item [WhereACL = \lt{}string\gt{}]
3716 \label{Console:WhereAcl}
3717 \index[dir]{WhereACL}
3718 \index[dir]{Directive!WhereACL}
3719 This directive permits you to specify where a restricted console
3720 can restore files. If this directive is not specified, only the
3721 default restore location is permitted (normally {\bf
3722 /tmp/bacula-restores}. If {\bf *all*} is specified any path the
3723 user enters will be accepted (not very secure), any other
3724 value specified (there may be multiple WhereACL directives) will
3725 restrict the user to use that path. For example, on a Unix system,
3726 if you specify "/", the file will be restored to the original
3727 location. This directive is untested.
3731 Aside from Director resource names and console command names, the special
3732 keyword {\bf *all*} can be specified in any of the above access control lists.
3733 When this keyword is present, any resource or command name (which ever is
3734 appropriate) will be accepted. For an example configuration file, please see
3736 \ilink{Console Configuration}{ConsoleConfChapter} chapter of this
3739 \section{The Counter Resource}
3740 \label{CounterResource}
3741 \index[general]{Resource!Counter}
3742 \index[general]{Counter Resource}
3744 The Counter Resource defines a counter variable that can be accessed by
3745 variable expansion used for creating Volume labels with the {\bf LabelFormat}
3747 \ilink{LabelFormat}{Label} directive in this chapter for more
3753 \index[dir]{Counter}
3754 \index[dir]{Directive!Counter}
3755 Start of the Counter resource. Counter directives are optional.
3757 \item [Name = \lt{}name\gt{}]
3758 \label{Counter:Name}
3760 \index[dir]{Directive!Name}
3761 The name of the Counter. This is the name you will use in the variable
3762 expansion to reference the counter value.
3764 \item [Minimum = \lt{}integer\gt{}]
3765 \label{Counter:Minimum}
3766 \index[dir]{Minimum}
3767 \index[dir]{Directive!Minimum}
3768 This specifies the minimum value that the counter can have. It also becomes
3769 the default. If not supplied, zero is assumed.
3771 \item [Maximum = \lt{}integer\gt{}]
3772 \label{Counter:Maximum}
3773 \index[dir]{Maximum}
3774 \index[dir]{Directive!Maximum}
3775 \index[dir]{Directive!Maximum}
3776 This is the maximum value value that the counter can have. If not specified
3777 or set to zero, the counter can have a maximum value of 2,147,483,648 (2 to
3778 the 31 power). When the counter is incremented past this value, it is reset
3781 \item [*WrapCounter = \lt{}counter-name\gt{}]
3782 \label{Counter:*WrapCounter}
3783 \index[dir]{*WrapCounter}
3784 \index[dir]{Directive!*WrapCounter}
3785 If this value is specified, when the counter is incremented past the
3787 and thus reset to the minimum, the counter specified on the {\bf WrapCounter}
3788 is incremented. (This is not currently implemented).
3790 \item [Catalog = \lt{}catalog-name\gt{}]
3791 \label{Counter:Catalog}
3792 \index[dir]{Catalog}
3793 \index[dir]{Directive!Catalog}
3794 If this directive is specified, the counter and its values will be saved in
3795 the specified catalog. If this directive is not present, the counter will be
3796 redefined each time that Bacula is started.
3799 \section{Example Director Configuration File}
3800 \label{SampleDirectorConfiguration}
3801 \index[general]{File!Example Director Configuration}
3802 \index[general]{Example Director Configuration File}
3804 An example Director configuration file might be the following:
3809 # Default Bacula Director Configuration file
3811 # The only thing that MUST be changed is to add one or more
3812 # file or directory names in the Include directive of the
3815 # For Bacula release 1.15 (5 March 2002) -- redhat
3817 # You might also want to change the default email address
3818 # from root to your address. See the "mail" and "operator"
3819 # directives in the Messages resource.
3821 Director { # define myself
3823 QueryFile = "/home/kern/bacula/bin/query.sql"
3824 WorkingDirectory = "/home/kern/bacula/bin/working"
3825 PidDirectory = "/home/kern/bacula/bin/working"
3826 Password = "XkSfzu/Cf/wX4L8Zh4G4/yhCbpLcz3YVdmVoQvU3EyF/"
3828 # Define the backup Job
3830 Name = "NightlySave"
3832 Level = Incremental # default
3835 Schedule = "WeeklyCycle"
3845 Where = /tmp/bacula-restores
3851 # List of files to be backed up
3855 Options { signature=SHA1}
3857 # Put your list of files here, one per line or include an
3858 # external list with:
3862 # Note: / backs up everything
3867 # When to do the backups
3869 Name = "WeeklyCycle"
3870 Run = level=Full sun at 2:05
3871 Run = level=Incremental mon-sat at 2:05
3873 # Client (File Services) to backup
3878 Password = "MQk6lVinz4GG2hdIZk1dsKE/LxMZGo6znMHiD7t7vzF+"
3879 File Retention = 60d # sixty day file retention
3880 Job Retention = 1y # 1 year Job retention
3881 AutoPrune = yes # Auto apply retention periods
3883 # Definition of DLT tape storage device
3887 Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
3888 Device = "HP DLT 80" # same as Device in Storage daemon
3889 Media Type = DLT8000 # same as MediaType in Storage daemon
3891 # Definition for a DLT autochanger device
3895 Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
3896 Device = "Autochanger" # same as Device in Storage daemon
3897 Media Type = DLT-8000 # Different from DLTDrive
3900 # Definition of DDS tape storage device
3904 Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
3905 Device = SDT-10000 # same as Device in Storage daemon
3906 Media Type = DDS-4 # same as MediaType in Storage daemon
3908 # Definition of 8mm tape storage device
3912 Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
3913 Device = "Exabyte 8mm"
3916 # Definition of file storage device
3920 Password = "jMeWZvfikUHvt3kzKVVPpQ0ccmV6emPnF2cPYFdhLApQ"
3921 Device = FileStorage
3924 # Generic catalog service
3927 dbname = bacula; user = bacula; password = ""
3929 # Reasonable message delivery -- send most everything to
3930 # the email address and to the console
3933 mail = root@localhost = all, !skipped, !terminate
3934 operator = root@localhost = mount
3935 console = all, !skipped, !saved
3938 # Default pool definition
3946 # Restricted console used by tray-monitor to get the status of the director
3950 Password = "GN0uRo7PTUmlMbqrJ2Gr1p0fk0HQJTxwnFyE4WSST3MWZseR"
3951 CommandACL = status, .status