]> git.sur5r.net Git - bacula/docs/blob - docs/manuals/en/main/newfeatures.tex
Update new features chapter
[bacula/docs] / docs / manuals / en / main / newfeatures.tex
1 \chapter{New Features in 9.0.0}
2 \subsection{Maximum Virtual Full Interval Option}
3 Two new director directives have been added:
4
5 \begin{verbatim}
6    Max Virtual Full Interval
7 and
8    Virtual Full Backup Pool
9 \end(verbatime)
10
11 The {\bf Max Virtual Full Interval} directive should behave similar to the
12 {\bf Max Full Interval}, but for Virtual Full jobs.  If Bacula sees that
13 there has not been a Full backup in Max Virtual Full Interval time then it
14 will upgrade the job to Virtual Full.  If you have both {\bf Max Full
15 Interval} and {\bf Max Virtual Full Interval} set then Max Full Interval
16 should take precedence.
17
18 The {\bf Virtual Full Backup Pool} directive allows one to change the pool
19 as well.  You probably want to use these two directives in
20 conjunction with each other but that may depend on the specifics of one's
21 setup.  If you set the {\bf Max Full Interval} without setting {\bf Max
22 Virtual Full Interval} then Bacula will use whatever the "default" pool is
23 set to which is the same behavior as with the Max Full Interval.
24
25 \subsection{Progressive Virtual Full}
26
27 In Bacula version 9.0.0, we have added a new Directive named {\bf Backups To Keep} that
28 permits you to implement Progressive Virtual Fulls within Bacula. Sometimes
29 this feature is known as Incremental Forever with Consolidation.
30
31 \smallskip
32
33 \begin{figure}[htbp]
34   \centering
35   \includegraphics[width=.8\linewidth]{pvf-slidingbackups}
36   \caption{Backup Sequence Slides Forward One Day, Each Day}
37   \label{fig:slidingbackups}
38 \end{figure}
39
40 To implement the Progressive Virtual Full feature, simply add the
41 {\bf Backups To Keep} directive to your Virtual Full backup Job resource.
42 The value specified on the directive indicates the number of backup jobs
43 that should not be merged into the Virtual Full (i.e.  the number of backup
44 jobs that should remain after the Virtual Full has completed.  The default
45 is zero, which reverts to a standard Virtual Full than consolidates all the
46 backup jobs that it finds.
47
48 \subsubsection{Backups To Keep Directive}
49 The new {\bf BackupsToKeep} directive is specified in the Job Resource and
50 has the form:
51
52 \begin{verbatim}
53    Backups To Keep = 30
54 \end{verbatim}
55
56 where the value (30 in the above figure and example) is the number of
57 backups to retain.  When this directive is present during a Virtual Full
58 (it is ignored for other Job types), it will look for the most recent Full
59 backup that has more subsequent backups than the value specified.  In the
60 above example the Job will simply terminate unless there is a Full back
61 followed by at least 31 backups of either level Differential or
62 Incremental.
63
64 \smallskip
65 Assuming that the last Full backup is followed by 32 Incremental backups, a
66 Virtual Full will be run that consolidates the Full with the first two
67 Incrementals that were run after the Full.  The result is that you will end
68 up with a Full followed by 30 Incremental backups. The Job Resource
69 in {\bf bacula-dir.conf} to accomplish this would be:
70
71 \begin{verbatim}
72    Job {
73      Name = "VFull"
74      Type = Backup
75      Level = VirtualFull
76      Client = "my-fd"
77      File Set = "FullSet"
78      Accurate = Yes
79      Backups To Keep = 10
80    }
81 \end{verbatim}
82
83 \subsubsection{Delete Consolidated Jobs}
84 The new directive {\bf Delete Consolidated Jobs} expects a {\bf yes}
85 or {\bf no} value that if set to {\bf yes} will cause any old Job that is
86 consolidated during a Virtual Full to be deleted. In the example above
87 we saw that a Full plus one other job (either an Incremental or
88 Differential) were consolidated into a new Full backup. The original Full
89 plus the other Job consolidated will be deleted. The default value is
90 {\bf no}.
91
92 \subsubsection{Virtual Full Compatibility}
93 Virtual Full as well as Progressive Virtual Full works with any
94 standard backup Job.
95
96 \smallskip
97 However, it should be noted that Virtual Full jobs are not compatible with
98 any plugins that you may be using.
99
100 \subsection{TapeAlert Enhancements}
101 There are some significant enhancements to the TapeAlert feature of Bacula.
102 Several directives are used slightly differently, which unfortunately
103 causes a compatibility problem with the old TapeAlert implementation.
104 Consequently, if you are already using TapeAlert, you must modify your
105 {\bf bacula-sd.conf} in order for Tape Alerts to work.  See below
106 for the details ...
107
108 \subsubsection{What is New}
109 First, you must define a \textbf{Alert Command} directive in the Device
110 resource that calls the new \textbf{tapealert} script that is installed in
111 the scripts directory (normally: /opt/bacula/scripts).  It is defined as
112 follows:
113
114 \begin{verbatim}
115 Device {
116   Name = ...
117   Archive Device = /dev/nst0
118   Alert Command = "/opt/bacula/scripts/tapealert %l"
119   Control Device = /dev/sg1 # must be SCSI ctl for /dev/nst0
120   ...
121 }
122 \end{verbatim}
123
124 In addition the \textbf{Control Device} directive in the Storage Daemon's
125 conf file must be specified in each Device resource to permit Bacula to
126 detect tape alerts on a specific devices (normally only tape devices).
127
128 Once the above mentioned two directives (Alert Command and Control Device)
129 are in place in each of your Device resources, Bacula will check for tape
130 alerts at two points:
131
132 \begin{itemize}
133 \item After the Drive is used and it becomes idle.
134 \item After each read or write error on the drive.
135 \end{itemize}
136
137 At each of the above times, Bacula will call the new \textbf{tapealert}
138 script, which uses the \textbf{tapeinfo} program.  The tapeinfo utility is
139 part of the apt sg3-utils and rpm sg3\_utils packages that must be
140 installed on your systems.  Then after each alert that Bacula finds for
141 that drive, Bacula will emit a Job message that is either INFO, WARNING, or
142 FATAL depending on the designation in the Tape Alert published by the T10
143 Technical Committee on SCSI Storage Interfaces (www.t10.org).  For the
144 specification, please see: www.t10.org/ftp/t10/document.02/02-142r0.pdf
145
146 \smallskip
147 As a somewhat extreme example, if tape alerts 3, 5, and 39 are set, you
148 will get the following output in your backup job.
149
150 {\small
151   \begin{verbatim}
152      17-Nov 13:37 rufus-sd JobId 1: Error: block.c:287 
153      Write error at 0:17 on device "tape"
154      (/home/kern/bacula/k/regress/working/ach/drive0)
155      Vol=TestVolume001. ERR=Input/output error.
156
157      17-Nov 13:37 rufus-sd JobId 1: Fatal error: Alert:
158      Volume="TestVolume001" alert=3: ERR=The operation has stopped because
159      an error has occurred while reading or writing data which the drive
160      cannot correct.  The drive had a hard read or write error
161
162      17-Nov 13:37 rufus-sd JobId 1: Fatal error: Alert:
163      Volume="TestVolume001" alert=5: ERR=The tape is damaged or the drive
164      is faulty.  Call the tape drive supplier helpline.  The drive can no
165      longer read data from the tape
166
167      17-Nov 13:37 rufus-sd JobId 1: Warning: Disabled Device "tape"
168      (/home/kern/bacula/k/regress/working/ach/drive0) due to tape alert=39.
169
170      17-Nov 13:37 rufus-sd JobId 1: Warning: Alert: Volume="TestVolume001"
171      alert=39: ERR=The tape drive may have a fault.  Check for availability
172      of diagnostic information and run extended diagnostics if applicable.
173      The drive may have had a failure which may be identified by stored
174      diagnostic information or by running extended diagnostics (eg Send
175      Diagnostic).  Check the tape drive users manual for instructions on
176      running extended diagnostic tests and retrieving diagnostic data.
177
178   \end{verbatim}
179 }
180
181 Without the tape alert feature enabled, you would only get the first error
182 message above, which is the error return Bacula received when it gets the
183 error.  Notice also, that in the above output the alert number 5 is a
184 critical error, which causes two things to happen.  First the tape drive is
185 disabled, and second the Job is failed.
186
187 \smallskip
188 If you attempt to run another Job using the Device that has been disabled,
189 you will get a message similar to the following:
190
191 \begin{verbatim}
192 17-Nov 15:08 rufus-sd JobId 2: Warning:
193      Device "tape" requested by DIR is disabled.
194 \end{verbatim}
195
196 and the Job may be failed if no other drive can be found.
197
198 \smallskip
199 Once the problem with the tape drive has been corrected, you can
200 clear the tape alerts and re-enable the device with the Bacula bconsole
201 command such as the following:
202
203 \begin{verbatim}
204   enable Storage=Tape
205 \end{verbatim}
206
207 Note, when you enable the device, the list of prior tape alerts for that
208 drive will be discarded.
209
210 \smallskip
211 Since is is possible to miss tape alerts, Bacula maintains a temporary list
212 of the last 8 alerts, and each time Bacula calls the \textbf{tapealert}
213 script, it will keep up to 10 alert status codes. Normally there will only
214 be one or two alert errors for each call to the tapealert script.
215
216 \smallskip
217 Once a drive has one or more tape alerts, you can see them by using the
218 bconsole status command as follows:
219 \begin{verbatim}
220 status storage=Tape
221 \end{verbatim}
222 which produces the following output:
223 \begin{verbatim}
224 Device Vtape is "tape" (/home/kern/bacula/k/regress/working/ach/drive0)
225 mounted with:
226     Volume:      TestVolume001
227     Pool:        Default
228     Media type:  tape
229     Device is disabled. User command.
230     Total Bytes Read=0 Blocks Read=1 Bytes/block=0
231     Positioned at File=1 Block=0
232     Critical Alert: at 17-Nov-2016 15:08:01 Volume="TestVolume001"
233        alert=Hard Error
234     Critical Alert: at 17-Nov-2016 15:08:01 Volume="TestVolume001"
235        alert=Read Failure
236     Warning Alert: at 17-Nov-2016 15:08:01 Volume="TestVolume001"
237        alert=Diagnostics Required
238 \end{verbatim}
239 if you want to see the long message associated with each of the alerts,
240 simply set the debug level to 10 or more and re-issue the status command:
241 \begin{verbatim}
242 setdebug storage=Tape level=10
243 status storage=Tape
244 \end{verbatim}
245 \begin{verbatim}
246     ...
247     Critical Alert: at 17-Nov-2016 15:08:01 Volume="TestVolume001"
248       flags=0x0 alert=The operation has stopped because an error has occurred
249        while reading or writing data which the drive cannot correct. The drive had
250        a hard read or write error
251     Critical Alert: at 17-Nov-2016 15:08:01 Volume="TestVolume001"
252        flags=0x0 alert=The tape is damaged or the drive is faulty. Call the tape
253        drive supplier helpline.  The drive can no longer read data from the tape
254     Warning Alert: at 17-Nov-2016 15:08:01 Volume="TestVolume001" flags=0x1
255        alert=The tape drive may have a fault. Check for availability of diagnostic
256        information and run extended diagnostics if applicable.   The drive may
257        have had a failure which may be identified by stored diagnostic information
258        or by running extended diagnostics (eg Send Diagnostic). Check the tape
259        drive users manual for instructions on running extended diagnostic tests
260        and retrieving diagnostic data.
261     ...
262 \end{verbatim}
263 The next time you \textbf{enable} the Device by either using
264 \textbf{bconsole} or you restart the Storage Daemon, all the saved alert
265 messages will be discarded.
266
267 \subsubsection{Handling of Alerts}
268 Tape Alerts numbered 7,8,13,14,20,22,52,53, and 54 will cause Bacula to
269 disable the current Volume.
270
271 \smallskip
272 Tape Alerts numbered 14,20,29,30,31,38, and 39 will cause Bacula to disable
273 the drive.
274
275 \smallskip
276 Please note certain tape alerts such as 14 have multiple effects (disable
277 the Volume and disable the drive).
278
279 \subsection{New Console ACL Directives}
280 By default, if a Console ACL directive is not set, Bacula will assume that the
281 ACL list is empty. If the current Bacula Director configuration uses restricted
282 Consoles and allows restore jobs, it is mandatory to configure the new
283 directives.
284
285 \subsubsection{DirectoryACL}
286 \index[dir]{Directive!DirectoryACL}
287
288 This directive is used to specify a list of directories that can be
289 accessed by a restore session.  Without this directive, a restricted
290 console cannot restore any file.  Multiple directories names may be
291 specified by separating them with commas, and/or by specifying multiple
292 DirectoryACL directives.  For example, the directive may be specified as:
293
294 \footnotesize
295 \begin{verbatim}
296     DirectoryACL = /home/bacula/, "/etc/", "/home/test/*"
297 \end{verbatim}
298 \normalsize
299
300 With the above specification, the console can access the following
301 directories:
302 \begin{itemize}
303 \item \texttt{/etc/password}
304 \item \texttt{/etc/group}
305 \item \texttt{/home/bacula/.bashrc}
306 \item \texttt{/home/test/.ssh/config}
307 \item \texttt{/home/test/Desktop/Images/something.png}
308 \end{itemize}
309
310 But not to the following files or directories:
311 \begin{itemize}
312 \item \texttt{/etc/security/limits.conf}
313 \item \texttt{/home/bacula/.ssh/id\_dsa.pub}
314 \item \texttt{/home/guest/something}
315 \item \texttt{/usr/bin/make}
316 \end{itemize}
317
318 If a directory starts with a Windows pattern (ex: c:/), Bacula will
319 automatically ignore the case when checking directory names.
320
321 \subsection{New Bconsole ``list''  Command Behavior}
322
323 The bconsole \texttt{list} commands can now be used safely from a
324 restricted bconsole session.  The information displayed will respect the
325 ACL configured for the Console session.  For example, if a restricted
326 Console has access to JobA, JobB and JobC, information about JobD will not
327 appear in the \texttt{list jobs} command.
328
329 \subsection{New Console ACL Directives}
330 \index[dir]{Directive!BackupClientACL}
331 It is now possible to configure a restricted Console to distinguish Backup
332 and Restore job permissions.  The \texttt{BackupClientACL} can restrict
333 backup jobs on a specific set of clients, while the
334 \texttt{RestoreClientACL} can restrict restore jobs.
335
336 {\small
337 \begin{verbatim}
338 # cat /opt/bacula/etc/bacula-dir.conf
339 ...
340
341 Console {
342  Name = fd-cons             # Name of the FD Console
343  Password = yyy
344 ...
345  ClientACL = localhost-fd           # everything allowed
346  RestoreClientACL = test-fd         # restore only
347  BackupClientACL = production-fd    # backup only
348 }
349 \end{verbatim}
350 }
351
352 The \texttt{ClientACL} directive takes precedence over the
353 \texttt{RestoreClientACL} and the \texttt{BackupClientACL}. In the Console
354 resource resource above, it means that the bconsole linked to the Console{}
355 named "fd-cons" will be able to run:
356
357 \begin{itemize}
358 \item backup and restore for ``localhost-fd''
359 \item backup for ``production-fd''
360 \item restore for ``test-fd''
361 \end{itemize}
362
363 At the restore time, jobs for client ``localhost-fd'', ``test-fd'' and
364 ``production-fd'' will be available.
365
366 If \texttt{*all*} is set for \texttt{ClientACL}, backup and restore will be
367 allowed for all clients, despite the use of \texttt{RestoreClientACL} or
368 \texttt{"BackupClientACL}.
369
370 \subsection{Client Initiated Backup}
371 \label{sec:featurecib}
372 A console program such as the new \texttt{tray-monitor} or
373 \texttt{bconsole} can now be configured to connect a File Daemon.  There
374 are many new features available (see the New Tray Monitor section below),
375 but probably the most important is the ability for the user to initiate a
376 backup of his own machine.  The connection established by the FD to the
377 Director for the backup will be used by the Director for the backup, thus
378 not only can clients (users) initiate backups, but a File Daemon that is
379 NATed (cannot be reached by the Director) can now be backed up without
380 using advanced tunneling techniques providing that the File Daemon can
381 connect to the Director.
382
383 \smallskip
384 The flow of information is shown in the picture below:
385 \bsysimageH{nat}{Client Initiated Backup Network Flow}{fig:nat3}
386
387 \newpage
388 \subsection{Configuring Client Initiated Backup}
389 \smallskip
390 In order to ensure security, there are a number of new directives
391 that must be enabled in the new \texttt{tray-monitor}, the File
392 Daemon and in the Director.
393 A typical configuration might look like the following:
394
395 {\small
396 \begin{verbatim}
397 # cat /opt/bacula/etc/bacula-dir.conf
398 ...
399
400 Console {
401  Name = fd-cons             # Name of the FD Console
402  Password = yyy
403
404  # These commands are used by the tray-monitor, it is possible to restrict
405  CommandACL = run, restore, wait, .status, .jobs, .clients
406  CommandACL = .storages, .pools, .filesets, .defaults, .estimate
407
408  # Adapt for your needs
409  jobacl = *all*
410  poolacl = *all*
411  clientacl = *all*
412  storageacl = *all*
413  catalogacl = *all*
414  filesetacl = *all*
415 }
416 \end{verbatim}
417 }
418
419 {\small
420 \begin{verbatim}
421 # cat /opt/bacula/etc/bacula-fd.conf
422 ...
423
424 Console {              # Console to connect the Director
425   Name = fd-cons
426   DIRPort = 9101
427   address = localhost
428   Password = "yyy"
429 }
430
431 Director {
432   Name = remote-cons   # Name of the tray monitor/bconsole
433   Password = "xxx"     # Password of the tray monitor/bconsole
434   Remote = yes         # Allow to use send commands to the Console defined
435 }
436 \end{verbatim}
437 }
438
439 {\small
440 \begin{verbatim}
441 cat /opt/bacula/etc/bconsole-remote.conf
442 ....
443
444 Director {
445   Name = localhost-fd
446   address = localhost        # Specify the FD address
447   DIRport = 9102             # Specify the FD Port
448   Password = "notused"
449 }
450
451 Console {
452   Name = remote-cons         # Name used in the auth process
453   Password = "xxx"
454 }
455 \end{verbatim}
456 }
457
458 {\small
459 \begin{verbatim}
460 cat ~/.bacula-tray-monitor.conf
461 Monitor {
462   Name = remote-cons
463 }
464
465 Client {
466   Name = localhost-fd
467   address = localhost     # Specify the FD address
468   Port = 9102             # Specify the FD Port
469   Password = "xxx"
470   Remote = yes
471 }
472 \end{verbatim}
473 }
474
475 \bsysimageH{conf-nat}{Relation Between Resources (bconsole)}{fig:nat}
476 \bsysimageH{conf-nat2}{Relation Between Resources (tray-monitor)}{fig:nat2}
477
478 \medskip
479 A more detailed description with complete examples is available in
480 chapter~\ref{TrayMonitorChapter}.
481
482 \subsection{New Tray Monitor}
483
484 A new tray monitor has been added to the 9.0 release, the tray monitor offers
485 the following features:
486
487 \begin{itemize}
488 \item Director, File and Storage Daemon status page
489 \item Support for the Client Initiated Backup protocol (See
490   \vref{sec:featurecib}). To use the Client Initiated Backup option from the
491   tray monitor, the Client option ``Remote'' should be checked in the
492   configuration (Fig \vref{fig:tray2}).
493 \item Wizard to run new job (Fig \vref{fig:tray4})
494 \item Display an estimation of the number of files and the size of the next
495   backup job (Fig \vref{fig:tray4})
496 \item Ability to configure the tray monitor configuration file directly from
497   the GUI (Fig \vref{fig:tray2})
498 \item Ability to monitor a component and adapt the tray monitor task bar icon
499   if a jobs are running.
500 \item TLS Support
501 \item Better network connection handling
502 \item Default configuration file is stored under \texttt{\$HOME/.bacula-tray-monitor.conf}
503 \item Ability to ``schedule'' jobs
504 \item Available on Linux and Windows platforms
505 \end{itemize}
506
507 % \medskip
508 % Please see chapter \ref{TrayMonitorChapter} for more details about this new
509 % functionality.
510
511
512 \begin{figure}[htbp]
513   \centering
514   \includegraphics[width=0.8\linewidth]{tray-monitor-status}
515   \caption{Tray Monitor Status}
516   \label{fig:tray0}
517 \end{figure}
518
519 \begin{figure}[htbp]
520   \centering
521   \includegraphics[width=0.9\linewidth]{tray-monitor-conf-fd}
522   \caption{Tray Monitor Client Configuration}
523   \label{fig:tray2}
524 \end{figure}
525
526 \begin{figure}[htbp]
527   \centering
528   \includegraphics[width=0.8\linewidth]{tray-monitor-run1}
529   \smallskip
530   \includegraphics[width=0.8\linewidth]{tray-monitor-run2}
531   \caption{Tray Monitor Run a Job}
532   \label{fig:tray4}
533 \end{figure}
534
535 \subsection{Schedule Jobs via the Tray Monitor}
536
537 The Tray Monitor can scan periodically a specific directory ``Command
538 Directory'' and process ``*.bcmd'' files to find jobs to run.
539
540 The format of the ``file.bcmd'' command file is the following:
541 \begin{verbatim}
542 <component name>:<run command>
543 <component name>:<run command>
544 ...
545
546 <component name> = string
547 <run command>    = string (bconsole command line)
548 \end{verbatim}
549
550 For example:
551 \begin{verbatim}
552 localhost-fd: run job=backup-localhost-fd level=full
553 localhost-dir: run job=BackupCatalog
554 \end{verbatim}
555
556 The command file should contain at least one command. The component specified
557 in the first part of the command line should be defined in the tray
558 monitor. Once the command file is detected by the tray monitor, a popup is
559 displayed to the user and it is possible for the user to cancel the job directly.
560
561 \smallskip{}
562
563 The file can be created with tools such as ``cron'' or the ``task scheduler''
564 on Windows. It is possible to verify the network connection at that time to
565 avoid network errors.
566
567 \begin{verbatim}
568 #!/bin/sh
569 if ping -c 1 director &> /dev/null
570 then
571    echo "my-dir: run job=backup" > /path/to/commands/backup.bcmd
572 fi
573 \end{verbatim}
574
575 %\bsysimageH{tray-monitor-status}{Tray Monitor Status}{fig:tray0}
576 %\bsysimageH{tray-monitor1}{Tray Monitor Configuration}{fig:tray1}
577 %\bsysimageH{tray-monitor-conf-fd}{Tray Monitor Client Configuration}{fig:tray2}
578 %\bsysimageH{tray-monitor-conf-dir}{Tray Monitor Director Configuration}{fig:tray3}
579 %\bsysimageH{tray-monitor-run1}{Tray Monitor Run new Job}{fig:tray4}
580 % find a way to group them together
581 %\bsysimageH{tray-monitor-run2}{Tray Monitor Setup new Job}{fig:tray5}
582
583
584 \subsection{Accurate Option for Verify ``Volume Data'' Job}
585
586 Since Bacula version 8.4.1, it has been possible to have a Verify Job
587 configured with \texttt{level=Data} that will reread all records from a job
588 and optionally check the size and the checksum of all files.  Starting with
589
590 \smallskip
591 Bacula version 9.0, it is now possible to use the \texttt{accurate} option to check
592 catalog records at the same time.  When using a Verify job with
593 \texttt{level=Data} and \texttt{accurate=yes} can replace the
594 \texttt{level=VolumeToCatalog} option.
595
596 For more information on how to setup a Verify Data job, see
597 \vref{label:verifyvolumedata}.
598
599 To run a Verify Job with the \texttt{accurate} option, it is possible to set
600 the option in the Job definition or set use the \texttt{accurate=yes} on the
601 command line.
602
603 \begin{verbatim}
604 * run job=VerifyData jobid=10 accurate=yes
605 \end{verbatim}
606
607 \subsection{FileDaemon Saved Messages Resource Destination}
608
609 It is now possible to send the list of all saved files to a Messages
610 resource with the \texttt{saved} message type.  It is not recommended to
611 send this flow of information to the director and/or the catalog when the
612 client FileSet is pretty large.  To avoid side effects, the \texttt{all}
613 keyword doesn't include the \texttt{saved} message type.  The
614 \texttt{saved} message type should be explicitely set.
615
616 \begin{verbatim}
617 # cat /opt/bacula/etc/bacula-fd.conf
618 ...
619 Messages {
620   Name = Standard
621   director = mydirector-dir = all, !terminate, !restored, !saved
622   append = /opt/bacula/working/bacula-fd.log = all, saved, restored
623 }
624 \end{verbatim}
625
626 \subsection{Minor Enhancements}
627
628 \subsubsection{New Bconsole ".estimate" Command}
629
630 The new \texttt{.estimate} command can be used to get statistics about a
631 job to run.  The command uses the database to approximate the size and the
632 number of files of the next job.  On a PostgreSQL database, the command
633 uses regression slope to compute values.  On SQLite or MySQL, where these
634 statistical functions are not available, the command uses a simple
635 ``average'' estimation.  The correlation number is given for each value.
636
637 {\small
638 \begin{verbatim}
639 *.estimate job=backup
640 level=I
641 nbjob=0
642 corrbytes=0
643 jobbytes=0
644 corrfiles=0
645 jobfiles=0
646 duration=0
647 job=backup
648
649 *.estimate job=backup level=F
650 level=F
651 nbjob=1
652 corrbytes=0
653 jobbytes=210937774
654 corrfiles=0
655 jobfiles=2545
656 duration=0
657 job=backup
658 \end{verbatim}
659 }
660
661 \subsubsection{Traceback and Lockdump}
662
663 After the reception of a signal, \texttt{traceback} and \texttt{lockdump}
664 information are now stored in the same file.
665
666 \subsection{Bconsole ``list jobs'' command options}
667
668 The \texttt{list jobs} bconsole command now accepts new command line options:
669
670 \begin{itemize}
671 \item \textbf{joberrors} Display jobs with JobErrors
672 \item \textbf{jobstatus=T} Display jobs with the specified status code
673 \item \textbf{client=cli} Display jobs for a specified client
674 \item \textbf{order=asc/desc} Change the output format of the job list. The
675   jobs are sorted by start time and JobId, the sort can use ascendant (asc) or
676   descendant (desc) (default) value.
677 \end{itemize}
678
679 \subsection{Minor Enhancements}
680
681 \subsubsection{New Bconsole "Tee All" Command}
682
683 The ``@tall'' command allows logging all input/output from a console session.
684
685 \begin{verbatim}
686 *@tall /tmp/log
687 *st dir
688 ...
689 \end{verbatim}
690
691 \subsection{Bconsole ``list jobs'' command options}
692
693 The \texttt{list jobs} bconsole command now accepts new command line options:
694
695 \begin{itemize}
696 \item \textbf{joberrors} Display jobs with JobErrors
697 \item \textbf{jobstatus=T} Display jobs with the specified status code
698 \item \textbf{client=cli} Display jobs for a specified client
699 \item \textbf{order=asc/desc} Change the output format of the job list. The
700   jobs are sorted by start time and JobId, the sort can use ascendant (asc) or
701   descendant (desc) (default) value.
702 \end{itemize}
703
704 \subsection{New Bconsole "Tee All" Command}
705
706 The ``@tall'' command allows logging all input/output from a console session.
707
708 \begin{verbatim}
709 *@tall /tmp/log
710 *st dir
711 ...
712 \end{verbatim}
713
714 \subsection{New Job Edit Codes \%I}
715 In various places such as RunScripts, you have now access to \%I to get the
716 JobId of the copy or migration job started by a migrate job.
717
718 \begin{verbatim}
719 Job {
720   Name = Migrate-Job
721   Type = Migrate
722   ...
723   RunAfter = "echo New JobId is %I"
724 }
725 \end{verbatim}
726
727
728 \subsection*{.api version 2}
729
730 In Bacula version 9.0 and later, we introduced a new .api version
731 to help external tools to parse various Bacula bconsole output.
732
733 % waa - 20150317 - this section needs just a little more to explain what the "43" in "s43" mean. Perhaps
734 %                  if it is not a good place to list the possibilities here, then list where a reference
735 %                  is. Also, I think   .api 2 ...   Means "use API version 2"  but that should be stated too
736
737 The \texttt{api\_opts} option can use the following arguments:
738 \begin{itemize}
739 \item [C] Clear current options
740 \item [tn] Use a specific time format (1 ISO format, 2 Unix Timestamp, 3 Default Bacula time format)
741 \item [sn] Use a specific separator between items (new line by default).
742 \item [Sn] Use a specific separator between objects (new line by default).
743 \item [o] Convert all keywords to lowercase and convert all non \textsl{isalpha} characters to \_
744 \end{itemize}
745
746 % waa - 20150317 - I think there should either be more output listed here to give a better feeling 
747 %                  or, perhaps another output listing for different .status commands
748
749 \begin{verbatim}
750   .api 2 api_opts=t1s43S35
751   .status dir running
752 ==================================
753 jobid=10
754 job=AJob
755 ...
756 \end{verbatim}
757
758 \subsection*{New Debug Options}
759
760 In Bacula version 9.0 and later, we introduced a new \texttt{options} parameter for
761 the \texttt{setdebug} bconsole command.
762
763 \smallskip{}
764
765 The following arguments to the new \texttt{option} parameter are available to control debug functions.
766
767 \begin{itemize}
768 \item [0] Clear debug flags
769 \item [i] Turn off, ignore bwrite() errors on restore on File Daemon
770 \item [d] Turn off decomp of BackupRead() streams on File Daemon
771 \item [t] Turn on timestamps in traces
772 \item [T] Turn off timestamps in traces
773
774 % waa - 20150306 - does this "c" item mean to say "Truncate trace file if one exists, otherwise append to it"   ???
775 \item [c] Truncate trace file if trace file is activated
776
777 \item [l] Turn on recoding events on P() and V()
778 \item [p] Turn on the display of the event ring when doing a bactrace
779 \end{itemize}
780
781 \smallskip{}
782
783 The following command will enable debugging for the File Daemon, truncate an existing trace file,
784 and turn on timestamps when writing to the trace file.
785
786 \begin{verbatim}
787 * setdebug level=10 trace=1 options=ct fd
788 \end{verbatim}
789
790 \smallskip{}
791
792 It is now possible to use a \textsl{class} of debug messages called \texttt{tags}
793 to control the debug output of Bacula daemons.
794
795 \begin{itemize}
796 \item [all] Display all debug messages
797 \item [bvfs] Display BVFS debug messages
798 \item [sql] Display SQL related debug messages
799 \item [memory] Display memory and poolmem allocation messages
800 \item [scheduler] Display scheduler related debug messages
801 \end{itemize}
802
803 \begin{verbatim}
804 * setdebug level=10 tags=bvfs,sql,memory
805 * setdebug level=10 tags=!bvfs
806
807 # bacula-dir -t -d 200,bvfs,sql
808 \end{verbatim}
809
810 The \texttt{tags} option is composed of a list of tags. Tags are separated by
811 ``,'' or ``+'' or ``-'' or ``!''. To disable a specific tag, use ``-'' or ``!''
812 in front of the tag. Note that more tags are planned for future versions.
813
814 %\LTXtable{\linewidth}{table_debugtags}
815
816 \subsection{Communication Line Compression}
817 Bacula version 9.0.0 and later now includes communication
818 line compression. It is turned on by default, and if the
819 two Bacula components (Dir, FD, SD, bconsole) are both
820 version 6.6.0 or greater, communication line compression)
821 will be enabled, by default. If for some reason, you do not want
822 communication line compression, you may disable it with the
823 following directive:
824
825 \begin{verbatim}
826 Comm Compression = no
827 \end{verbatim}
828
829 This directive can appear in the following resources:
830 \begin{verbatim}
831 bacula-dir.conf: Director resource
832 bacula-fd.conf Client (or FileDaemon) resource
833 bacula-sd.conf: Storage resource
834 bconsole.conf: Console resource
835 bat.conf: Console resource
836 \end{verbatim}
837
838 \smallskip
839 In many cases, the volume of data transmitted across the
840 communications line can be reduced by a factor of three when
841 this directive is enabled (default) In the case that the compression is not
842 effective, Bacula turns it off on a.  record by record basis.
843
844 \smallskip
845 If you are backing up data that is already compressed the comm line
846 compression will not be effective, and you are likely
847 to end up with an average compression ratio that is very small.
848 In this case, Bacula reports {\bf None} in the Job report. 
849
850
851 \chapter{New Features in 7.4.0}
852 This chapter presents the new features that have been added to
853 the various versions of Bacula.
854
855 \section{New Features in 7.4.3}
856 \subsection{RunScripts}
857 There are two new RunScript short cut directives implemented in
858 the Director.  They are:
859
860 \begin{verbatim}
861 Job {
862   ...
863   ConsoleRunBeforeJob = "console-command"
864   ...
865 }
866 \end{verbatim}
867
868 \begin{verbatim}
869 Job {
870   ...
871   ConsoleRunAfterJob = "console-command"
872   ...
873 }
874 \end{verbatim}
875
876 As with other RunScript commands, you may have multiple copies
877 of either the {\bf ConsoleRunBeforeJob} or the {\bf ConsoleRunAfterJob}
878 in the same Job resource definition.
879 \smallskip
880 Please note that not all console commands are permitted, and that 
881 if you run a console command that requires a response, the results
882 are not determined (i.e. it will probably fail).
883
884
885
886 \section{New Features in 7.4.0}
887 \subsection{Verify Volume Data}
888
889 It is now possible to have a Verify Job configured with \texttt{level=Data} to
890 reread all records from a job and optionally check the size and the checksum
891 of all files.
892
893 \begin{verbatim}
894 # Verify Job definition
895 Job {
896   Name = VerifyData
897   Level = Data
898   Client = 127.0.0.1-fd     # Use local file daemon
899   FileSet = Dummy           # Will be adapted during the job
900   Storage = File            # Should be the right one
901   Messages = Standard
902   Pool = Default
903 }
904
905 # Backup Job definition
906 Job {
907   Name = MyBackupJob
908   Type = Backup
909   Client = windows1
910   FileSet = MyFileSet
911   Pool = 1Month
912   Storage = File
913 }
914
915 FileSet {
916   Name = MyFileSet
917   Include {
918     Options {
919       Verify = s5
920       Signature = MD5
921     }
922   File = /
923 }
924 \end{verbatim}
925
926 To run the Verify job, it is possible to use the ``jobid'' parameter of the ``run'' command.
927
928 \begin{verbatim}
929 *run job=VerifyData jobid=10
930 Run Verify Job
931 JobName:     VerifyData
932 Level:       Data
933 Client:      127.0.0.1-fd
934 FileSet:     Dummy
935 Pool:        Default (From Job resource)
936 Storage:     File (From Job resource)
937 Verify Job:  MyBackupJob.2015-11-11_09.41.55_03
938 Verify List: /opt/bacula/working/working/VerifyVol.bsr
939 When:        2015-11-11 09:47:38
940 Priority:    10
941 OK to run? (yes/mod/no): yes
942 Job queued. JobId=14
943
944 ...
945
946 11-Nov 09:46 my-dir JobId 13: Bacula 7.4.0 (13Nov15):
947   Build OS:               x86_64-unknown-linux-gnu archlinux
948   JobId:                  14
949   Job:                    VerifyData.2015-11-11_09.46.29_03
950   FileSet:                MyFileSet
951   Verify Level:           Data
952   Client:                 127.0.0.1-fd
953   Verify JobId:           10
954   Verify Job:q
955   Start time:             11-Nov-2015 09:46:31
956   End time:               11-Nov-2015 09:46:32
957   Files Expected:         1,116
958   Files Examined:         1,116
959   Non-fatal FD errors:    0
960   SD Errors:              0
961   FD termination status:  Verify differences
962   SD termination status:  OK
963   Termination:            Verify Differences
964 \end{verbatim}
965
966 The current Verify Data implementation requires specifying the correct Storage
967 resource in the Verify job. The Storage resource can be changed with the bconsole
968 command line and with the menu.
969
970 \subsection{Bconsole ``list jobs'' command options}
971
972 The \texttt{list jobs} bconsole command now accepts new command line options:
973
974 \begin{itemize}
975 \item \textbf{joberrors} Display jobs with JobErrors
976 \item \textbf{jobstatus=T} Display jobs with the specified status code
977 \item \textbf{client=cli} Display jobs for a specified client
978 \item \textbf{order=asc/desc} Change the output format of the job list. The
979   jobs are sorted by start time and JobId, the sort can use ascendant (asc) or
980   descendant (desc) (default) value.
981 \end{itemize}
982
983 \subsection{Minor Enhancements}
984
985 \subsubsection{New Bconsole "Tee All" Command}
986
987 The ``@tall'' command allows logging all input/output from a console session.
988
989 \begin{verbatim}
990 *@tall /tmp/log
991 *st dir
992 ...
993 \end{verbatim}
994
995 \subsection{Windows Encrypted File System (EFS) Support}
996
997 The Bacula Enterprise Windows File Daemon for the community version
998 7.4.0 now automatically supports files and
999 directories that are encrypted on Windows filesystem.
1000
1001 \subsection{SSL Connections to MySQL}
1002
1003 There are five new Directives for the Catalog resource in the
1004 {\bf bacula-dir.conf} file that you can use to encrypt the 
1005 communications between Bacula and MySQL for additional
1006 security.
1007
1008 \begin{description}
1009 \item [dbsslkey] takes a string variable that specifies the filename of an
1010 SSL key file.
1011 \item [dbsslcert] takes a string variable that specifies the filename of an
1012 SSL certificate file.
1013 \item [dbsslca] takes a string variable that specifies the filename of a
1014 SSL CA (certificate authority) certificate.
1015 \item [dbsslcipher] takes a string variable that specifies the cipher
1016 to be used.
1017 \end{description}
1018
1019 \subsection{Max Virtual Full Interval}
1020 This is a new Job resource directive that specifies the time in seconds
1021 that is a maximum time between Virtual Full jobs.  It is much like the
1022 Max Full Interval directive but applies to Virtual Full jobs rather
1023 that Full jobs.
1024
1025 \subsection{New List Volumes Output}
1026 The {\bf list} and {\bf llist} commands have been modified so that when
1027 listing Volumes a new pseudo field {\bf expiresin} will be printed. This 
1028 field is the number of seconds in which the retention period will expire. 
1029 If the retention period has already expired the value will be zero.  Any
1030 non-zero value means that the retention period is still in effect.
1031
1032 An example with many columns shorted for display purpose is:
1033
1034 \begin{verbatim}
1035 *list volumes
1036 Pool: Default
1037 *list volumes
1038 Pool: Default
1039 +----+---------------+-----------+---------+-------------+-----------+
1040 | id | volumename    | volstatus | enabled | volbytes    | expiresin |
1041 +----+---------------+-----------+---------+-------------+-----------+
1042 |  1 | TestVolume001 | Full      |       1 | 249,940,696 |         0 |
1043 |  2 | TestVolume002 | Full      |       1 | 249,961,704 |         1 |
1044 |  3 | TestVolume003 | Full      |       1 | 249,961,704 |         2 |
1045 |  4 | TestVolume004 | Append    |       1 | 127,367,896 |         3 |
1046 +----+---------------+-----------+---------+-------------+-----------+
1047 \end{verbatim}
1048
1049 %%
1050 %%
1051 \chapter{New Features in 7.2.0}
1052 This chapter presents the new features that have been added to
1053 the various versions of Bacula.
1054
1055 \section{New Features in 7.2.0}
1056
1057 \subsection{New Job Edit Codes \%E \%R}
1058 In various places such as RunScripts, you have now access to \%E to get the
1059 number of non-fatal errors for the current Job and \%R to get the number of
1060 bytes read from disk or from the network during a job.
1061
1062 \subsection{Enable/Disable commands}
1063 The \textbf{bconsole} \textbf{enable} and \textbf{disable} commands have
1064 been extended from enabling/disabling Jobs to include Clients, Schedule,
1065 and Storage devices.  Examples:
1066
1067 \begin{verbatim}
1068    disable Job=NightlyBackup Client=Windows-fd
1069 \end{verbatim}
1070
1071 will disable the Job named \textbf{NightlyBackup} as well as the
1072 client named \textbf{Windows-fd}.
1073
1074 \begin{verbatim}
1075    disable Storage=LTO-changer Drive=1
1076 \end{verbatim}
1077
1078 will disable the first drive in the autochanger named \textbf{LTO-changer}.
1079
1080 Please note that doing a \textbf{reload} command will set any values
1081 changed by the enable/disable commands back to the values in the
1082 bacula-dir.conf file.
1083
1084 The Client and Schedule resources in the bacula-dir.conf file now permit
1085 the directive Enable = yes or Enable = no.
1086
1087
1088 \section{Bacula 7.2}
1089
1090 \subsection{Snapshot Management}
1091
1092 Bacula 7.2 is now able to handle Snapshots on Linux/Unix
1093 systems. Snapshots can be automatically created and used to backup files. It is
1094 also possible to manage Snapshots from Bacula's \texttt{bconsole} tool through a
1095 unique interface.
1096
1097 \subsubsection{Snapshot Backends}
1098
1099 The following Snapshot backends are supported with Bacula Enterprise 8.2:
1100
1101 \begin{itemize}
1102 \item BTRFS
1103 \item ZFS
1104 \item LVM\footnote{Some restrictions described in \vref{LVMBackend} applies to
1105     the LVM backend}
1106 \end{itemize}
1107
1108 By default, Snapshots are mounted (or directly available) under
1109 \textbf{.snapshots} directory on the root filesystem. (On ZFS, the default
1110 is \textbf{.zfs/snapshots}).
1111
1112 \smallskip{}
1113
1114 The Snapshot backend program is called \textbf{bsnapshot} and is available in
1115 the \textbf{bacula-enterprise-snapshot} package. In order to use the Snapshot
1116 Management feature, the package must be installed on the Client.
1117
1118 \smallskip{}
1119 \label{bsnapshotconf}
1120 The \textbf{bsnapshot} program can be configured using
1121 \texttt{/opt/bacula/etc/bsnapshot.conf} file. The following parameters can
1122 be adjusted in the configuration file:
1123
1124 \begin{itemize}
1125 \item \texttt{trace=<file>} Specify a trace file
1126 \item \texttt{debug=<num>} Specify a debug level
1127 \item \texttt{sudo=<yes/no>} Use sudo to run commands
1128 \item \texttt{disabled=<yes/no>} Disable snapshot support
1129 \item \texttt{retry=<num>} Configure the number of retries for some operations
1130 \item \texttt{snapshot\_dir=<dirname>} Use a custom name for the Snapshot directory. (\textbf{.SNAPSHOT}, \textbf{.snapdir}, etc...)
1131 \item \texttt{lvm\_snapshot\_size=<lvpath:size>} Specify a custom snapshot size for a given LVM volume
1132 \end{itemize}
1133
1134 \begin{verbatim}
1135 # cat /opt/bacula/etc/bsnapshot.conf
1136 trace=/tmp/snap.log
1137 debug=10
1138 lvm_snapshot_size=/dev/ubuntu-vg/root:5%
1139 \end{verbatim}
1140
1141
1142 \subsubsection{Application Quiescing}
1143
1144 When using Snapshots, it is very important to quiesce applications that are
1145 running on the system. The simplest way to quiesce an application is to stop
1146 it. Usually, taking the Snapshot is very fast, and the downtime is only about a
1147 couple of seconds. If downtime is not possible and/or the application provides
1148 a way to quiesce, a more advanced script can be used. An example is
1149 described on \vref{SnapRunScriptExample}.
1150
1151 \subsubsection{New Director Directives}
1152
1153 The use of the Snapshot Engine on the FileDaemon is determined by the
1154 new \textbf{Enable Snapshot} FileSet directive. The default is \textbf{no}.
1155
1156 \begin{verbatim}
1157 FileSet {
1158   Name = LinuxHome
1159
1160   Enable Snapshot = yes
1161
1162   Include {
1163     Options = { Compression = LZO }
1164     File = /home
1165   }
1166 }
1167 \end{verbatim}
1168
1169 By default, Snapshots are deleted from the Client at the end of the backup.  To
1170 keep Snapshots on the Client and record them in the Catalog for a determined
1171 period, it is possible to use the \textbf{Snapshot Retention} directive in the
1172 Client or in the Job resource. The default value is 0 secconds. If, for a given Job,
1173 both Client and Job \textbf{Snapshot Retention} directives are set, the Job
1174 directive will be used.
1175
1176 \begin{verbatim}
1177 Client {
1178    Name = linux1
1179    ...
1180
1181    Snapshot Retention = 5 days
1182 }
1183 \end{verbatim}
1184
1185 To automatically prune Snapshots, it is possible to use the following RunScript
1186 command:
1187
1188 \begin{verbatim}
1189 Job {
1190    ...
1191    Client = linux1
1192    ...
1193    RunScript {
1194       RunsOnClient = no
1195       Console = "prune snapshot client=%c yes"
1196       RunsAfter = yes
1197    }
1198 }
1199 \end{verbatim}
1200
1201
1202 \smallskip{}
1203
1204 In RunScripts, the \texttt{AfterSnapshot} keyword for the \texttt{RunsWhen} directive will
1205 allow a command to be run just after the Snapshot creation.  \texttt{AfterSnapshot} is a
1206 synonym for the \texttt{AfterVSS} keyword.
1207
1208 \label{SnapRunScriptExample}
1209 \begin{verbatim}
1210 Job {
1211  ...
1212   RunScript {
1213     Command = "/etc/init.d/mysql start"
1214     RunsWhen = AfterSnapshot
1215     RunsOnClient = yes
1216   }
1217   RunScript {
1218     Command = "/etc/init.d/mysql stop"
1219     RunsWhen = Before
1220     RunsOnClient = yes
1221   }
1222 }
1223 \end{verbatim}
1224
1225 \subsubsection{Job Output Information}
1226
1227 Information about Snapshots are displayed in the Job output. The list of all
1228 devices used by the Snapshot Engine is displayed, and the Job summary
1229 indicates if Snapshots were available.
1230
1231 \begin{verbatim}
1232 JobId 3:    Create Snapshot of /home/build
1233 JobId 3:    Create Snapshot of /home/build/subvol
1234 JobId 3:    Delete snapshot of /home/build
1235 JobId 3:    Delete snapshot of /home/build/subvol
1236 ...
1237 JobId 3: Bacula 127.0.0.1-dir 7.2.0 (23Jul15):
1238   Build OS:               x86_64-unknown-linux-gnu archlinux 
1239   JobId:                  3
1240   Job:                    Incremental.2015-02-24_11.20.27_08
1241   Backup Level:           Full
1242 ...
1243   Snapshot/VSS:           yes
1244 ...
1245   Termination:            Backup OK
1246 \end{verbatim}
1247
1248
1249 \subsubsection{New ``snapshot'' Bconsole Commands}
1250
1251 The new \textbf{snapshot} command will display by default the following menu:
1252 \begin{verbatim}
1253 *snapshot
1254 Snapshot choice:
1255      1: List snapshots in Catalog
1256      2: List snapshots on Client
1257      3: Prune snapshots
1258      4: Delete snapshot
1259      5: Update snapshot parameters
1260      6: Update catalog with Client snapshots
1261      7: Done
1262 Select action to perform on Snapshot Engine (1-7):
1263 \end{verbatim}
1264
1265 The \textbf{snapshot} command can also have the following parameters:
1266 \begin{verbatim}
1267 [client=<client-name> | job=<job-name> | jobid=<jobid>]
1268  [delete | list | listclient | prune | sync | update]
1269 \end{verbatim}
1270
1271 It is also possible to use traditional \texttt{list}, \texttt{llist},
1272 \texttt{update}, \texttt{prune} or \texttt{delete} commands on Snapshots.
1273
1274 \begin{verbatim}
1275 *llist snapshot jobid=5
1276  snapshotid: 1
1277        name: NightlySave.2015-02-24_12.01.00_04
1278  createdate: 2015-02-24 12:01:03
1279      client: 127.0.0.1-fd
1280     fileset: Full Set
1281       jobid: 5
1282      volume: /home/.snapshots/NightlySave.2015-02-24_12.01.00_04
1283      device: /home/btrfs
1284        type: btrfs
1285   retention: 30
1286     comment:
1287 \end{verbatim}
1288
1289 \begin{verbatim}
1290 * snapshot listclient
1291 Automatically selected Client: 127.0.0.1-fd
1292 Connecting to Client 127.0.0.1-fd at 127.0.0.1:8102
1293 Snapshot      NightlySave.2015-02-24_12.01.00_04:
1294   Volume:     /home/.snapshots/NightlySave.2015-02-24_12.01.00_04
1295   Device:     /home
1296   CreateDate: 2015-02-24 12:01:03
1297   Type:       btrfs
1298   Status:     OK
1299   Error:
1300 \end{verbatim}
1301
1302 \smallskip{}
1303
1304 With the \textsl{Update catalog with Client snapshots} option (or
1305 \textbf{snapshot sync}), the Director contacts the FileDaemon, lists snapshots
1306 of the system and creates catalog records of the Snapshots.
1307
1308 \begin{verbatim}
1309 *snapshot sync
1310 Automatically selected Client: 127.0.0.1-fd
1311 Connecting to Client 127.0.0.1-fd at 127.0.0.1:8102
1312 Snapshot      NightlySave.2015-02-24_12.35.47_06:
1313   Volume:     /home/.snapshots/NightlySave.2015-02-24_12.35.47_06
1314   Device:     /home
1315   CreateDate: 2015-02-24 12:35:47
1316   Type:       btrfs
1317   Status:     OK
1318   Error:
1319 Snapshot added in Catalog
1320
1321 *llist snapshot
1322  snapshotid: 13
1323        name: NightlySave.2015-02-24_12.35.47_06
1324  createdate: 2015-02-24 12:35:47
1325      client: 127.0.0.1-fd
1326     fileset:
1327       jobid: 0
1328      volume: /home/.snapshots/NightlySave.2015-02-24_12.35.47_06
1329      device: /home
1330        type: btrfs
1331   retention: 0
1332     comment: 
1333 \end{verbatim}
1334
1335 % list
1336 % llist
1337 % prune
1338 % delete
1339 % update snapshot
1340 % sync
1341
1342 \subsubsection{LVM Backend Restrictions}
1343 \label{LVMBackend}
1344
1345 LVM Snapshots are quite primitive compared to ZFS, BTRFS, NetApp and other
1346 systems. For example, it is not possible to use Snapshots if the Volume Group
1347 (VG) is full. The administrator must keep some free space in the VG
1348 to create Snapshots. The amount of free space required depends on the activity of the
1349 Logical Volume (LV). \textbf{bsnapshot} uses 10\% of the LV by
1350 default. This number can be configured per LV in the
1351 \textbf{bsnapshot.conf} file.
1352
1353 \begin{verbatim}
1354 [root@system1]# vgdisplay
1355   --- Volume group ---
1356   VG Name               vg_ssd
1357   System ID
1358   Format                lvm2
1359 ...
1360   VG Size               29,81 GiB
1361   PE Size               4,00 MiB
1362   Total PE              7632
1363   Alloc PE / Size       125 / 500,00 MiB
1364   Free  PE / Size       7507 / 29,32 GiB
1365 ...
1366 \end{verbatim}
1367
1368 It is also not advisable to leave snapshots on the LVM backend. Having multiple
1369 snapshots of the same LV on LVM will slow down the system.
1370
1371 \subsubsection{Debug Options}
1372
1373 To get low level information about the Snapshot Engine, the debug tag ``snapshot''
1374 should be used in the \textbf{setdebug} command.
1375
1376 \begin{verbatim}
1377 * setdebug level=10 tags=snapshot client
1378 * setdebug level=10 tags=snapshot dir
1379 \end{verbatim}
1380
1381 \subsection{Minor Enhancements}
1382 \subsubsection{Storage Daemon Reports Disk Usage}
1383
1384 The \texttt{status storage} command now  reports the space available on disk devices:
1385 \begin{verbatim}
1386 ...
1387 Device status:
1388
1389 Device file: "FileStorage" (/bacula/arch1) is not open.
1390     Available Space=5.762 GB
1391 ==
1392
1393 Device file: "FileStorage1" (/bacula/arch2) is not open.
1394     Available Space=5.862 GB
1395 \end{verbatim}
1396
1397 \subsection{Data Encryption Cipher Configuration}
1398 Bacula Enterprise version 8.0 and later now allows configuration of the data
1399 encryption cipher and the digest algorithm. Previously, the cipher was forced to AES 128,
1400 but it is now possible to choose between the following ciphers:
1401
1402 \begin{itemize}
1403 \item AES128 (default)
1404 \item AES192
1405 \item AES256
1406 \item blowfish
1407 \end{itemize}
1408
1409 The digest algorithm was set to SHA1 or SHA256 depending on the local OpenSSL
1410 options. We advise you to not modify the PkiDigest default setting. Please,
1411 refer to the OpenSSL documentation to understand the pros and cons regarding these options.
1412
1413 \begin{verbatim}
1414   FileDaemon {
1415     ...
1416     PkiCipher = AES256
1417   }
1418 \end{verbatim}
1419
1420 \subsubsection*{New Option Letter ``M'' for Accurate Directive in FileSet}
1421
1422 % waa - 20150317 - is 8.0.5 correct here?
1423 Added in version 8.0.5, the new ``M'' option letter for the Accurate directive
1424 in the FileSet Options block, which allows comparing the modification time and/or
1425 creation time against the last backup timestamp. This is in contrast to the
1426 existing options letters ``m'' and/or ``c'', mtime and ctime, which are checked
1427 against the stored catalog values, which can vary accross different machines
1428 when using the BaseJob feature.
1429
1430 The advantage of the new ``M'' option letter for Jobs that refer to BaseJobs is
1431 that it will instruct Bacula to backup files based on the last backup time, which
1432 is more useful because the mtime/ctime timestamps may differ on various Clients,
1433 causing files to be needlessly backed up.
1434
1435 \smallskip{}
1436
1437 \begin{verbatim}
1438   Job {
1439     Name = USR
1440     Level = Base
1441     FileSet = BaseFS
1442 ...
1443   }
1444
1445   Job {
1446     Name = Full
1447     FileSet = FullFS
1448     Base = USR
1449 ...
1450   }
1451
1452   FileSet {
1453     Name = BaseFS
1454     Include {
1455       Options {
1456         Signature = MD5
1457       }
1458       File = /usr
1459     }
1460   }
1461
1462   FileSet {
1463     Name = FullFS
1464     Include {
1465       Options {
1466         Accurate = Ms      # check for mtime/ctime of last backup timestamp and Size
1467         Signature = MD5
1468       }
1469       File = /home
1470       File = /usr
1471     }
1472   }
1473 \end{verbatim}
1474
1475 \subsection{Read Only Storage Devices}
1476 This version of Bacula allows you to define a Storage deamon device
1477 to be read-only. If the {\bf Read Only} directive is specified and
1478 enabled, the drive can only be used for read operations.
1479 The {\bf Read Only} directive can be defined in any bacula-sd.conf
1480 Device resource, and is most useful for reserving one or more
1481 drives for restores. An example is:
1482
1483 \begin{verbatim}
1484 Read Only = yes
1485 \end{verbatim}
1486
1487 \subsection{New Resume Command}
1488 The new \texttt{resume} command does exactly the same thing as a
1489 {\bf restart} command, but for some users the
1490 name may be more logical because in general the
1491 {\bf restart} command is used to resume running
1492 a Job that was incomplete.
1493
1494 \subsection{New Prune ``Expired'' Volume Command}
1495 In Bacula Enterprise 6.4, it is now possible to prune all volumes
1496 (from a pool, or globally) that are ``expired''.  This option can be
1497 scheduled after or before the backup of the catalog and can be
1498 combined with the \texttt{Truncate On Purge} option.  The \texttt{prune expired volme} command may
1499 be used instead of the \texttt{manual\_prune.pl} script.
1500
1501 \begin{verbatim}
1502 * prune expired volume
1503
1504 * prune expired volume pool=FullPool
1505 \end{verbatim}
1506
1507 To schedule this option automatically, it can be added to the Catalog backup job
1508 definition.
1509
1510 \begin{verbatim}
1511  Job {
1512    Name = CatalogBackup
1513    ...
1514    RunScript {
1515      Console = "prune expired volume yes"
1516      RunsWhen = Before
1517    }
1518  }
1519 \end{verbatim}
1520
1521
1522 \subsection{New Job Edit Codes \%P \%C}
1523 In various places such as RunScripts, you have now access to \%P to get the
1524 current Bacula process ID (PID) and \%C to know if the current job is a
1525 cloned job.
1526
1527 \subsection{Enhanced Status and Error Messages}
1528 We have enhanced the Storage daemon status output to be more
1529 readable. This is important when there are a large number of
1530 devices. In addition to formatting changes, it also includes more
1531 details on which devices are reading and writing.
1532
1533 A number of error messages have been enhanced to have more specific
1534 data on what went wrong.
1535
1536 If a file changes size while being backed up the old and new size
1537 are reported.
1538
1539 \subsection{Miscellaneous New Features}
1540 \begin{itemize}
1541 \item Allow unlimited line lengths in .conf files (previously limited
1542 to 2000 characters).
1543
1544 \item Allow /dev/null in ChangerCommand to indicated a Virtual Autochanger.
1545
1546 \item Add a --fileprune option to the manual\_prune.pl script.
1547
1548 \item Add a -m option to make\_catalog\_backup.pl to do maintenance
1549 on the catalog.
1550
1551 \item Safer code that cleans up the working directory when starting
1552 the daemons. It limits what files can be deleted, hence enhances 
1553 security.
1554
1555 \item Added a new .ls command in bconsole to permit browsing a client's
1556 filesystem.
1557
1558 \item Fixed a number of bugs, includes some obscure seg faults, and a
1559 race condition that occurred infrequently when running Copy, Migration,
1560 or Virtual Full backups.
1561
1562 \item Upgraded to a newer version of Qt4 for bat. All indications
1563 are that this will improve bat's stability on Windows machines.
1564
1565 \item The Windows installers now detect and refuse to install on
1566 an OS that does not match the 32/64 bit value of the installer.
1567 \end{itemize}
1568
1569 \subsection{FD Storage Address}
1570
1571 When the Director is behind a NAT, in a WAN area, to connect to
1572 % the FileDaemon or
1573 the StorageDaemon, the Director uses an ``external'' ip address,
1574 and the FileDaemon should use an ``internal'' IP address to contact the
1575 StorageDaemon.
1576
1577 The normal way to handle this situation is to use a canonical name such as
1578 ``storage-server'' that will be resolved on the Director side as the WAN
1579 address and on the Client side as the LAN address. This is now possible to
1580 configure this parameter using the new directive \texttt{FDStorageAddress} in
1581 the Storage or Client resource.
1582
1583
1584 %%\bsysimageH{BackupOverWan1}{Backup Over WAN}{figbs6:fdstorageaddress}
1585 %  \label{fig:fdstorageaddress}
1586
1587 \begin{verbatim}
1588 Storage {
1589      Name = storage1
1590      Address = 65.1.1.1
1591      FD Storage Address = 10.0.0.1
1592      SD Port = 9103
1593      ...
1594 }
1595 \end{verbatim}
1596
1597 % # or in the Client resouce
1598 %
1599
1600 \begin{verbatim}
1601  Client {
1602       Name = client1
1603       Address = 65.1.1.2
1604       FD Storage Address = 10.0.0.1
1605       FD Port = 9102
1606       ...
1607  }
1608 \end{verbatim}
1609
1610 Note that using the Client \texttt{FDStorageAddress} directive will not allow
1611 to use multiple Storage Daemon, all Backup or Restore requests will be sent to
1612 the specified \texttt{FDStorageAddress}.
1613
1614 \subsection{Maximum Concurrent Read Jobs}
1615 This is a new directive that can be used in the {\bf bacula-dir.conf} file
1616 in the Storage resource.  The main purpose is to limit the number
1617 of concurrent Copy, Migration, and VirtualFull jobs so that
1618 they don't monopolize all the Storage drives causing a deadlock situation
1619 where all the drives are allocated for reading but none remain for
1620 writing.  This deadlock situation can occur when running multiple
1621 simultaneous Copy, Migration, and VirtualFull jobs.
1622
1623 \smallskip
1624 The default value is set to 0 (zero), which means there is no
1625 limit on the number of read jobs.  Note, limiting the read jobs
1626 does not apply to Restore jobs, which are normally started by
1627 hand.  A reasonable value for this directive is one half the number
1628 of drives that the Storage resource has rounded down.  Doing so,
1629 will leave the same number of drives for writing and will generally
1630 avoid over committing drives and a deadlock.
1631
1632 \subsection{Incomplete Jobs}
1633 During a backup, if the Storage daemon experiences disconnection
1634 with the File daemon during backup (normally a comm line problem
1635 or possibly an FD failure), under conditions that the SD determines
1636 to be safe it will make the failed job as Incomplete rather than
1637 failed.  This is done only if there is sufficient valid backup
1638 data that was written to the Volume. The advantage of an Incomplete
1639 job is that it can be restarted by the new bconsole {\bf restart}
1640 command from the point where it left off rather than from the
1641 beginning of the jobs as is the case with a cancel.
1642
1643 \subsection{The Stop Command}
1644 Bacula has been enhanced to provide a {\bf stop} command,
1645 very similar to the {\bf cancel} command with the main difference
1646 that the Job that is stopped is marked as Incomplete so that
1647 it can be restarted later by the {\bf restart} command where
1648 it left off (see below).  The {\bf stop} command with no
1649 arguments, will like the cancel command, prompt you with the
1650 list of running jobs allowing you to select one, which might
1651 look like the following:
1652
1653 \begin{verbatim}
1654 *stop
1655 Select Job:
1656      1: JobId=3 Job=Incremental.2012-03-26_12.04.26_07
1657      2: JobId=4 Job=Incremental.2012-03-26_12.04.30_08
1658      3: JobId=5 Job=Incremental.2012-03-26_12.04.36_09
1659 Choose Job to stop (1-3): 2
1660 2001 Job "Incremental.2012-03-26_12.04.30_08" marked to be stopped.
1661 3000 JobId=4 Job="Incremental.2012-03-26_12.04.30_08" marked to be stopped.
1662 \end{verbatim}
1663
1664 \subsection{The Restart Command}
1665 The new {\bf Restart command} allows console users to restart
1666 a canceled, failed, or incomplete Job.  For canceled and failed
1667 Jobs, the Job will restart from the beginning.  For incomplete
1668 Jobs the Job will restart at the point that it was stopped either
1669 by a stop command or by some recoverable failure.
1670
1671 \smallskip
1672 If you enter the {\bf restart} command in bconsole, you will get the
1673 following prompts:
1674
1675 \begin{verbatim}
1676 *restart
1677 You have the following choices:
1678      1: Incomplete
1679      2: Canceled
1680      3: Failed
1681      4: All
1682 Select termination code:  (1-4):
1683 \end{verbatim}
1684
1685 If you select the {\bf All} option, you may see something like:
1686
1687 \begin{verbatim}
1688 Select termination code:  (1-4): 4
1689 +-------+-------------+---------------------+------+-------+----------+-----------+-----------+
1690 | jobid | name        | starttime           | type | level | jobfiles |
1691 jobbytes  | jobstatus |
1692 +-------+-------------+---------------------+------+-------+----------+-----------+-----------+
1693 |     1 | Incremental | 2012-03-26 12:15:21 | B    | F     |        0 |
1694     0 | A         |
1695 |     2 | Incremental | 2012-03-26 12:18:14 | B    | F     |      350 |
1696 4,013,397 | I         |
1697 |     3 | Incremental | 2012-03-26 12:18:30 | B    | F     |        0 |
1698     0 | A         |
1699 |     4 | Incremental | 2012-03-26 12:18:38 | B    | F     |      331 |
1700 3,548,058 | I         |
1701 +-------+-------------+---------------------+------+-------+----------+-----------+-----------+
1702 Enter the JobId list to select:
1703 \end{verbatim}
1704
1705 Then you may enter one or more JobIds to be restarted, which may
1706 take the form of a list of JobIds separated by commas, and/or JobId
1707 ranges such as {\bf 1-4}, which indicates you want to restart JobIds
1708 1 through 4, inclusive.
1709
1710 \subsection{Job Bandwidth Limitation}
1711
1712 The new {\bf Job Bandwidth Limitation} directive may be added to the File
1713 daemon's and/or Director's configuration to limit the bandwidth used by a
1714 Job on a Client.  It can be set in the File daemon's conf file for all Jobs
1715 run in that File daemon, or it can be set for each Job in the Director's
1716 conf file. The speed is always specified in bytes per second.
1717
1718 For example:
1719 \begin{verbatim}
1720 FileDaemon {
1721   Name = localhost-fd
1722   Working Directory = /some/path
1723   Pid Directory = /some/path
1724   ...
1725   Maximum Bandwidth Per Job = 5Mb/s
1726 }
1727 \end{verbatim}
1728
1729 The above example would cause any jobs running with the FileDaemon to not
1730 exceed 5 megabytes per second of throughput when sending data to the
1731 Storage Daemon. Note, the speed is always specified in bytes per second
1732 (not in bits per second), and the case (upper/lower) of the specification
1733 characters is ignored (i.e. 1MB/s = 1Mb/s).
1734
1735 You may specify the following speed parameter modifiers:
1736    k/s (1,000 bytes per second), kb/s (1,024 bytes per second),
1737    m/s (1,000,000 bytes per second), or mb/s (1,048,576 bytes per second).
1738
1739 For example:
1740 \begin{verbatim}
1741 Job {
1742   Name = locahost-data
1743   FileSet = FS_localhost
1744   Accurate = yes
1745   ...
1746   Maximum Bandwidth = 5Mb/s
1747   ...
1748 }
1749 \end{verbatim}
1750
1751 The above example would cause Job \texttt{localhost-data} to not exceed 5MB/s
1752 of throughput when sending data from the File daemon to the Storage daemon.
1753
1754 A new console command \texttt{setbandwidth} permits to set dynamically the
1755 maximum throughput of a running Job or for future jobs of a Client.
1756
1757 \begin{verbatim}
1758 * setbandwidth limit=1000 jobid=10
1759 \end{verbatim}
1760
1761 Please note that the value specified for the \texttt{limit} command
1762 line parameter is always in units of 1024 bytes (i.e. the number
1763 is multiplied by 1024 to give the number of bytes per second).  As 
1764 a consequence, the above limit of 1000 will be interpreted as a
1765 limit of 1000 * 1024 = 1,024,000 bytes per second.
1766
1767 \subsection{Always Backup a File}
1768
1769 When the Accurate mode is turned on, you can decide to always backup a file
1770 by using then new {\bf A} Accurate option in your FileSet. For example:
1771
1772 \begin{verbatim}
1773 Job {
1774    Name = ...
1775    FileSet = FS_Example
1776    Accurate = yes
1777    ...
1778 }
1779
1780 FileSet {
1781  Name = FS_Example
1782  Include {
1783    Options {
1784      Accurate = A
1785    }
1786    File = /file
1787    File = /file2
1788  }
1789  ...
1790 }
1791 \end{verbatim}
1792
1793 This project was funded by Bacula Systems based on an idea of James Harper and
1794 is available with the Bacula Enterprise Edition.
1795
1796 \subsection{Setting Accurate Mode at Runtime}
1797
1798 You are now able to specify the Accurate mode on the \texttt{run} command and
1799 in the Schedule resource.
1800
1801 \begin{verbatim}
1802 * run accurate=yes job=Test
1803 \end{verbatim}
1804
1805 \begin{verbatim}
1806 Schedule {
1807   Name = WeeklyCycle
1808   Run = Full 1st sun at 23:05
1809   Run = Differential accurate=yes 2nd-5th sun at 23:05
1810   Run = Incremental  accurate=no  mon-sat at 23:05
1811 }
1812 \end{verbatim}
1813
1814 It can allow you to save memory and and CPU resources on the catalog server in
1815 some cases.
1816
1817 \medskip
1818 These advanced tuning options are available with the Bacula Enterprise Edition.
1819
1820 % Common with community
1821 \subsection{Additions to RunScript variables}
1822 You can have access to JobBytes, JobFiles and Director name using \%b, \%F and \%D
1823 in your runscript command. The Client address is now available through \%h.
1824
1825 \begin{verbatim}
1826 RunAfterJob = "/bin/echo Job=%j JobBytes=%b JobFiles=%F ClientAddress=%h Dir=%D"
1827 \end{verbatim}
1828
1829 \subsection{LZO Compression}
1830
1831 LZO compression was added in the Unix File Daemon. From the user point of view,
1832 it works like the GZIP compression (just replace {\bf compression=GZIP} with
1833 {\bf compression=LZO}).
1834
1835 For example:
1836 \begin{verbatim}
1837 Include {
1838    Options { compression=LZO }
1839    File = /home
1840    File = /data
1841 }
1842 \end{verbatim}
1843
1844 LZO provides much faster compression and decompression speed but lower
1845 compression ratio than GZIP. It is a good option when you backup to disk. For
1846 tape, the built-in compression may be a better option.
1847
1848 LZO is a good alternative for GZIP1 when you don't want to slow down your
1849 backup. On a modern CPU it should be able to run almost as fast as:
1850
1851 \begin{itemize}
1852 \item your client can read data from disk. Unless you have very fast disks like
1853   SSD or large/fast RAID array.
1854 \item the data transfers between the file daemon and the storage daemon even on
1855   a 1Gb/s link.
1856 \end{itemize}
1857
1858 Note that bacula only use one compression level LZO1X-1.
1859
1860 \medskip
1861 The code for this feature was contributed by Laurent Papier.
1862
1863 \subsection{Purge Migration Job}
1864
1865 The new {\bf Purge Migration Job} directive may be added to the Migration
1866 Job definition in the Director's configuration file. When it is enabled
1867 the Job that was migrated during a migration will be purged at
1868 the end of the migration job.
1869
1870 For example:
1871 \begin{verbatim}
1872 Job {
1873   Name = "migrate-job"
1874   Type = Migrate
1875   Level = Full
1876   Client = localhost-fd
1877   FileSet = "Full Set"
1878   Messages = Standard
1879   Storage = DiskChanger
1880   Pool = Default
1881   Selection Type = Job
1882   Selection Pattern = ".*Save"
1883 ...
1884   Purge Migration Job = yes
1885 }
1886 \end{verbatim}
1887
1888 \medskip
1889
1890 This project was submitted by Dunlap Blake; testing and documentation was funded
1891 by Bacula Systems.
1892
1893 \subsection{Changes in the Pruning Algorithm}
1894
1895 We rewrote the job pruning algorithm in this version.  Previously, in some
1896 users reported that the pruning process at the end of jobs was very long.
1897 It should not be longer the case.  Now, Bacula won't prune automatically a
1898 Job if this particular Job is needed to restore data.  Example:
1899
1900 \begin{verbatim}
1901 JobId: 1  Level: Full
1902 JobId: 2  Level: Incremental
1903 JobId: 3  Level: Incremental
1904 JobId: 4  Level: Differential
1905 .. Other incrementals up to now
1906 \end{verbatim}
1907
1908 In this example, if the Job Retention defined in the Pool or in the Client
1909 resource causes that Jobs with Jobid in 1,2,3,4 can be pruned, Bacula will
1910 detect that JobId 1 and 4 are essential to restore data at the current state
1911 and will prune only JobId 2 and 3.
1912
1913 \texttt{Important}, this change affect only the automatic pruning step
1914 after a Job and the \texttt{prune jobs} Bconsole command.  If a volume
1915 expires after the \texttt{VolumeRetention} period, important jobs can be
1916 pruned.
1917
1918 \subsection{Ability to Verify any specified Job}
1919 You now have the ability to tell Bacula which Job should verify instead of
1920 automatically verify just the last one.
1921
1922 This feature can be used with VolumeToCatalog, DiskToCatalog and Catalog level.
1923
1924 To verify a given job, just specify the Job jobid in argument when starting the
1925 job.
1926 \begin{verbatim}
1927 *run job=VerifyVolume jobid=1 level=VolumeToCatalog
1928 Run Verify job
1929 JobName:     VerifyVolume
1930 Level:       VolumeToCatalog
1931 Client:      127.0.0.1-fd
1932 FileSet:     Full Set
1933 Pool:        Default (From Job resource)
1934 Storage:     File (From Job resource)
1935 Verify Job:  VerifyVol.2010-09-08_14.17.17_03
1936 Verify List: /tmp/regress/working/VerifyVol.bsr
1937 When:        2010-09-08 14:17:31
1938 Priority:    10
1939 OK to run? (yes/mod/no):
1940 \end{verbatim}
1941
1942
1943
1944 \chapter{New Features in 7.0.0}
1945 This chapter presents the new features that have been added to
1946 the various versions of Bacula.
1947
1948 \section{New Features in 7.0.0}
1949
1950 \subsection{Storage daemon to Storage daemon}
1951 Bacula version 7.0 permits SD to SD transfer of Copy and Migration
1952 Jobs. This permits what is commonly referred to as replication or
1953 off-site transfer of Bacula backups.  It occurs automatically, if
1954 the source SD and destination SD of a Copy or Migration job are
1955 different. The following picture shows how this works.
1956
1957 \includegraphics[width=0.8\linewidth]{sd-to-sd}
1958
1959 \subsection{SD Calls Client}
1960 If the {\bf SD Calls Client} directive is set to true in a Client resource
1961 any Backup, Restore, Verify, Copy, or Migration Job where the client
1962 is involved, the client will wait for the Storage daemon to contact it.
1963 By default this directive is set to false, and the Client will call
1964 the Storage daemon.  This directive can be useful if your Storage daemon
1965 is behind a firewall that permits outgoing connections but not incoming
1966 one. The following picture shows the communications connection paths in
1967 both cases.
1968
1969 \includegraphics[width=0.8\linewidth]{sd-calls-client}
1970
1971 \subsection{Next Pool}
1972 In previous versions of Bacula the Next Pool directive could be
1973 specified in the Pool resource for use with Migration and Copy Jobs.
1974 The Next Pool concept has been 
1975 extended in Bacula version 7.0.0 to allow you to specify the 
1976 Next Pool directive in the Job resource as well. If specified in
1977 the Job resource, it will override any value specified in the Pool
1978 resource.
1979
1980 In addition to being permitted in the Job resource, the 
1981 {\bf nextpool=xxx} specification can be specified as a run
1982 override in the {\bf run} directive of a Schedule resource.
1983 Any {\bf nextpool} specification in a {\bf run}
1984 directive will override any other specification in either
1985 the Job or the Pool. 
1986
1987 In general, more information is displayed in the Job log
1988 on exactly which Next Pool specification is ultimately used.
1989
1990 \subsection{status storage}
1991 The bconsole {\bf status storage} has been modified to attempt to eliminate
1992 duplicate storage resources and only show one that references any given
1993 storage daemon.  This might be confusing at first, but tends to make a
1994 much more compact list of storage resource from which to select if there
1995 are multiple storage devices in the same storage daemon.
1996
1997 If you want the old behavior (always display all storage resources) simply 
1998 add the keyword {\bf select} to the command -- i.e. use
1999 {\bf status select storage}.
2000
2001
2002
2003
2004
2005 \subsection{status schedule}
2006 A new status command option called {\bf scheduled} has been implemented
2007 in bconsole. By default it will display 20 lines of the next scheduled
2008 jobs.  For example, with the default bacula-dir.conf configuration file,
2009 a bconsole command {\bf status scheduled} produces:
2010
2011 \begin{verbatim}
2012 Scheduled Jobs:
2013 Level        Type   Pri  Scheduled        Job Name     Schedule
2014 ======================================================================
2015 Differential Backup 10  Sun 30-Mar 23:05 BackupClient1 WeeklyCycle
2016 Incremental  Backup 10  Mon 24-Mar 23:05 BackupClient1 WeeklyCycle
2017 Incremental  Backup 10  Tue 25-Mar 23:05 BackupClient1 WeeklyCycle
2018 ...
2019 Full         Backup 11  Mon 24-Mar 23:10 BackupCatalog WeeklyCycleAfterBackup
2020 Full         Backup 11  Wed 26-Mar 23:10 BackupCatalog WeeklyCycleAfterBackup
2021 ...
2022 ====
2023 \end{verbatim}
2024
2025 Note, the output is listed by the Jobs found, and is not sorted
2026 chronologically.
2027
2028 \smallskip
2029 This command has a number of options, most of which act as filters:
2030 \begin{itemize}
2031 \item {\bf days=nn} This specifies the number of days to list. The default is
2032   10 but can be set from 0 to 500.
2033 \item {\bf limit=nn} This specifies the limit to the number of lines to print.
2034   The default is 100 but can be any number in the range 0 to 2000.
2035 \item {\bf time="YYYY-MM-DD HH:MM:SS"} Sets the start time for listing the
2036   scheduled jobs. The default is to use the current time. Note, the
2037   time value must be specified inside double quotes and must be in
2038   the exact form shown above.
2039 \item {\bf schedule=schedule-name} This option restricts the output to
2040   the named schedule.
2041 \item {\bf job=job-name} This option restricts the output to the specified
2042   Job name.
2043 \end{itemize}
2044
2045 \subsection{Data Encryption Cipher Configuration}
2046 Bacula version 7.0 and later now allows to configure the data
2047 encryption cipher and the digest algorithm. The cipher was forced to AES
2048 128, and it is now possible to choose between the following ciphers:
2049
2050 \begin{itemize}
2051 \item AES128 (default)
2052 \item AES192
2053 \item AES256
2054 \item blowfish
2055 \end{itemize}
2056
2057 The digest algorithm was set to SHA1 or SHA256 depending on the local
2058 OpenSSL
2059 options. We advise you to not modify the PkiDigest default setting. Please,
2060 refer to OpenSSL documentation to know about pro and cons on these options.
2061
2062 \begin{verbatim}
2063   FileDaemon {
2064     ...
2065     PkiCipher = AES256
2066   }
2067 \end{verbatim}
2068
2069 \subsection{New Truncate Command}
2070 We have added a new truncate command to bconsole, which
2071 will truncate a Volume if the Volume is purged and if
2072 the Volume is also marked {\bf Action On Purge = Truncate}.
2073 This feature was originally added in Bacula version 5.0.1,
2074 but the mechanism for actually doing the truncate required
2075 the user to enter a command such as:
2076
2077 \begin{verbatim}
2078 purge volume action=truncate storage=File pool=Default
2079 \end{verbatim}
2080
2081 The above command is now simplified to be:
2082
2083 \begin{verbatim}
2084 truncate storage=File pool=Default
2085 \end{verbatim}
2086
2087 \subsection{Migration/Copy/VirtualFull Performance Enhancements}
2088 The Bacula Storage daemon now permits multiple jobs to simultaneously read
2089 the same disk Volume, which gives substantial performance enhancements when
2090 running Migration, Copy, or VirtualFull jobs that read disk Volumes.  Our
2091 testing shows that when running multiple simultaneous jobs, the jobs can
2092 finish up to ten times faster with this version of Bacula.  This is
2093 built-in to the Storage daemon, so it happens automatically and
2094 transparently.
2095
2096 \subsection{VirtualFull Backup Consolidation Enhancements}
2097 By default Bacula selects jobs automatically for a VirtualFull,
2098 however, you may want to create the Virtual backup based on a
2099 particular backup (point in time) that exists.
2100
2101 For example, if you have the following backup Jobs in your catalog:
2102 \begin{verbatim}
2103 +-------+---------+-------+----------+----------+-----------+
2104 | JobId | Name    | Level | JobFiles | JobBytes | JobStatus |
2105 +-------+---------+-------+----------+----------+-----------+
2106 | 1     | Vbackup | F     | 1754     | 50118554 | T         |
2107 | 2     | Vbackup | I     | 1        | 4        | T         |
2108 | 3     | Vbackup | I     | 1        | 4        | T         |
2109 | 4     | Vbackup | D     | 2        | 8        | T         |
2110 | 5     | Vbackup | I     | 1        | 6        | T         |
2111 | 6     | Vbackup | I     | 10       | 60       | T         |
2112 | 7     | Vbackup | I     | 11       | 65       | T         |
2113 | 8     | Save    | F     | 1758     | 50118564 | T         |
2114 +-------+---------+-------+----------+----------+-----------+
2115 \end{verbatim}
2116
2117 and you want to consolidate only the first 3 jobs and create a
2118 virtual backup equivalent to Job 1 + Job 2 + Job 3, you will use
2119 \texttt{jobid=3} in the \texttt{run} command, then Bacula will select the
2120 previous Full backup, the previous Differential (if any) and all subsequent
2121 Incremental jobs.
2122
2123 \begin{verbatim}
2124 run job=Vbackup jobid=3 level=VirtualFull
2125 \end{verbatim}
2126
2127 If you want to consolidate a specific job list, you must specify the exact
2128 list of jobs to merge in the run command line.  For example, to consolidate
2129 the last Differential and all subsequent Incremental, you will use
2130 \texttt{jobid=4,5,6,7} or \texttt{jobid=4-7} on the run command line. As one
2131 of the Job in the list is a Differential backup, Bacula will set the new job
2132 level to Differential. If the list is composed only with Incremental jobs,
2133 the new job will have a level set to Incremental.
2134
2135 \begin{verbatim}
2136 run job=Vbackup jobid=4-7 level=VirtualFull
2137 \end{verbatim}
2138
2139 When using this feature, Bacula will automatically discard jobs that are
2140 not related to the current Job.  For example, specifying
2141 \texttt{jobid=7,8}, Bacula will discard JobId 8 because it is not
2142 part of the same backup Job.
2143
2144 We do not recommend it, but really want to consolidate jobs that have
2145 different names (so probably different clients, filesets, etc...), you must
2146 use \texttt{alljobid=} keyword instead of \texttt{jobid=}.
2147
2148 \begin{verbatim}
2149 run job=Vbackup alljobid=1-3,6-8 level=VirtualFull
2150 \end{verbatim}
2151
2152
2153 \subsection{FD Storage Address}
2154
2155 When the Director is behind a NAT, in a WAN area, to connect to
2156 % the FileDaemon or
2157 the StorageDaemon, the Director uses an ``external'' ip address,
2158 and the FileDaemon should use an ``internal'' IP address to contact the
2159 StorageDaemon.
2160
2161 The normal way to handle this situation is to use a canonical name such as
2162 ``storage-server'' that will be resolved on the Director side as the WAN
2163 address and on the Client side as the LAN address. This is now possible to
2164 configure this parameter using the new directive \texttt{FDStorageAddress} in
2165 the Storage or Client resource.
2166
2167
2168 \includegraphics[width=0.8\linewidth]{BackupOverWan1}
2169 \label{fig:fdstorageaddress}
2170
2171 \begin{verbatim}
2172 Storage {
2173      Name = storage1
2174      Address = 65.1.1.1
2175      FD Storage Address = 10.0.0.1
2176      SD Port = 9103
2177      ...
2178 }
2179 \end{verbatim}
2180
2181 % # or in the Client resouce
2182 %
2183
2184 \begin{verbatim}
2185  Client {
2186       Name = client1
2187       Address = 65.1.1.2
2188       FD Storage Address = 10.0.0.1
2189       FD Port = 9102
2190       ...
2191  }
2192 \end{verbatim}
2193
2194 Note that using the Client \texttt{FDStorageAddress} directive will not allow
2195 to use multiple Storage Daemon, all Backup or Restore requests will be sent to
2196 the specified \texttt{FDStorageAddress}.
2197
2198 \subsection{Job Bandwidth Limitation}
2199
2200 The new {\bf Job Bandwidth Limitation} directive may be added to the File
2201 daemon's and/or Director's configuration to limit the bandwidth used by a
2202 Job on a Client.  It can be set in the File daemon's conf file for all Jobs
2203 run in that File daemon, or it can be set for each Job in the Director's
2204 conf file. The speed is always specified in bytes per second.
2205
2206 For example:
2207 \begin{verbatim}
2208 FileDaemon {
2209   Name = localhost-fd
2210   Working Directory = /some/path
2211   Pid Directory = /some/path
2212   ...
2213   Maximum Bandwidth Per Job = 5Mb/s
2214 }
2215 \end{verbatim}
2216
2217 The above example would cause any jobs running with the FileDaemon to not
2218 exceed 5 megabytes per second of throughput when sending data to the
2219 Storage Daemon. Note, the speed is always specified in bytes per second
2220 (not in bits per second), and the case (upper/lower) of the specification
2221 characters is ignored (i.e. 1MB/s = 1Mb/s).
2222
2223 You may specify the following speed parameter modifiers:
2224    k/s (1,000 bytes per second), kb/s (1,024 bytes per second),
2225    m/s (1,000,000 bytes per second), or mb/s (1,048,576 bytes per second).
2226
2227 For example:
2228 \begin{verbatim}
2229 Job {
2230   Name = locahost-data
2231   FileSet = FS_localhost
2232   Accurate = yes
2233   ...
2234   Maximum Bandwidth = 5Mb/s
2235   ...
2236 }
2237 \end{verbatim}
2238
2239 The above example would cause Job \texttt{localhost-data} to not exceed 5MB/s
2240 of throughput when sending data from the File daemon to the Storage daemon.
2241
2242 A new console command \texttt{setbandwidth} permits to set dynamically the
2243 maximum throughput of a running Job or for future jobs of a Client.
2244
2245 \begin{verbatim}
2246 * setbandwidth limit=1000 jobid=10
2247 \end{verbatim}
2248
2249 Please note that the value specified for the \texttt{limit} command
2250 line parameter is always in units of 1024 bytes (i.e. the number
2251 is multiplied by 1024 to give the number of bytes per second).  As 
2252 a consequence, the above limit of 1000 will be interpreted as a
2253 limit of 1000 * 1024 = 1,024,000 bytes per second.
2254
2255 \medskip
2256 This project was funded by Bacula Systems.
2257
2258
2259 \subsection{Maximum Concurrent Read Jobs}
2260 This is a new directive that can be used in the {\bf bacula-dir.conf} file
2261 in the Storage resource.  The main purpose is to limit the number
2262 of concurrent Copy, Migration, and VirtualFull jobs so that
2263 they don't monopolize all the Storage drives causing a deadlock situation
2264 where all the drives are allocated for reading but none remain for
2265 writing.  This deadlock situation can occur when running multiple
2266 simultaneous Copy, Migration, and VirtualFull jobs.
2267
2268 \smallskip
2269 The default value is set to 0 (zero), which means there is no
2270 limit on the number of read jobs.  Note, limiting the read jobs
2271 does not apply to Restore jobs, which are normally started by
2272 hand.  A reasonable value for this directive is one half the number
2273 of drives that the Storage resource has rounded down.  Doing so,
2274 will leave the same number of drives for writing and will generally
2275 avoid over committing drives and a deadlock.
2276
2277
2278 \subsection{Director job Codes in Message Resource Commands}
2279 Before submitting the specified mail command to the operating system, Bacula
2280 performs character substitution like in Runscript commands. Bacula will now
2281 perform also specific Director character substitution.
2282
2283 \smallskip{}
2284 The code for this feature was contributed by Bastian Friedrich.
2285
2286 \subsection{Additions to RunScript variables}
2287 The following variables are now available in runscripts:
2288 \begin{itemize}
2289 \item current PID using \%P
2290 \item if the job is a clone job using \%C
2291 \end{itemize}
2292
2293 \begin{verbatim}
2294 RunAfterJob = "/bin/echo Pid=%P isCloned=%C" 
2295
2296 \end{verbatim}
2297
2298 \subsection{Read Only Storage Devices}
2299 This version of Bacula permits defining a Storage daemon device
2300 to be read-only. That is if the {\bf ReadOnly} directive is specified and
2301 enabled, the drive can only be used for read operations.
2302 The the {\bf ReadOnly} directive can be defined in any bacula-sd.conf
2303 Device resource, and is most useful to reserve one or more 
2304 drives for restores. An example is:
2305
2306 \begin{verbatim}
2307 Read Only = yes
2308 \end{verbatim}
2309
2310 \subsection{New Prune ``Expired'' Volume Command}
2311 It is now possible to prune all volumes
2312 (from a pool, or globally) that are ``expired''.  This option can be
2313 scheduled after or before the backup of the Catalog and can be
2314 combined with the Truncate On Purge option.  The Expired Prune option can
2315 be used instead of the \texttt{manual\_prune.pl} script.
2316
2317 \begin{verbatim}
2318 * prune expired volumes
2319
2320 * prune expired volumes pool=FullPool
2321 \end{verbatim}
2322
2323 To schedule this option automatically, it can be added to the BackupCatalog job
2324 definition.
2325
2326 \begin{verbatim}
2327  Job {
2328    Name = CatalogBackup
2329    ...
2330    RunScript {
2331      Console = "prune expired volume yes"
2332      RunsWhen = Before
2333    }
2334  }
2335 \end{verbatim}
2336
2337 \subsection{Hardlink Performance Enhancements}
2338 If you use a program such as Cyrus IMAP that creates very large numbers
2339 of hardlinks, the time to build the interactive restore tree can be
2340 excessively long. This version of Bacula has a new feature that
2341 automatically keeps the hardlinks associated with the restore tree
2342 in memory, which consumes a bit more memory but vastly speeds up 
2343 building the tree.  If the memory usage is too big for your system, you
2344 can reduce the amount of memory used during the restore command by
2345 adding the option {\bf optimizespeed=false} on the bconsole run
2346 command line.
2347
2348 This feature was developed by Josip Almasi, and enhanced to be runtime
2349 dynamic by Kern Sibbald.
2350
2351 \subsection{DisableCommand Directive}
2352 There is a new Directive named {\bf Disable Command} that
2353 can be put in the File daemon Client or Director resource.
2354 If it is in the Client, it applies globally, otherwise the
2355 directive applies only to the Director in which it is found.
2356 The Disable Command adds security to your File daemon by
2357 disabling certain commands.  The commands that can be
2358 disabled are:
2359
2360 \begin{verbatim}
2361 backup       
2362 cancel       
2363 setdebug=    
2364 setbandwidth=
2365 estimate     
2366 fileset      
2367 JobId=       
2368 level =      
2369 restore      
2370 endrestore   
2371 session      
2372 status       
2373 .status      
2374 storage      
2375 verify       
2376 RunBeforeNow 
2377 RunBeforeJob 
2378 RunAfterJob  
2379 Run          
2380 accurate
2381 \end{verbatim}
2382
2383 On or more of these command keywords can be placed in quotes and separated
2384 by spaces on the Disable Command directive line.  Note: the commands must
2385 be written exactly as they appear above.
2386
2387 \subsection{Multiple Console Directors}
2388 Support for multiple bconsole and bat Directors in the bconsole.conf and
2389 bat.conf files has been implemented and/or improved.
2390
2391 \subsection{Restricted Consoles}
2392 Better support for Restricted consoles has been implement for bconsole and
2393 bat.
2394
2395 \subsection{Configuration Files}
2396 In previous versions of Bacula the configuration files for each component
2397 were limited to a maximum of 499 bytes per configuration file line. This
2398 version of Bacula permits unlimited input line lengths.  This can be
2399 especially useful for specifying more complicated Migration/Copy SQL
2400 statements and in creating long restricted console ACL lists.
2401
2402 \subsection{Maximum Spawned Jobs}
2403 The Job resource now permits specifying a number of {\bf Maximum Spawn
2404 Jobs}. The default is 300.  This directive can be useful if you have
2405 big hardware and you do a lot of Migration/Copy jobs which start
2406 at the same time.  In prior versions of Bacula, Migration/Copy
2407 was limited to spawning a maximum of 100 jobs at a time.
2408
2409 \subsection{Progress Meter}
2410 The new File daemon has been enhanced to send its progress (files
2411 processed and bytes written) to the Director every 30 seconds. These
2412 figures can then be displayed with a bconsole {\bf status dir} 
2413 command.
2414
2415 \subsection{Scheduling a 6th Week}
2416 Prior version of Bacula permits specifying 1st through 5th week of 
2417 a month (first through fifth) as a keyword on the {\bf run}
2418 directive of a Schedule resource.  This version of Bacula also permits
2419 specifying the 6th week of a month with the keyword {\bf sixth} or
2420 {\bf 6th}.
2421
2422 \subsection{Scheduling the Last Day of a Month}
2423 This version of Bacula now permits specifying the {\bf lastday}
2424 keyword in the {\bf run} directive of a Schedule resource.
2425 If {\bf lastday} is specified, it will apply only to those months
2426 specified on the {\bf run} directive.  Note: by default all months
2427 are specified.
2428
2429 \subsection{Improvements to Cancel and Restart bconsole Commands}
2430 The Restart bconsole command now allow selection of either
2431 canceled or failed jobs to be restarted.  In addition both the
2432 {\bf cancel} and {\bf restart} bconsole commands permit entering
2433 a number of JobIds separated by commas or a range of JobIds indicated
2434 by a dash between the begin and end range (e.g. 3-10).  Finally the
2435 two commands also allow one to enter the special keyword {\bf all}
2436 to select all the appropriate Jobs.
2437
2438 \subsection{bconsole Performance Improvements}
2439 In previous versions of Bacula certain bconsole commands could wait a long
2440 time due to catalog lock contention.  This was especially noticeable 
2441 when a large number of jobs were running and putting their attributes
2442 into the catalog.  This version uses a separate catalog connection that
2443 should significantly enhance performance.
2444
2445 \subsection{New .bvfs\_decode\_lstat Command}
2446 There is a new bconsole command, which is
2447 {\bf .bvfs\_decode\_lstat} it requires one argument, which
2448 is {\bf lstat="lstat value to decode"}.  An example command
2449 in bconsole and the output might be:
2450
2451 \small
2452 \begin{verbatim}
2453 .bvfs_decode_lstat lstat="A A EHt B A A A JP BAA B BTL/A7 BTL/A7 BTL/A7 A A C"
2454
2455 st_nlink=1
2456 st_mode=16877
2457 st_uid=0
2458 st_gid=0
2459 st_size=591
2460 st_blocks=1
2461 st_ino=0
2462 st_ctime=1395650619
2463 st_mtime=1395650619
2464 st_mtime=1395650619
2465 st_dev=0
2466 LinkFI=0
2467 \end{verbatim}
2468 \normalsize
2469
2470
2471 \subsection*{New Debug Options}
2472
2473 In Bacula Enterprise version 8.0 and later, we introduced new options to
2474 the \texttt{setdebug} command.
2475
2476 \smallskip{}
2477
2478 If the \texttt{options} parameter is set, the following arguments can be
2479 used to control debug functions.
2480
2481 \begin{itemize}
2482 \item [0] clear debug flags
2483 \item [i] Turn off, ignore bwrite() errors on restore on File Daemon
2484 \item [d] Turn off decomp of BackupRead() streams on File Daemon
2485 \item [t] Turn on timestamp in traces
2486 \item [T] Turn off timestamp in traces
2487 \item [c] Truncate trace file if trace file is activated
2488 \item [l] Turn on recoding events on P() and V()
2489 \item [p] Turn on the display of the event ring when doing a bactrace
2490 \end{itemize}
2491
2492 \smallskip{}
2493
2494 The following command will truncate the trace file and will turn on timestamps
2495 in the trace file.
2496
2497 \begin{verbatim}
2498 * setdebug level=10 trace=1 options=ct fd
2499 \end{verbatim}
2500
2501 \smallskip{}
2502
2503 It is now possible to use \textsl{class} of debug messages called \texttt{tags}
2504 to control the debug output of Bacula daemons.
2505
2506 \begin{itemize}
2507 \item [all] Display all debug messages
2508 \item [bvfs] Display BVFS debug messages
2509 \item [sql] Display SQL related debug messages
2510 \item [memory] Display memory and poolmem allocation messages
2511 \item [scheduler] Display scheduler related debug messages
2512 \end{itemize}
2513
2514 \begin{verbatim}
2515 * setdebug level=10 tags=bvfs,sql,memory
2516 * setdebug level=10 tags=!bvfs
2517
2518 # bacula-dir -t -d 200,bvfs,sql
2519 \end{verbatim}
2520
2521 The \texttt{tags} option is composed of a list of tags, tags are separated by
2522 ``,'' or ``+'' or ``-'' or ``!''. To disable a specific tag, use ``-'' or ``!''
2523 in front of the tag. Note that more tags will come in future versions.
2524
2525 %\LTXtable{\linewidth}{table_debugtags}
2526
2527
2528 \chapter{New Features in 5.2.13}
2529 This chapter presents the new features that have been added to the current
2530 Community version of Bacula that is now released.
2531
2532 \subsection{Additions to RunScript variables}
2533 You can have access to Director name using \%D in your runscript
2534 command.
2535
2536 \begin{verbatim}
2537 RunAfterJob = "/bin/echo Director=%D 
2538 \end{verbatim}
2539
2540 \section{New Features in 5.2.1}
2541 This chapter presents the new features were added in the
2542 Community release version 5.2.1.
2543
2544 There are additional features (plugins) available in the Enterprise version
2545 that are described in another chapter. A subscription to Bacula Systems
2546 is required for the Enterprise version.
2547
2548 \subsection{LZO Compression}
2549
2550 LZO compression has been to the File daemon. From the user's point of view,
2551 it works like the GZIP compression (just replace {\bf compression=GZIP} with
2552 {\bf compression=LZO}).
2553
2554 For example:
2555 \begin{verbatim}
2556 Include {
2557    Options {compression=LZO }
2558    File = /home
2559    File = /data
2560 }
2561 \end{verbatim}
2562
2563 LZO provides a much faster compression and decompression speed but lower
2564 compression ratio than GZIP. It is a good option when you backup to disk. For
2565 tape, the hardware compression is almost always a better option.
2566
2567 LZO is a good alternative for GZIP1 when you don't want to slow down your
2568 backup. With a modern CPU it should be able to run almost as fast as:
2569
2570 \begin{itemize}
2571 \item your client can read data from disk. Unless you have very fast disks like
2572   SSD or large/fast RAID array.
2573 \item the data transfers between the file daemon and the storage daemon even on
2574   a 1Gb/s link.
2575 \end{itemize}
2576
2577 Note, Bacula uses compression level LZO1X-1.
2578
2579 \medskip
2580 The code for this feature was contributed by Laurent Papier.
2581
2582 \subsection{New Tray Monitor}
2583
2584 Since the old integrated Windows tray monitor doesn't work with
2585 recent Windows versions, we have written a new Qt Tray Monitor that is available
2586 for both Linux and Windows.  In addition to all the previous features,
2587 this new version allows you to run Backups from 
2588 the tray monitor menu.
2589
2590 \begin{figure}[htbp]
2591   \centering
2592   \includegraphics[width=0.8\linewidth]{tray-monitor}
2593   \label{fig:traymonitor}
2594   \caption{New tray monitor}
2595 \end{figure}
2596
2597 \begin{figure}[htbp]
2598   \centering
2599   \includegraphics[width=0.8\linewidth]{tray-monitor1}
2600   \label{fig:traymonitor1}
2601   \caption{Run a Job through the new tray monitor}
2602 \end{figure}
2603
2604
2605 To be able to run a job from the tray monitor, you need to
2606 allow specific commands in the Director monitor console:
2607 \begin{verbatim}
2608 Console {
2609     Name = win2003-mon
2610     Password = "xxx"
2611     CommandACL = status, .clients, .jobs, .pools, .storage, .filesets, .messages, run
2612     ClientACL = *all*               # you can restrict to a specific host
2613     CatalogACL = *all*
2614     JobACL = *all*
2615     StorageACL = *all*
2616     ScheduleACL = *all*
2617     PoolACL = *all*
2618     FileSetACL = *all*
2619     WhereACL = *all*
2620 }
2621 \end{verbatim}
2622
2623 \medskip
2624 This project was funded by Bacula Systems and is available with Bacula
2625 the Enterprise Edition and the Community Edition.
2626
2627 \subsection{Purge Migration Job}
2628
2629 The new {\bf Purge Migration Job} directive may be added to the Migration
2630 Job definition in the Director's configuration file. When it is enabled 
2631 the Job that was migrated during a migration will be purged at
2632 the end of the migration job.
2633
2634 For example:
2635 \begin{verbatim}
2636 Job {
2637   Name = "migrate-job"
2638   Type = Migrate
2639   Level = Full
2640   Client = localhost-fd
2641   FileSet = "Full Set"
2642   Messages = Standard
2643   Storage = DiskChanger
2644   Pool = Default
2645   Selection Type = Job
2646   Selection Pattern = ".*Save"
2647 ...
2648   Purge Migration Job = yes
2649 }
2650 \end{verbatim}
2651
2652 \medskip
2653
2654 This project was submitted by Dunlap Blake; testing and documentation was funded
2655 by Bacula Systems.
2656
2657 \subsection{Changes in Bvfs (Bacula Virtual FileSystem)}
2658
2659 Bat has now a bRestore panel that uses Bvfs to display files and
2660 directories.
2661
2662 \begin{figure}[htbp]
2663   \centering
2664   \includegraphics[width=0.8\linewidth]{bat-brestore}
2665   \label{fig:batbrestore}
2666   \caption{Bat Brestore Panel}
2667 \end{figure}
2668
2669 the Bvfs module works correctly with BaseJobs, Copy and Migration jobs.
2670
2671 \medskip
2672 This project was funded by Bacula Systems.
2673
2674 \subsubsection*{General notes}
2675
2676 \begin{itemize}
2677 \item All fields are separated by a tab
2678 \item You can specify \texttt{limit=} and \texttt{offset=} to list smoothly
2679   records in very big directories
2680 \item All operations (except cache creation) are designed to run instantly
2681 \item At this time, Bvfs works faster on PostgreSQL than MySQL catalog. If you
2682   can contribute new faster SQL queries we will be happy, else don't complain
2683   about speed.
2684 \item The cache creation is dependent of the number of directories. As Bvfs
2685   shares information across jobs, the first creation can be slow
2686 \item All fields are separated by a tab
2687 \item Due to potential encoding problem, it's advised to always use pathid in
2688   queries.
2689 \end{itemize}
2690
2691 \subsubsection*{Get dependent jobs from a given JobId}
2692
2693 Bvfs allows you to query the catalog against any combination of jobs. You
2694 can combine all Jobs and all FileSet for a Client in a single session.
2695
2696 To get all JobId needed to restore a particular job, you can use the
2697 \texttt{.bvfs\_get\_jobids} command.
2698
2699 \begin{verbatim}
2700 .bvfs_get_jobids jobid=num [all]
2701 \end{verbatim}
2702
2703 \begin{verbatim}
2704 .bvfs_get_jobids jobid=10
2705 1,2,5,10
2706 .bvfs_get_jobids jobid=10 all
2707 1,2,3,5,10
2708 \end{verbatim}
2709
2710 In this example, a normal restore will need to use JobIds 1,2,5,10 to
2711 compute a complete restore of the system.
2712
2713 With the \texttt{all} option, the Director will use all defined FileSet for
2714 this client.
2715
2716 \subsubsection*{Generating Bvfs cache}
2717
2718 The \texttt{.bvfs\_update} command computes the directory cache for jobs
2719 specified in argument, or for all jobs if unspecified.
2720
2721 \begin{verbatim}
2722 .bvfs_update [jobid=numlist]
2723 \end{verbatim}
2724
2725 Example:
2726 \begin{verbatim}
2727 .bvfs_update jobid=1,2,3
2728 \end{verbatim}
2729
2730 You can run the cache update process in a RunScript after the catalog backup.
2731
2732 \subsubsection*{Get all versions of a specific file}
2733
2734 Bvfs allows you to find all versions of a specific file for a given Client with
2735 the \texttt{.bvfs\_version} command. To avoid problems with encoding, this
2736 function uses only PathId and FilenameId. The jobid argument is mandatory but
2737 unused.
2738
2739 \begin{verbatim}
2740 .bvfs_versions client=filedaemon pathid=num filenameid=num jobid=1
2741 PathId FilenameId FileId JobId LStat Md5 VolName Inchanger
2742 PathId FilenameId FileId JobId LStat Md5 VolName Inchanger
2743 ...
2744 \end{verbatim}
2745
2746 Example:
2747
2748 \begin{verbatim}
2749 .bvfs_versions client=localhost-fd pathid=1 fnid=47 jobid=1
2750 1  47  52  12  gD HRid IGk D Po Po A P BAA I A   /uPgWaxMgKZlnMti7LChyA  Vol1  1
2751 \end{verbatim}
2752
2753 \subsubsection*{List directories}
2754
2755 Bvfs allows you to list directories in a specific path.
2756 \begin{verbatim}
2757 .bvfs_lsdirs pathid=num path=/apath jobid=numlist limit=num offset=num
2758 PathId  FilenameId  FileId  JobId  LStat  Path
2759 PathId  FilenameId  FileId  JobId  LStat  Path
2760 PathId  FilenameId  FileId  JobId  LStat  Path
2761 ...
2762 \end{verbatim}
2763
2764 You need to \texttt{pathid} or \texttt{path}. Using \texttt{path=""} will list
2765 ``/'' on Unix and all drives on Windows.  If FilenameId is 0, the record
2766 listed is a directory.
2767
2768 \begin{verbatim}
2769 .bvfs_lsdirs pathid=4 jobid=1,11,12
2770 4       0       0       0       A A A A A A A A A A A A A A     .
2771 5       0       0       0       A A A A A A A A A A A A A A     ..
2772 3       0       0       0       A A A A A A A A A A A A A A     regress/
2773 \end{verbatim}
2774
2775 In this example, to list directories present in \texttt{regress/}, you can use
2776 \begin{verbatim}
2777 .bvfs_lsdirs pathid=3 jobid=1,11,12
2778 3       0       0       0       A A A A A A A A A A A A A A     .
2779 4       0       0       0       A A A A A A A A A A A A A A     ..
2780 2       0       0       0       A A A A A A A A A A A A A A     tmp/
2781 \end{verbatim}
2782
2783 \subsubsection*{List files}
2784
2785 Bvfs allows you to list files in a specific path.
2786 \begin{verbatim}
2787 .bvfs_lsfiles pathid=num path=/apath jobid=numlist limit=num offset=num
2788 PathId  FilenameId  FileId  JobId  LStat  Path
2789 PathId  FilenameId  FileId  JobId  LStat  Path
2790 PathId  FilenameId  FileId  JobId  LStat  Path
2791 ...
2792 \end{verbatim}
2793
2794 You need to \texttt{pathid} or \texttt{path}. Using \texttt{path=""} will list
2795 ``/'' on Unix and all drives on Windows. If FilenameId is 0, the record listed
2796 is a directory.
2797
2798 \begin{verbatim}
2799 .bvfs_lsfiles pathid=4 jobid=1,11,12
2800 4       0       0       0       A A A A A A A A A A A A A A     .
2801 5       0       0       0       A A A A A A A A A A A A A A     ..
2802 1       0       0       0       A A A A A A A A A A A A A A     regress/
2803 \end{verbatim}
2804
2805 In this example, to list files present in \texttt{regress/}, you can use
2806 \begin{verbatim}
2807 .bvfs_lsfiles pathid=1 jobid=1,11,12
2808 1   47   52   12    gD HRid IGk BAA I BMqcPH BMqcPE BMqe+t A     titi
2809 1   49   53   12    gD HRid IGk BAA I BMqe/K BMqcPE BMqe+t B     toto
2810 1   48   54   12    gD HRie IGk BAA I BMqcPH BMqcPE BMqe+3 A     tutu
2811 1   45   55   12    gD HRid IGk BAA I BMqe/K BMqcPE BMqe+t B     ficheriro1.txt
2812 1   46   56   12    gD HRie IGk BAA I BMqe/K BMqcPE BMqe+3 D     ficheriro2.txt
2813 \end{verbatim}
2814
2815 \subsubsection*{Restore set of files}
2816
2817 Bvfs allows you to create a SQL table that contains files that you want to
2818 restore. This table can be provided to a restore command with the file option.
2819
2820 \begin{verbatim}
2821 .bvfs_restore fileid=numlist dirid=numlist hardlink=numlist path=b2num
2822 OK
2823 restore file=?b2num ...
2824 \end{verbatim}
2825
2826 To include a directory (with \texttt{dirid}), Bvfs needs to run a query to
2827 select all files. This query could be time consuming.
2828
2829 \texttt{hardlink} list is always composed of a series of two numbers (jobid,
2830 fileindex). This information can be found in the LinkFI field of the LStat
2831 packet.
2832
2833 The \texttt{path} argument represents the name of the table that Bvfs will
2834 store results. The format of this table is \texttt{b2[0-9]+}. (Should start by
2835 b2 and followed by digits).
2836
2837 Example:
2838
2839 \begin{verbatim}
2840 .bvfs_restore fileid=1,2,3,4 hardlink=10,15,10,20 jobid=10 path=b20001
2841 OK
2842 \end{verbatim}
2843
2844 \subsubsection*{Cleanup after Restore}
2845
2846 To drop the table used by the restore command, you can use the
2847 \texttt{.bvfs\_cleanup} command.
2848
2849 \begin{verbatim}
2850 .bvfs_cleanup path=b20001
2851 \end{verbatim}
2852
2853 \subsubsection*{Clearing the BVFS Cache}
2854
2855 To clear the BVFS cache, you can use the \texttt{.bvfs\_clear\_cache} command.
2856
2857 \begin{verbatim}
2858 .bvfs_clear_cache yes
2859 OK
2860 \end{verbatim}
2861
2862 \subsection{Changes in the Pruning Algorithm}
2863
2864 We rewrote the job pruning algorithm in this version. Previously, in some users
2865 reported that the pruning process at the end of jobs was very long. It should
2866 not be longer the case. Now, Bacula won't prune automatically a Job if this
2867 particular Job is needed to restore data. Example:
2868
2869 \begin{verbatim}
2870 JobId: 1  Level: Full
2871 JobId: 2  Level: Incremental
2872 JobId: 3  Level: Incremental
2873 JobId: 4  Level: Differential
2874 .. Other incrementals up to now
2875 \end{verbatim}
2876
2877 In this example, if the Job Retention defined in the Pool or in the Client
2878 resource causes that Jobs with Jobid in 1,2,3,4 can be pruned, Bacula will
2879 detect that JobId 1 and 4 are essential to restore data at the current state
2880 and will prune only JobId 2 and 3.
2881
2882 \texttt{Important}, this change affect only the automatic pruning step after a
2883 Job and the \texttt{prune jobs} Bconsole command. If a volume expires after the
2884 \texttt{VolumeRetention} period, important jobs can be pruned.
2885
2886 \subsection{Ability to Verify any specified Job}
2887 You now have the ability to tell Bacula which Job should verify instead of
2888 automatically verify just the last one.
2889
2890 This feature can be used with VolumeToCatalog, DiskToCatalog and Catalog level.
2891
2892 To verify a given job, just specify the Job jobid in argument when starting the
2893 job.
2894 \begin{verbatim}
2895 *run job=VerifyVolume jobid=1 level=VolumeToCatalog
2896 Run Verify job
2897 JobName:     VerifyVolume
2898 Level:       VolumeToCatalog
2899 Client:      127.0.0.1-fd
2900 FileSet:     Full Set
2901 Pool:        Default (From Job resource)
2902 Storage:     File (From Job resource)
2903 Verify Job:  VerifyVol.2010-09-08_14.17.17_03
2904 Verify List: /tmp/regress/working/VerifyVol.bsr
2905 When:        2010-09-08 14:17:31
2906 Priority:    10
2907 OK to run? (yes/mod/no):
2908 \end{verbatim}
2909
2910 \medskip
2911 This project was funded by Bacula Systems and is available with Bacula
2912 Enterprise Edition and Community Edition.
2913
2914 \subsection{Additions to RunScript variables}
2915 You can have access to JobBytes and JobFiles using \%b and \%F in your runscript
2916 command. The Client address is now available through \%h.
2917
2918 \begin{verbatim}
2919 RunAfterJob = "/bin/echo Job=%j JobBytes=%b JobFiles=%F ClientAddress=%h"
2920 \end{verbatim}
2921
2922 %\subsection{Changes in drivetype.exe}
2923 %
2924 %Now the \texttt{drivetype.exe} program allows you to list all local hard
2925 %drives. It can help to build dynamic FileSet on Windows.
2926 %
2927 %\begin{verbatim}
2928 %File = "\\|\"c:/program files/bacula/bin32/drivetype\" -l -a"
2929 %\end{verbatim}
2930 %
2931
2932 \subsection{Additions to the Plugin API}
2933 The bfuncs structure has been extended to include a number of
2934 new entrypoints.
2935
2936 \subsubsection{bfuncs}
2937 The bFuncs structure defines the callback entry points within Bacula
2938 that the plugin can use register events, get Bacula values, set
2939 Bacula values, and send messages to the Job output or debug output.
2940
2941 The exact definition as of this writing is:
2942 \begin{verbatim}
2943 typedef struct s_baculaFuncs {
2944    uint32_t size;
2945    uint32_t version;
2946    bRC (*registerBaculaEvents)(bpContext *ctx, ...);
2947    bRC (*getBaculaValue)(bpContext *ctx, bVariable var, void *value);
2948    bRC (*setBaculaValue)(bpContext *ctx, bVariable var, void *value);
2949    bRC (*JobMessage)(bpContext *ctx, const char *file, int line,
2950        int type, utime_t mtime, const char *fmt, ...);
2951    bRC (*DebugMessage)(bpContext *ctx, const char *file, int line,
2952        int level, const char *fmt, ...);
2953    void *(*baculaMalloc)(bpContext *ctx, const char *file, int line,
2954        size_t size);
2955    void (*baculaFree)(bpContext *ctx, const char *file, int line, void *mem);
2956    
2957    /* New functions follow */
2958    bRC (*AddExclude)(bpContext *ctx, const char *file);
2959    bRC (*AddInclude)(bpContext *ctx, const char *file);
2960    bRC (*AddIncludeOptions)(bpContext *ctx, const char *opts);
2961    bRC (*AddRegex)(bpContext *ctx, const char *item, int type);
2962    bRC (*AddWild)(bpContext *ctx, const char *item, int type);
2963    bRC (*checkChanges)(bpContext *ctx, struct save_pkt *sp);
2964
2965 } bFuncs;
2966 \end{verbatim}
2967
2968 \begin{description}
2969 \item [AddExclude] can be called to exclude a file. The file
2970   string passed may include wildcards that will be interpreted by
2971   the {\bf fnmatch} subroutine. This function can be called 
2972   multiple times, and each time the file specified will be added
2973   to the list of files to be excluded. Note, this function only
2974   permits adding excludes of specific file or directory names,
2975   or files matched by the rather simple fnmatch mechanism.
2976   See below for information on doing wild-card and regex excludes.
2977
2978 \item [NewPreInclude] can be called to create a new Include block. This
2979   block will be added after the current defined Include block. This
2980   function can be called multiple times, but each time, it will create
2981   a new Include section (not normally needed). This function should
2982   be called only if you want to add an entirely new Include block.
2983
2984 \item [NewInclude] can be called to create a new Include block. This
2985   block will be added before any user defined Include blocks. This
2986   function can be called multiple times, but each time, it will create
2987   a new Include section (not normally needed). This function should
2988   be called only if you want to add an entirely new Include block.
2989
2990 \item [AddInclude] can be called to add new files/directories to
2991   be included.  They are added to the current Include block. If
2992   NewInclude has not been included, the current Include block is
2993   the last one that the user created. This function
2994   should be used only if you want to add totally new files/directories
2995   to be included in the backup. 
2996
2997 \item [NewOptions] adds a new Options block to the current Include
2998   in front of any other Options blocks. This permits the plugin to
2999   add exclude directives (wild-cards and regexes) in front of the
3000   user Options, and thus prevent certain files from being backed up.
3001   This can be useful if the plugin backs up files, and they should
3002   not be also backed up by the main Bacula code.  This function
3003   may be called multiple times, and each time, it creates a new
3004   prepended Options block. Note: normally you want to call this 
3005   entry point prior to calling AddOptions, AddRegex, or AddWild.
3006   
3007 \item [AddOptions] allows the plugin it set options in
3008   the current Options block, which is normally created with the
3009   NewOptions call just prior to adding Include Options.
3010   The permitted options are passed as a character string, where
3011   each character has a specific meaning as defined below:
3012
3013   \begin{description}
3014   \item [a] always replace files (default).
3015   \item [e] exclude rather than include.
3016   \item [h] no recursion into subdirectories.
3017   \item [H] do not handle hard links.
3018   \item [i] ignore case in wildcard and regex matches.
3019   \item [M] compute an MD5 sum.
3020   \item [p] use a portable data format on Windows (not recommended).
3021   \item [R] backup resource forks and Findr Info.
3022   \item [r] read from a fifo
3023   \item [S1] compute an SHA1 sum.
3024   \item [S2] compute an SHA256 sum.
3025   \item [S3] comput an SHA512 sum.
3026   \item [s] handle sparse files.
3027   \item [m] use st\_mtime only for file differences.
3028   \item [k] restore the st\_atime after accessing a file.
3029   \item [A] enable ACL backup.
3030   \item [Vxxx:] specify verify options. Must terminate with :
3031   \item [Cxxx:] specify accurate options. Must terminate with :
3032   \item [Jxxx:] specify base job Options. Must terminate with :
3033   \item [Pnnn:] specify integer nnn paths to strip. Must terminate with :
3034   \item [w] if newer
3035   \item [Zn] specify gzip compression level n.
3036   \item [K] do not use st\_atime in backup decision.
3037   \item [c] check if file changed during backup.
3038   \item [N] honor no dump flag.
3039   \item [X] enable backup of extended attributes.
3040   \end{description}
3041
3042 \item [AddRegex] adds a regex expression to the current Options block.
3043   The following options are permitted:
3044   \begin{description}
3045   \item [ ] (a blank) regex applies to whole path and filename.
3046   \item [F] regex applies only to the filename (directory or path stripped).
3047   \item [D] regex applies only to the directory (path) part of the name.
3048   \end{description}
3049
3050 \item [AddWild] adds a wildcard expression to the current Options block.
3051   The following options are permitted:
3052   \begin{description}
3053   \item [ ] (a blank) regex applies to whole path and filename.
3054   \item [F] regex applies only to the filename (directory or path stripped).
3055   \item [D] regex applies only to the directory (path) part of the name.
3056   \end{description}
3057
3058 \item [checkChanges] call the \texttt{check\_changes()} function in Bacula code
3059   that can use Accurate code to compare the file information in argument with
3060   the previous file information. The \texttt{delta\_seq} attribute of the
3061   \texttt{save\_pkt} will be updated, and the call will return
3062   \texttt{bRC\_Seen} if the core code wouldn't decide to backup it.
3063   
3064 \end{description}
3065   
3066
3067 \subsubsection{Bacula events}
3068 The list of events has been extended to include:
3069
3070 \begin{verbatim}
3071 typedef enum {
3072   bEventJobStart        = 1,
3073   bEventJobEnd          = 2,
3074   bEventStartBackupJob  = 3,
3075   bEventEndBackupJob    = 4,
3076   bEventStartRestoreJob = 5,
3077   bEventEndRestoreJob   = 6,
3078   bEventStartVerifyJob  = 7,
3079   bEventEndVerifyJob    = 8,
3080   bEventBackupCommand   = 9,
3081   bEventRestoreCommand  = 10,
3082   bEventLevel           = 11,
3083   bEventSince           = 12,
3084    
3085   /* New events */
3086   bEventCancelCommand                   = 13,
3087   bEventVssBackupAddComponents          = 14,
3088   bEventVssRestoreLoadComponentMetadata = 15,
3089   bEventVssRestoreSetComponentsSelected = 16,
3090   bEventRestoreObject                   = 17,
3091   bEventEndFileSet                      = 18,
3092   bEventPluginCommand                   = 19,
3093   bEventVssBeforeCloseRestore           = 20,
3094   bEventVssPrepareSnapshot              = 21
3095
3096 } bEventType;
3097 \end{verbatim}
3098
3099 \begin{description}
3100 \item [bEventCancelCommand] is called whenever the currently
3101   running Job is canceled */
3102
3103 \item [bEventVssBackupAddComponents] 
3104
3105 \item [bEventVssPrepareSnapshot] is called before creating VSS snapshots, it
3106   provides a char[27] table where the plugin can add Windows drives that will
3107   be used during the Job. You need to add them without duplicates, and you can
3108   use in \texttt{fd\_common.h} \texttt{add\_drive()} and \texttt{copy\_drives()}
3109   for this purpose.
3110 \end{description}
3111
3112 \subsection{ACL enhancements}
3113
3114 The following enhancements are made to the Bacula Filed with regards to
3115 Access Control Lists (ACLs)
3116
3117 \begin{itemize}
3118 \item Added support for AIX 5.3 and later new aclx\_get interface which supports
3119   POSIX and NFSv4 ACLs.
3120 \item Added support for new acl types on FreeBSD 8.1 and later which supports
3121   POSIX and NFSv4 ACLs.
3122 \item Some generic cleanups for internal ACL handling.
3123 \item Fix for acl storage on OSX
3124 \item Cleanup of configure checks for ACL detection, now configure only
3125   tests for a certain interface type based on the operating system
3126   this should give less false positives on detection. Also when ACLs
3127   are detected no other acl checks are performed anymore.
3128 \end{itemize}
3129
3130 \medskip
3131 This project was funded by Planets Communications B.V. and ELM Consultancy B.V.
3132 and is available with Bacula Enterprise Edition and Community Edition.
3133
3134 \subsection{XATTR enhancements}
3135
3136 The following enhancements are made to the Bacula Filed with regards to
3137 Extended Attributes (XATTRs)
3138
3139 \begin{itemize}
3140 \item Added support for IRIX extended attributes using the attr\_get interface.
3141 \item Added support for Tru64 (OSF1) extended attributes using the
3142   getproplist interface.
3143 \item Added support for AIX extended attributes available in AIX 6.x
3144   and higher using the listea/getea/setea interface.
3145 \item Added some debugging to generic xattr code so it easier to
3146   debug.
3147 \item Cleanup of configure checks for XATTR detection, now configure only
3148   tests for a certain interface type based on the operating system
3149   this should give less false positives on detection. Also when xattrs
3150   are detected no other xattr checks are performed anymore.
3151 \end{itemize}
3152
3153 \medskip
3154 This project was funded by Planets Communications B.V. and ELM Consultancy B.V.
3155 and is available with Bacula Enterprise Edition and Community Edition.
3156
3157 \subsection{Class Based Database Backend Drivers}
3158
3159 The main Bacula Director code is independent of the SQL backend
3160 in version 5.2.0 and greater.  This means that the Bacula Director can be
3161 packaged by itself, then each of the different SQL backends supported can
3162 be packaged separately.  It is possible to build all the DB backends at the
3163 same time by including multiple database options at the same time.
3164
3165 ./configure can be run with multiple database configure options.
3166 \begin{verbatim}
3167    --with-sqlite3
3168    --with-mysql
3169    --with-postgresql
3170 \end{verbatim}
3171
3172 Order of testing for databases is:
3173 \begin{itemize}
3174 \item postgresql
3175 \item mysql
3176 \item sqlite3
3177 \end{itemize}
3178
3179 Each configured backend generates a file named:
3180 \verb+libbaccats-<sql_backend_name>-<version>.so+
3181 A dummy catalog library is created named libbaccats-version.so
3182
3183 At configure time the first detected backend is used as the so called
3184 default backend and at install time the dummy
3185 \verb+libbaccats-<version>.so+ is replaced with the default backend type.
3186
3187 If you configure all three backends you get three backend libraries and the
3188 postgresql gets installed as the default.
3189
3190 When you want to switch to another database, first save any old catalog you
3191 may have then you can copy one of the three backend libraries over the
3192 \verb+libbaccats-<version>.so+ e.g.
3193
3194 An actual command, depending on your Bacula version might be:
3195 \begin{verbatim}
3196    cp libbaccats-postgresql-5.2.2.so libbaccats-5.2.2.so
3197 \end{verbatim}
3198
3199 where the \verb+5.2.2+ must be replaced by the Bacula release
3200 version number.
3201
3202 Then you must update the default backend in the following files:
3203
3204 \begin{verbatim}
3205   create_bacula_database
3206   drop_bacula_database
3207   drop_bacula_tables
3208   grant_bacula_privileges
3209   make_bacula_tables
3210   make_catalog_backup
3211   update_bacula_tables
3212 \end{verbatim}
3213
3214 And re-run all the above scripts.  Please note, this means
3215 you will have a new empty database and if you had a previous
3216 one it will be lost.
3217
3218 All current database backend drivers for catalog information are rewritten
3219 to use a set of multi inherited C++ classes which abstract the specific
3220 database specific internals and make sure we have a more stable generic
3221 interface with the rest of SQL code.  From now on there is a strict
3222 boundary between the SQL code and the low-level database functions.  This
3223 new interface should also make it easier to add a new backend for a
3224 currently unsupported database.  As part of the rewrite the SQLite 2 code
3225 was removed (e.g.  only SQLite 3 is now supported).  An extra bonus of the
3226 new code is that you can configure multiple backends in the configure and
3227 build all backends in one compile session and select the correct database
3228 backend at install time.  This should make it a lot easier for packages
3229 maintainers.
3230
3231
3232
3233 \medskip
3234 We also added cursor support for PostgreSQL backend, this improves memory
3235 usage for large installation.
3236
3237 \medskip
3238 This project was implemented by Planets Communications B.V. and ELM
3239 Consultancy B.V. and Bacula Systems and is available with both the Bacula
3240 Enterprise Edition and the Community Edition.
3241
3242 \subsection{Hash List Enhancements}
3243
3244 The htable hash table class has been extended with extra hash functions for
3245 handling next to char pointer hashes also 32 bits and 64 bits hash keys.
3246 Also the hash table initialization routines have been enhanced with
3247 support for passing a hint as to the number of initial pages to use
3248 for the size of the hash table. Until now the hash table always used
3249 a fixed value of 10 Mb. The private hash functions of the mountpoint entry
3250 cache have been rewritten to use the new htable class with a small memory
3251 footprint.
3252
3253 \medskip
3254 This project was funded by Planets Communications B.V. and ELM Consultancy B.V.
3255 and Bacula Systems and is available with Bacula Enterprise Edition and
3256 Community Edition.
3257
3258 %%
3259 %%
3260 %%% =====================================================================
3261 %%
3262 %%
3263
3264
3265 \section{Release Version 5.0.3}
3266
3267 There are no new features in version 5.0.2.  This version simply fixes a
3268 number of bugs found in version 5.0.1 during the ongoing development
3269 process.
3270
3271 \section{Release Version 5.0.2}
3272
3273 There are no new features in version 5.0.2.  This version simply fixes a
3274 number of bugs found in version 5.0.1 during the ongoing development
3275 process.
3276
3277 %%
3278 %%
3279
3280 \section{New Features in 5.0.1}
3281
3282 This chapter presents the new features that are in the released Bacula version
3283 5.0.1. This version mainly fixes a number of bugs found in version 5.0.0 during
3284 the ongoing development process.
3285
3286 \subsection{Truncate Volume after Purge}
3287 \label{sec:actiononpurge}
3288
3289 The Pool directive \textbf{ActionOnPurge=Truncate} instructs Bacula to truncate
3290 the volume when it is purged with the new command \texttt{purge volume
3291   action}. It is useful to prevent disk based volumes from consuming too much
3292 space.
3293
3294 \begin{verbatim}
3295 Pool {
3296   Name = Default
3297   Action On Purge = Truncate
3298   ...
3299 }
3300 \end{verbatim}
3301
3302 As usual you can also set this property with the \texttt{update volume} command
3303 \begin{verbatim}
3304 *update volume=xxx ActionOnPurge=Truncate
3305 *update volume=xxx actiononpurge=None
3306 \end{verbatim}
3307
3308 To ask Bacula to truncate your \texttt{Purged} volumes, you need to use the
3309 following command in interactive mode or in a RunScript as shown after:
3310 \begin{verbatim}
3311 *purge volume action=truncate storage=File allpools
3312 # or by default, action=all
3313 *purge volume action storage=File pool=Default
3314 \end{verbatim}
3315
3316 This is possible to specify the volume name, the media type, the pool, the
3317 storage, etc\dots (see \texttt{help purge}) Be sure that your storage device is
3318 idle when you decide to run this command.
3319
3320 \begin{verbatim}
3321 Job {
3322  Name = CatalogBackup
3323  ...
3324  RunScript {
3325    RunsWhen=After
3326    RunsOnClient=No
3327    Console = "purge volume action=all allpools storage=File"
3328  }
3329 }
3330 \end{verbatim}
3331
3332 \textbf{Important note}: This feature doesn't work as
3333 expected in version 5.0.0. Please do not use it before version 5.0.1.
3334
3335 \subsection{Allow Higher Duplicates}
3336 This directive did not work correctly and has been depreciated
3337 (disabled) in version 5.0.1. Please remove it from your bacula-dir.conf
3338 file as it will be removed in a future release.
3339
3340 \subsection{Cancel Lower Level Duplicates}
3341 This directive was added in Bacula version 5.0.1.  It compares the
3342 level of a new backup job to old jobs of the same name, if any,
3343 and will kill the job which has a lower level than the other one.
3344 If the levels are the same (i.e. both are Full backups), then 
3345 nothing is done and the other Cancel XXX Duplicate directives
3346 will be examined.
3347
3348 \section{New Features in 5.0.0}
3349
3350 \subsection{Maximum Concurrent Jobs for Devices}
3351 \label{sec:maximumconcurrentjobdevice}
3352
3353 {\bf Maximum Concurrent Jobs} is a new Device directive in the Storage
3354 Daemon configuration permits setting the maximum number of Jobs that can
3355 run concurrently on a specified Device.  Using this directive, it is
3356 possible to have different Jobs using multiple drives, because when the
3357 Maximum Concurrent Jobs limit is reached, the Storage Daemon will start new
3358 Jobs on any other available compatible drive.  This facilitates writing to
3359 multiple drives with multiple Jobs that all use the same Pool.
3360
3361 This project was funded by Bacula Systems.
3362
3363 \subsection{Restore from Multiple Storage Daemons}
3364 \index[general]{Restore}
3365
3366 Previously, you were able to restore from multiple devices in a single Storage
3367 Daemon. Now, Bacula is able to restore from multiple Storage Daemons. For
3368 example, if your full backup runs on a Storage Daemon with an autochanger, and
3369 your incremental jobs use another Storage Daemon with lots of disks, Bacula
3370 will switch automatically from one Storage Daemon to an other within the same
3371 Restore job.
3372
3373 You must upgrade your File Daemon to version 3.1.3 or greater to use this
3374 feature.
3375
3376 This project was funded by Bacula Systems with the help of Equiinet.
3377
3378 \subsection{File Deduplication using Base Jobs}
3379 A base job is sort of like a Full save except that you will want the FileSet to
3380 contain only files that are unlikely to change in the future (i.e.  a snapshot
3381 of most of your system after installing it).  After the base job has been run,
3382 when you are doing a Full save, you specify one or more Base jobs to be used.
3383 All files that have been backed up in the Base job/jobs but not modified will
3384 then be excluded from the backup.  During a restore, the Base jobs will be
3385 automatically pulled in where necessary.
3386
3387 This is something none of the competition does, as far as we know (except
3388 perhaps BackupPC, which is a Perl program that saves to disk only).  It is big
3389 win for the user, it makes Bacula stand out as offering a unique optimization
3390 that immediately saves time and money.  Basically, imagine that you have 100
3391 nearly identical Windows or Linux machine containing the OS and user files.
3392 Now for the OS part, a Base job will be backed up once, and rather than making
3393 100 copies of the OS, there will be only one.  If one or more of the systems
3394 have some files updated, no problem, they will be automatically restored.
3395
3396 See the \ilink{Base Job Chapter}{basejobs} for more information.
3397
3398 This project was funded by Bacula Systems.
3399
3400 \subsection{AllowCompression = \lt{}yes\vb{}no\gt{}}
3401 \index[dir]{AllowCompression}
3402
3403 This new directive may be added to Storage resource within the Director's
3404 configuration to allow users to selectively disable the client compression for
3405 any job which writes to this storage resource.
3406
3407 For example:
3408 \begin{verbatim}
3409 Storage {
3410   Name = UltriumTape
3411   Address = ultrium-tape
3412   Password = storage_password # Password for Storage Daemon
3413   Device = Ultrium
3414   Media Type = LTO 3
3415   AllowCompression = No # Tape drive has hardware compression
3416 }
3417 \end{verbatim}
3418 The above example would cause any jobs running with the UltriumTape storage
3419 resource to run without compression from the client file daemons.  This
3420 effectively overrides any compression settings defined at the FileSet level.
3421
3422 This feature is probably most useful if you have a tape drive which supports
3423 hardware compression.  By setting the \texttt{AllowCompression = No} directive
3424 for your tape drive storage resource, you can avoid additional load on the file
3425 daemon and possibly speed up tape backups.
3426
3427 This project was funded by Collaborative Fusion, Inc.
3428
3429 \subsection{Accurate Fileset Options}
3430 \label{sec:accuratefileset}
3431
3432 In previous versions, the accurate code used the file creation and modification
3433 times to determine if a file was modified or not. Now you can specify which
3434 attributes to use (time, size, checksum, permission, owner, group, \dots),
3435 similar to the Verify options.
3436
3437 \begin{verbatim}
3438 FileSet {
3439   Name = Full
3440   Include = {
3441     Options {
3442        Accurate = mcs
3443        Verify   = pin5
3444     }
3445     File = /
3446   }
3447 }
3448 \end{verbatim}
3449
3450 \begin{description}  
3451 \item {\bf i}  compare the inodes  
3452 \item {\bf p}  compare the permission bits  
3453 \item {\bf n}  compare the number of links  
3454 \item {\bf u}  compare the user id  
3455 \item {\bf g}  compare the group id  
3456 \item {\bf s}  compare the size  
3457 \item {\bf a}  compare the access time  
3458 \item {\bf m}  compare the modification time (st\_mtime)  
3459 \item {\bf c}  compare the change time (st\_ctime)  
3460 \item {\bf d}  report file size decreases  
3461 \item {\bf 5}  compare the MD5 signature  
3462 \item {\bf 1}  compare the SHA1 signature  
3463 \end{description}
3464
3465 \textbf{Important note:} If you decide to use checksum in Accurate jobs,
3466 the File Daemon will have to read all files even if they normally would not
3467 be saved.  This increases the I/O load, but also the accuracy of the
3468 deduplication.  By default, Bacula will check modification/creation time
3469 and size.
3470
3471 This project was funded by Bacula Systems.
3472
3473 \subsection{Tab-completion for Bconsole}
3474 \label{sec:tabcompletion}
3475
3476 If you build \texttt{bconsole} with readline support, you will be able to use
3477 the new auto-completion mode. This mode supports all commands, gives help
3478 inside command, and lists resources when required. It works also in the restore
3479 mode.
3480
3481 To use this feature, you should have readline development package loaded on
3482 your system, and use the following option in configure.
3483 \begin{verbatim}
3484 ./configure --with-readline=/usr/include/readline --disable-conio ...
3485 \end{verbatim}
3486
3487 The new bconsole won't be able to tab-complete with older directors.
3488
3489 This project was funded by Bacula Systems.
3490
3491 \subsection{Pool File and Job Retention}
3492 \label{sec:poolfilejobretention}
3493
3494 We added two new Pool directives, \texttt{FileRetention} and
3495 \texttt{JobRetention}, that take precedence over Client directives of the same
3496 name. It allows you to control the Catalog pruning algorithm Pool by Pool. For
3497 example, you can decide to increase Retention times for Archive or OffSite Pool.
3498
3499 It seems obvious to us, but apparently not to some users, that given the
3500 definition above that the Pool File and Job Retention periods is a global
3501 override for the normal Client based pruning, which means that when the
3502 Job is pruned, the pruning will apply globally to that particular Job.
3503
3504 Currently, there is a bug in the implementation that causes any Pool 
3505 retention periods specified to apply to {\bf all} Pools for that
3506 particular Client.  Thus we suggest that you avoid using these two
3507 directives until this implementation problem is corrected.
3508
3509 \subsection{Read-only File Daemon using capabilities}
3510 \label{sec:fdreadonly}
3511 This feature implements support of keeping \textbf{ReadAll} capabilities after
3512 UID/GID switch, this allows FD to keep root read but drop write permission.
3513
3514 It introduces new \texttt{bacula-fd} option (\texttt{-k}) specifying that
3515 \textbf{ReadAll} capabilities should be kept after UID/GID switch.
3516
3517 \begin{verbatim}
3518 root@localhost:~# bacula-fd -k -u nobody -g nobody
3519 \end{verbatim}
3520
3521 The code for this feature was contributed by our friends at AltLinux.
3522
3523 \subsection{Bvfs API}
3524 \label{sec:bvfs}
3525
3526 To help developers of restore GUI interfaces, we have added new \textsl{dot
3527   commands} that permit browsing the catalog in a very simple way.
3528
3529 \begin{itemize}
3530 \item \texttt{.bvfs\_update [jobid=x,y,z]} This command is required to update
3531   the Bvfs cache in the catalog. You need to run it before any access to the
3532   Bvfs layer.
3533
3534 \item \texttt{.bvfs\_lsdirs jobid=x,y,z path=/path | pathid=101} This command
3535   will list all directories in the specified \texttt{path} or
3536   \texttt{pathid}. Using \texttt{pathid} avoids problems with character
3537   encoding of path/filenames.
3538
3539 \item \texttt{.bvfs\_lsfiles jobid=x,y,z path=/path | pathid=101} This command
3540   will list all files in the specified \texttt{path} or \texttt{pathid}. Using
3541   \texttt{pathid} avoids problems with character encoding.
3542 \end{itemize}
3543
3544 You can use \texttt{limit=xxx} and \texttt{offset=yyy} to limit the amount of
3545 data that will be displayed.
3546
3547 \begin{verbatim}
3548 * .bvfs_update jobid=1,2
3549 * .bvfs_update
3550 * .bvfs_lsdir path=/ jobid=1,2
3551 \end{verbatim}
3552
3553 This project was funded by Bacula Systems.
3554
3555 \subsection{Testing your Tape Drive}
3556 \label{sec:btapespeed}
3557
3558 To determine the best configuration of your tape drive, you can run the new
3559 \texttt{speed} command available in the \texttt{btape} program.
3560
3561 This command can have the following arguments:
3562 \begin{itemize}
3563 \item[\texttt{file\_size=n}] Specify the Maximum File Size for this test
3564   (between 1 and 5GB). This counter is in GB.
3565 \item[\texttt{nb\_file=n}] Specify the number of file to be written. The amount
3566   of data should be greater than your memory ($file\_size*nb\_file$).
3567 \item[\texttt{skip\_zero}] This flag permits to skip tests with constant
3568   data.
3569 \item[\texttt{skip\_random}] This flag permits to skip tests with random
3570   data.
3571 \item[\texttt{skip\_raw}] This flag permits to skip tests with raw access.
3572 \item[\texttt{skip\_block}] This flag permits to skip tests with Bacula block
3573   access.
3574 \end{itemize}
3575
3576 \begin{verbatim}
3577 *speed file_size=3 skip_raw
3578 btape.c:1078 Test with zero data and bacula block structure.
3579 btape.c:956 Begin writing 3 files of 3.221 GB with blocks of 129024 bytes.
3580 ++++++++++++++++++++++++++++++++++++++++++
3581 btape.c:604 Wrote 1 EOF to "Drive-0" (/dev/nst0)
3582 btape.c:406 Volume bytes=3.221 GB. Write rate = 44.128 MB/s
3583 ...
3584 btape.c:383 Total Volume bytes=9.664 GB. Total Write rate = 43.531 MB/s
3585
3586 btape.c:1090 Test with random data, should give the minimum throughput.
3587 btape.c:956 Begin writing 3 files of 3.221 GB with blocks of 129024 bytes.
3588 +++++++++++++++++++++++++++++++++++++++++++
3589 btape.c:604 Wrote 1 EOF to "Drive-0" (/dev/nst0)
3590 btape.c:406 Volume bytes=3.221 GB. Write rate = 7.271 MB/s
3591 +++++++++++++++++++++++++++++++++++++++++++
3592 ...
3593 btape.c:383 Total Volume bytes=9.664 GB. Total Write rate = 7.365 MB/s
3594
3595 \end{verbatim}
3596
3597 When using compression, the random test will give your the minimum throughput
3598 of your drive . The test using constant string will give you the maximum speed
3599 of your hardware chain. (CPU, memory, SCSI card, cable, drive, tape).
3600
3601 You can change the block size in the Storage Daemon configuration file.
3602
3603 \subsection{New {\bf Block Checksum} Device Directive}
3604 You may now turn off the Block Checksum (CRC32) code
3605 that Bacula uses when writing blocks to a Volume.  This is
3606 done by adding:
3607
3608 \begin{verbatim}
3609 Block Checksum = no
3610 \end{verbatim}
3611
3612 doing so can reduce the Storage daemon CPU usage slightly.  It
3613 will also permit Bacula to read a Volume that has corrupted data.
3614
3615 The default is {\bf yes} -- i.e. the checksum is computed on write
3616 and checked on read. 
3617
3618 We do not recommend to turn this off particularly on older tape
3619 drives or for disk Volumes where doing so may allow corrupted data
3620 to go undetected.
3621
3622 \subsection{New Bat Features}
3623
3624 Those new features were funded by Bacula Systems.
3625
3626 \subsubsection{Media List View}
3627
3628 By clicking on ``Media'', you can see the list of all your volumes. You will be
3629 able to filter by Pool, Media Type, Location,\dots And sort the result directly
3630 in the table. The old ``Media'' view is now known as ``Pool''.
3631 \begin{figure}[htbp]
3632   \centering
3633   \includegraphics[width=0.8\linewidth]{bat-mediaview}
3634   \label{fig:mediaview}
3635 \end{figure}
3636
3637
3638 \subsubsection{Media Information View}
3639
3640 By double-clicking on a volume (on the Media list, in the Autochanger content
3641 or in the Job information panel), you can access a detailed overview of your
3642 Volume. (cf figure \vref{fig:mediainfo}.)
3643 \begin{figure}[htbp]
3644   \centering
3645   \includegraphics[width=0.8\linewidth]{bat11}  
3646   \caption{Media information}
3647   \label{fig:mediainfo}
3648 \end{figure}
3649
3650 \subsubsection{Job Information View}
3651
3652 By double-clicking on a Job record (on the Job run list or in the Media
3653 information panel), you can access a detailed overview of your Job. (cf
3654 figure \vref{fig:jobinfo}.)
3655 \begin{figure}[htbp]
3656   \centering
3657   \includegraphics[width=0.8\linewidth]{bat12}  
3658   \caption{Job information}
3659   \label{fig:jobinfo}
3660 \end{figure}
3661
3662 \subsubsection{Autochanger Content View}
3663
3664 By double-clicking on a Storage record (on the Storage list panel), you can
3665 access a detailed overview of your Autochanger. (cf figure \vref{fig:jobinfo}.)
3666 \begin{figure}[htbp]
3667   \centering
3668   \includegraphics[width=0.8\linewidth]{bat13}  
3669   \caption{Autochanger content}
3670   \label{fig:achcontent}
3671 \end{figure}
3672
3673 To use this feature, you need to use the latest mtx-changer script
3674 version. (With new \texttt{listall} and \texttt{transfer} commands)
3675
3676 \subsection{Bat on Windows}
3677 We have ported {\bf bat} to Windows and it is now installed 
3678 by default when the installer is run.  It works quite well 
3679 on Win32, but has not had a lot of testing there, so your
3680 feedback would be welcome.  Unfortunately, even though it is
3681 installed by default, it does not yet work on 64 bit Windows
3682 operating systems.
3683
3684 \subsection{New Win32 Installer}
3685 The Win32 installer has been modified in several very important
3686 ways.  
3687 \begin{itemize}
3688 \item You must deinstall any current version of the
3689 Win32 File daemon before upgrading to the new one. 
3690 If you forget to do so, the new installation will fail.
3691 To correct this failure, you must manually shutdown 
3692 and deinstall the old File daemon. 
3693 \item All files (other than menu links) are installed
3694 in {\bf c:/Program Files/Bacula}.  
3695 \item The installer no longer sets this
3696 file to require administrator privileges by default. If you want
3697 to do so, please do it manually using the {\bf cacls} program.
3698 For example:
3699 \begin{verbatim}
3700 cacls "C:\Program Files\Bacula" /T /G SYSTEM:F Administrators:F
3701 \end{verbatim}
3702 \item The server daemons (Director and Storage daemon) are
3703 no longer included in the Windows installer.  If you want the
3704 Windows servers, you will either need to build them yourself (note
3705 they have not been ported to 64 bits), or you can contact 
3706 Bacula Systems about this.
3707 \end{itemize}
3708
3709 \subsection{Win64 Installer}
3710 We have corrected a number of problems that required manual
3711 editing of the conf files.  In most cases, it should now
3712 install and work.  {\bf bat} is by default installed in
3713 {\bf c:/Program Files/Bacula/bin32} rather than
3714 {\bf c:/Program Files/Bacula} as is the case with the 32
3715 bit Windows installer.
3716
3717 \subsection{Linux Bare Metal Recovery USB Key}
3718 We have made a number of significant improvements in the
3719 Bare Metal Recovery USB key.  Please see the README files
3720 it the {\bf rescue} release for more details.  
3721
3722 We are working on an equivalent USB key for Windows bare
3723 metal recovery, but it will take some time to develop it (best
3724 estimate 3Q2010 or 4Q2010)
3725
3726
3727 \subsection{bconsole Timeout Option}
3728 You can now use the -u option of {\bf bconsole} to set a timeout in seconds
3729 for commands. This is useful with GUI programs that use {\bf bconsole}
3730 to interface to the Director.
3731
3732 \subsection{Important Changes}
3733 \label{sec:importantchanges}
3734
3735 \begin{itemize}
3736 \item You are now allowed to Migrate, Copy, and Virtual Full to read and write
3737   to the same Pool. The Storage daemon ensures that you do not read and
3738   write to the same Volume.
3739 \item The \texttt{Device Poll Interval} is now 5 minutes. (previously did not
3740   poll by default).
3741 \item Virtually all the features of {\bf mtx-changer} have
3742   now been parametrized, which allows you to configure
3743   mtx-changer without changing it. There is a new configuration file {\bf mtx-changer.conf} 
3744   that contains variables that you can set to configure mtx-changer.
3745   This configuration file will not be overwritten during upgrades.
3746   We encourage you to submit any changes
3747   that are made to mtx-changer and to parametrize it all in
3748   mtx-changer.conf so that all configuration will be done by
3749   changing only mtx-changer.conf.
3750 \item The new \texttt{mtx-changer} script has two new options, \texttt{listall}
3751   and \texttt{transfer}. Please configure them as appropriate
3752   in mtx-changer.conf.
3753 \item To enhance security of the \texttt{BackupCatalog} job, we provide a new
3754   script (\texttt{make\_catalog\_backup.pl}) that does not expose your catalog
3755   password. If you want to use the new script, you will need to 
3756   manually change the \texttt{BackupCatalog} Job definition.
3757 \item The \texttt{bconsole} \texttt{help} command now accepts
3758   an argument, which if provided produces information on that
3759   command (ex: \texttt{help run}).
3760 \end{itemize}
3761
3762
3763 \subsubsection*{Truncate volume after purge}
3764
3765 Note that the Truncate Volume after purge feature doesn't work as expected
3766 in 5.0.0 version. Please, don't use it before version 5.0.1.
3767
3768 \subsubsection{Custom Catalog queries}
3769
3770 If you wish to add specialized commands that list the contents of the catalog,
3771 you can do so by adding them to the \texttt{query.sql} file. This
3772 \texttt{query.sql} file is now empty by default.  The file
3773 \texttt{examples/sample-query.sql} has an a number of sample commands
3774 you might find useful.
3775
3776 \subsubsection{Deprecated parts}
3777
3778 The following items have been \textbf{deprecated} for a long time, and are now
3779 removed from the code.
3780 \begin{itemize}
3781 \item Gnome console
3782 \item Support for SQLite 2
3783 \end{itemize}
3784
3785 \subsection{Misc Changes}
3786 \label{sec:miscchanges}
3787
3788 \begin{itemize}
3789 \item Updated Nagios check\_bacula
3790 \item Updated man files
3791 \item Added OSX package generation script in platforms/darwin
3792 \item Added Spanish and Ukrainian Bacula translations
3793 \item Enable/disable command shows only Jobs that can change
3794 \item Added \texttt{show disabled} command to show disabled Jobs
3795 \item Many ACL improvements
3796 \item Added Level to FD status Job output
3797 \item Begin Ingres DB driver (not yet working)
3798 \item Split RedHat spec files into bacula, bat, mtx, and docs
3799 \item Reorganized the manuals (fewer separate manuals)
3800 \item Added lock/unlock order protection in lock manager
3801 \item Allow 64 bit sizes for a number of variables
3802 \item Fixed several deadlocks or potential race conditions in the SD
3803 \end{itemize}
3804
3805 \chapter{Released Version 3.0.3 and 3.0.3a}
3806
3807 There are no new features in version 3.0.3.  This version simply fixes a
3808 number of bugs found in version 3.0.2 during the ongoing development
3809 process.
3810
3811 \section{New Features in Released Version 3.0.2}
3812
3813 This chapter presents the new features added to the
3814 Released Bacula Version 3.0.2.
3815
3816 \subsection{Full Restore from a Given JobId}
3817 \index[general]{Restore menu}
3818
3819 This feature allows selecting a single JobId and having Bacula
3820 automatically select all the other jobs that comprise a full backup up to
3821 and including the selected date (through JobId).
3822
3823 Assume we start with the following jobs:
3824 \begin{verbatim}
3825 +-------+--------------+---------------------+-------+----------+------------+
3826 | jobid | client       | starttime           | level | jobfiles | jobbytes   |
3827 +-------+--------------+---------------------+-------+----------+------------
3828 | 6     | localhost-fd | 2009-07-15 11:45:49 | I     | 2        | 0          |
3829 | 5     | localhost-fd | 2009-07-15 11:45:45 | I     | 15       | 44143      |
3830 | 3     | localhost-fd | 2009-07-15 11:45:38 | I     | 1        | 10         |
3831 | 1     | localhost-fd | 2009-07-15 11:45:30 | F     | 1527     | 44143073   |
3832 +-------+--------------+---------------------+-------+----------+------------+
3833 \end{verbatim}
3834
3835 Below is an example of this new feature (which is number 12 in the
3836 menu).
3837
3838 \begin{verbatim}
3839 * restore
3840 To select the JobIds, you have the following choices:
3841      1: List last 20 Jobs run
3842      2: List Jobs where a given File is saved
3843 ...
3844     12: Select full restore to a specified Job date
3845     13: Cancel
3846
3847 Select item:  (1-13): 12
3848 Enter JobId to get the state to restore: 5
3849 Selecting jobs to build the Full state at 2009-07-15 11:45:45
3850 You have selected the following JobIds: 1,3,5
3851
3852 Building directory tree for JobId(s) 1,3,5 ...  +++++++++++++++++++
3853 1,444 files inserted into the tree.
3854 \end{verbatim}
3855
3856 This project was funded by Bacula Systems.
3857
3858 \subsection{Source Address}
3859 \index[general]{Source Address}
3860
3861 A feature has been added which allows the administrator to specify the address
3862 from which the Director and File daemons will establish connections.  This
3863 may be used to simplify system configuration overhead when working in complex
3864 networks utilizing multi-homing and policy-routing.
3865
3866 To accomplish this, two new configuration directives have been implemented:
3867 \begin{verbatim}
3868 FileDaemon {
3869   FDSourceAddress=10.0.1.20    # Always initiate connections from this address
3870 }
3871
3872 Director {
3873   DirSourceAddress=10.0.1.10   # Always initiate connections from this address
3874 }
3875 \end{verbatim}
3876
3877 Simply adding specific host routes on the OS
3878 would have an undesirable side-effect: any
3879 application trying to contact the destination host would be forced to use the
3880 more specific route possibly diverting management traffic onto a backup VLAN.
3881 Instead of adding host routes for each client connected to a multi-homed backup
3882 server (for example where there are management and backup VLANs), one can
3883 use the new directives to specify a specific source address at the application
3884 level.
3885
3886 Additionally, this allows the simplification and abstraction of firewall rules
3887 when dealing with a Hot-Standby director or storage daemon configuration.  The
3888 Hot-standby pair may share a CARP address, which connections must be sourced
3889 from, while system services listen and act from the unique interface addresses.
3890
3891 This project was funded by Collaborative Fusion, Inc.
3892
3893 \subsection{Show volume availability when doing restore}
3894
3895 When doing a restore the selection dialog ends by displaying this
3896 screen:
3897
3898 \begin{verbatim}
3899   The job will require the following
3900    Volume(s)                 Storage(s)                SD Device(s)
3901    ===========================================================================
3902    *000741L3                  LTO-4                     LTO3 
3903    *000866L3                  LTO-4                     LTO3 
3904    *000765L3                  LTO-4                     LTO3 
3905    *000764L3                  LTO-4                     LTO3 
3906    *000756L3                  LTO-4                     LTO3 
3907    *001759L3                  LTO-4                     LTO3 
3908    *001763L3                  LTO-4                     LTO3 
3909     001762L3                  LTO-4                     LTO3 
3910     001767L3                  LTO-4                     LTO3 
3911
3912 Volumes marked with ``*'' are online (in the autochanger).
3913 \end{verbatim}
3914
3915 This should help speed up large restores by minimizing the time spent
3916 waiting for the operator to discover that he must change tapes in the library.
3917
3918 This project was funded by Bacula Systems.
3919
3920 \subsection{Accurate estimate command}
3921
3922 The \texttt{estimate} command can now use the accurate code to detect changes
3923 and give a better estimation.
3924
3925 You can set the accurate behavior on the command line by using
3926 \texttt{accurate=yes\vb{}no} or use the Job setting as default value.
3927
3928 \begin{verbatim}
3929 * estimate listing accurate=yes level=incremental job=BackupJob
3930 \end{verbatim}
3931
3932 This project was funded by Bacula Systems.
3933
3934 \section{New Features in 3.0.0}
3935 \label{NewFeaturesChapter}
3936 \index[general]{New Features}
3937
3938 This chapter presents the new features added to the development 2.5.x
3939 versions to be released as Bacula version 3.0.0 sometime in April 2009.
3940
3941 \subsection{Accurate Backup}
3942 \index[general]{Accurate Backup}
3943
3944 As with most other backup programs, by default Bacula decides what files to
3945 backup for Incremental and Differential backup by comparing the change
3946 (st\_ctime) and modification (st\_mtime) times of the file to the time the last
3947 backup completed.  If one of those two times is later than the last backup
3948 time, then the file will be backed up.  This does not, however, permit tracking
3949 what files have been deleted and will miss any file with an old time that may
3950 have been restored to or moved onto the client filesystem.
3951
3952 \subsubsection{Accurate = \lt{}yes\vb{}no\gt{}}
3953 If the {\bf Accurate = \lt{}yes\vb{}no\gt{}} directive is enabled (default no) in
3954 the Job resource, the job will be run as an Accurate Job. For a {\bf Full}
3955 backup, there is no difference, but for {\bf Differential} and {\bf
3956   Incremental} backups, the Director will send a list of all previous files
3957 backed up, and the File daemon will use that list to determine if any new files
3958 have been added or or moved and if any files have been deleted. This allows
3959 Bacula to make an accurate backup of your system to that point in time so that
3960 if you do a restore, it will restore your system exactly.  
3961
3962 One note of caution
3963 about using Accurate backup is that it requires more resources (CPU and memory)
3964 on both the Director and the Client machines to create the list of previous
3965 files backed up, to send that list to the File daemon, for the File daemon to
3966 keep the list (possibly very big) in memory, and for the File daemon to do
3967 comparisons between every file in the FileSet and the list.  In particular,
3968 if your client has lots of files (more than a few million), you will need
3969 lots of memory on the client machine.
3970
3971 Accurate must not be enabled when backing up with a plugin that is not
3972 specially designed to work with Accurate. If you enable it, your restores
3973 will probably not work correctly.
3974
3975 This project was funded by Bacula Systems.
3976                                        
3977
3978
3979 \subsection{Copy Jobs}
3980 \index[general]{Copy Jobs}
3981
3982 A new {\bf Copy} job type 'C' has been implemented. It is similar to the
3983 existing Migration feature with the exception that the Job that is copied is
3984 left unchanged.  This essentially creates two identical copies of the same
3985 backup. However, the copy is treated as a copy rather than a backup job, and
3986 hence is not directly available for restore.  The {\bf restore} command lists
3987 copy jobs and allows selection of copies by using \texttt{jobid=}
3988 option. If the keyword {\bf copies} is present on the command line, Bacula will
3989 display the list of all copies for selected jobs.
3990
3991 \begin{verbatim}
3992 * restore copies
3993 [...]
3994 These JobIds have copies as follows:
3995 +-------+------------------------------------+-----------+------------------+
3996 | JobId | Job                                | CopyJobId | MediaType        |
3997 +-------+------------------------------------+-----------+------------------+
3998 | 2     | CopyJobSave.2009-02-17_16.31.00.11 | 7         | DiskChangerMedia |
3999 +-------+------------------------------------+-----------+------------------+
4000 +-------+-------+----------+----------+---------------------+------------------+
4001 | JobId | Level | JobFiles | JobBytes | StartTime           | VolumeName       |
4002 +-------+-------+----------+----------+---------------------+------------------+
4003 | 19    | F     | 6274     | 76565018 | 2009-02-17 16:30:45 | ChangerVolume002 |
4004 | 2     | I     | 1        | 5        | 2009-02-17 16:30:51 | FileVolume001    |
4005 +-------+-------+----------+----------+---------------------+------------------+
4006 You have selected the following JobIds: 19,2
4007
4008 Building directory tree for JobId(s) 19,2 ...  ++++++++++++++++++++++++++++++++++++++++++++
4009 5,611 files inserted into the tree.
4010 ...
4011 \end{verbatim}
4012
4013
4014 The Copy Job runs without using the File daemon by copying the data from the
4015 old backup Volume to a different Volume in a different Pool. See the Migration
4016 documentation for additional details. For copy Jobs there is a new selection
4017 directive named {\bf PoolUncopiedJobs} which selects all Jobs that were
4018 not already copied to another Pool. 
4019
4020 As with Migration, the Client, Volume, Job, or SQL query, are
4021 other possible ways of selecting the Jobs to be copied. Selection
4022 types like SmallestVolume, OldestVolume, PoolOccupancy and PoolTime also
4023 work, but are probably more suited for Migration Jobs. 
4024
4025 If Bacula finds a Copy of a job record that is purged (deleted) from the catalog,
4026 it will promote the Copy to a \textsl{real} backup job and will make it available for
4027 automatic restore. If more than one Copy is available, it will promote the copy
4028 with the smallest JobId.
4029
4030 A nice solution which can be built with the new Copy feature is often
4031 called disk-to-disk-to-tape backup (DTDTT). A sample config could
4032 look something like the one below:
4033
4034 \begin{verbatim}
4035 Pool {
4036   Name = FullBackupsVirtualPool
4037   Pool Type = Backup
4038   Purge Oldest Volume = Yes
4039   Storage = vtl
4040   NextPool = FullBackupsTapePool
4041 }
4042
4043 Pool {
4044   Name = FullBackupsTapePool
4045   Pool Type = Backup
4046   Recycle = Yes
4047   AutoPrune = Yes
4048   Volume Retention = 365 days
4049   Storage = superloader
4050 }
4051
4052 #
4053 # Fake fileset for copy jobs
4054 #
4055 Fileset {
4056   Name = None
4057   Include {
4058     Options {
4059       signature = MD5
4060     }
4061   }
4062 }
4063
4064 #
4065 # Fake client for copy jobs
4066 #
4067 Client {
4068   Name = None
4069   Address = localhost
4070   Password = "NoNe"
4071   Catalog = MyCatalog
4072 }
4073
4074 #
4075 # Default template for a CopyDiskToTape Job
4076 #
4077 JobDefs {
4078   Name = CopyDiskToTape
4079   Type = Copy
4080   Messages = StandardCopy
4081   Client = None
4082   FileSet = None
4083   Selection Type = PoolUncopiedJobs
4084   Maximum Concurrent Jobs = 10
4085   SpoolData = No
4086   Allow Duplicate Jobs = Yes
4087   Cancel Queued Duplicates = No
4088   Cancel Running Duplicates = No
4089   Priority = 13
4090 }
4091
4092 Schedule {
4093    Name = DaySchedule7:00
4094    Run = Level=Full daily at 7:00
4095 }
4096
4097 Job {
4098   Name = CopyDiskToTapeFullBackups
4099   Enabled = Yes
4100   Schedule = DaySchedule7:00
4101   Pool = FullBackupsVirtualPool
4102   JobDefs = CopyDiskToTape
4103 }
4104 \end{verbatim}
4105
4106 The example above had 2 pool which are copied using the PoolUncopiedJobs
4107 selection criteria. Normal Full backups go to the Virtual pool and are copied
4108 to the Tape pool the next morning.
4109
4110 The command \texttt{list copies [jobid=x,y,z]} lists copies for a given
4111 \textbf{jobid}.
4112
4113 \begin{verbatim}
4114 *list copies
4115 +-------+------------------------------------+-----------+------------------+
4116 | JobId | Job                                | CopyJobId | MediaType        |
4117 +-------+------------------------------------+-----------+------------------+
4118 |     9 | CopyJobSave.2008-12-20_22.26.49.05 |        11 | DiskChangerMedia |
4119 +-------+------------------------------------+-----------+------------------+
4120 \end{verbatim}
4121
4122 \subsection{ACL Updates}
4123 \index[general]{ACL Updates}
4124 The whole ACL code had been overhauled and in this version each platforms has
4125 different streams for each type of acl available on such an platform. As ACLs
4126 between platforms tend to be not that portable (most implement POSIX acls but
4127 some use an other draft or a completely different format) we currently only
4128 allow certain platform specific ACL streams to be decoded and restored on the
4129 same platform that they were created on.  The old code allowed to restore ACL
4130 cross platform but the comments already mention that not being to wise. For
4131 backward compatibility the new code will accept the two old ACL streams and
4132 handle those with the platform specific handler. But for all new backups it
4133 will save the ACLs using the new streams.
4134
4135 Currently the following platforms support ACLs:
4136
4137 \begin{itemize}
4138  \item {\bf AIX}
4139  \item {\bf Darwin/OSX}
4140  \item {\bf FreeBSD}
4141  \item {\bf HPUX}
4142  \item {\bf IRIX}
4143  \item {\bf Linux}
4144  \item {\bf Tru64}
4145  \item {\bf Solaris}
4146 \end{itemize}
4147
4148 Currently we support the following ACL types (these ACL streams use a reserved
4149 part of the stream numbers):
4150
4151 \begin{itemize}
4152 \item {\bf STREAM\_ACL\_AIX\_TEXT} 1000 AIX specific string representation from
4153   acl\_get
4154  \item {\bf STREAM\_ACL\_DARWIN\_ACCESS\_ACL} 1001 Darwin (OSX) specific acl\_t
4155    string representation from acl\_to\_text (POSIX acl)
4156   \item {\bf STREAM\_ACL\_FREEBSD\_DEFAULT\_ACL} 1002 FreeBSD specific acl\_t
4157     string representation from acl\_to\_text (POSIX acl) for default acls.
4158   \item {\bf STREAM\_ACL\_FREEBSD\_ACCESS\_ACL} 1003 FreeBSD specific acl\_t
4159     string representation from acl\_to\_text (POSIX acl) for access acls.
4160   \item {\bf STREAM\_ACL\_HPUX\_ACL\_ENTRY} 1004 HPUX specific acl\_entry
4161     string representation from acltostr (POSIX acl)
4162   \item {\bf STREAM\_ACL\_IRIX\_DEFAULT\_ACL} 1005 IRIX specific acl\_t string
4163     representation from acl\_to\_text (POSIX acl) for default acls.
4164   \item {\bf STREAM\_ACL\_IRIX\_ACCESS\_ACL} 1006 IRIX specific acl\_t string
4165     representation from acl\_to\_text (POSIX acl) for access acls.
4166   \item {\bf STREAM\_ACL\_LINUX\_DEFAULT\_ACL} 1007 Linux specific acl\_t
4167     string representation from acl\_to\_text (POSIX acl) for default acls.
4168   \item {\bf STREAM\_ACL\_LINUX\_ACCESS\_ACL} 1008 Linux specific acl\_t string
4169     representation from acl\_to\_text (POSIX acl) for access acls.
4170   \item {\bf STREAM\_ACL\_TRU64\_DEFAULT\_ACL} 1009 Tru64 specific acl\_t
4171     string representation from acl\_to\_text (POSIX acl) for default acls.
4172   \item {\bf STREAM\_ACL\_TRU64\_DEFAULT\_DIR\_ACL} 1010 Tru64 specific acl\_t
4173     string representation from acl\_to\_text (POSIX acl) for default acls.
4174   \item {\bf STREAM\_ACL\_TRU64\_ACCESS\_ACL} 1011 Tru64 specific acl\_t string
4175     representation from acl\_to\_text (POSIX acl) for access acls.
4176   \item {\bf STREAM\_ACL\_SOLARIS\_ACLENT} 1012 Solaris specific aclent\_t
4177     string representation from acltotext or acl\_totext (POSIX acl)
4178   \item {\bf STREAM\_ACL\_SOLARIS\_ACE} 1013 Solaris specific ace\_t string
4179     representation from from acl\_totext (NFSv4 or ZFS acl)
4180 \end{itemize}
4181
4182 In future versions we might support conversion functions from one type of acl
4183 into an other for types that are either the same or easily convertible. For now
4184 the streams are separate and restoring them on a platform that doesn't
4185 recognize them will give you a warning.
4186
4187 \subsection{Extended Attributes}
4188 \index[general]{Extended Attributes}
4189 Something that was on the project list for some time is now implemented for
4190 platforms that support a similar kind of interface. Its the support for backup
4191 and restore of so called extended attributes. As extended attributes are so
4192 platform specific these attributes are saved in separate streams for each
4193 platform.  Restores of the extended attributes can only be performed on the
4194 same platform the backup was done.  There is support for all types of extended
4195 attributes, but restoring from one type of filesystem onto an other type of
4196 filesystem on the same platform may lead to surprises.  As extended attributes
4197 can contain any type of data they are stored as a series of so called
4198 value-pairs.  This data must be seen as mostly binary and is stored as such.
4199 As security labels from selinux are also extended attributes this option also
4200 stores those labels and no specific code is enabled for handling selinux
4201 security labels.
4202
4203 Currently the following platforms support extended attributes:
4204 \begin{itemize}
4205  \item {\bf Darwin/OSX}
4206  \item {\bf FreeBSD}
4207  \item {\bf Linux}
4208  \item {\bf NetBSD}
4209 \end{itemize}
4210
4211 On Linux acls are also extended attributes, as such when you enable ACLs on a
4212 Linux platform it will NOT save the same data twice e.g. it will save the ACLs
4213 and not the same extended attribute.
4214
4215 To enable the backup of extended attributes please add the following to your
4216 fileset definition.
4217 \begin{verbatim}
4218   FileSet {
4219     Name = "MyFileSet"
4220     Include {
4221       Options {
4222         signature = MD5
4223         xattrsupport = yes
4224       }
4225       File = ...
4226     }
4227   }
4228 \end{verbatim}
4229
4230 \subsection{Shared objects}
4231 \index[general]{Shared objects}
4232 A default build of Bacula will now create the libraries as shared objects
4233 (.so) rather than static libraries as was previously the case.  
4234 The shared libraries are built using {\bf libtool} so it should be quite
4235 portable.
4236
4237 An important advantage of using shared objects is that on a machine with the
4238 Directory, File daemon, the Storage daemon, and a console, you will have only
4239 one copy of the code in memory rather than four copies.  Also the total size of
4240 the binary release is smaller since the library code appears only once rather
4241 than once for every program that uses it; this results in significant reduction
4242 in the size of the binaries particularly for the utility tools.
4243  
4244 In order for the system loader to find the shared objects when loading the
4245 Bacula binaries, the Bacula shared objects must either be in a shared object
4246 directory known to the loader (typically /usr/lib) or they must be in the
4247 directory that may be specified on the {\bf ./configure} line using the {\bf
4248   {-}{-}libdir} option as:
4249
4250 \begin{verbatim}
4251   ./configure --libdir=/full-path/dir
4252 \end{verbatim}
4253
4254 the default is /usr/lib. If {-}{-}libdir is specified, there should be
4255 no need to modify your loader configuration provided that
4256 the shared objects are installed in that directory (Bacula
4257 does this with the make install command). The shared objects
4258 that Bacula references are:
4259
4260 \begin{verbatim}
4261 libbaccfg.so
4262 libbacfind.so
4263 libbacpy.so
4264 libbac.so
4265 \end{verbatim}
4266
4267 These files are symbolically linked to the real shared object file,
4268 which has a version number to permit running multiple versions of
4269 the libraries if desired (not normally the case).
4270
4271 If you have problems with libtool or you wish to use the old
4272 way of building static libraries, or you want to build a static
4273 version of Bacula you may disable
4274 libtool on the configure command line with:
4275
4276 \begin{verbatim}
4277   ./configure --disable-libtool
4278 \end{verbatim}
4279
4280
4281 \subsection{Building Static versions of Bacula}
4282 \index[general]{Static linking}
4283 In order to build static versions of Bacula, in addition
4284 to configuration options that were needed you now must
4285 also add --disable-libtool.  Example
4286
4287 \begin{verbatim}
4288   ./configure --enable-static-client-only --disable-libtool
4289 \end{verbatim}
4290
4291
4292 \subsection{Virtual Backup (Vbackup)}
4293 \index[general]{Virtual Backup}
4294 \index[general]{Vbackup}
4295
4296 Bacula's virtual backup feature is often called Synthetic Backup or
4297 Consolidation in other backup products.  It permits you to consolidate the
4298 previous Full backup plus the most recent Differential backup and any
4299 subsequent Incremental backups into a new Full backup.  This new Full
4300 backup will then be considered as the most recent Full for any future
4301 Incremental or Differential backups.  The VirtualFull backup is
4302 accomplished without contacting the client by reading the previous backup
4303 data and writing it to a volume in a different pool.
4304
4305 In some respects the Vbackup feature works similar to a Migration job, in
4306 that Bacula normally reads the data from the pool specified in the 
4307 Job resource, and writes it to the {\bf Next Pool} specified in the 
4308 Job resource. Note, this means that usually the output from the Virtual
4309 Backup is written into a different pool from where your prior backups
4310 are saved. Doing it this way guarantees that you will not get a deadlock
4311 situation attempting to read and write to the same volume in the Storage
4312 daemon. If you then want to do subsequent backups, you may need to
4313 move the Virtual Full Volume back to your normal backup pool.
4314 Alternatively, you can set your {\bf Next Pool} to point to the current
4315 pool.  This will cause Bacula to read and write to Volumes in the
4316 current pool. In general, this will work, because Bacula will
4317 not allow reading and writing on the same Volume. In any case, once
4318 a VirtualFull has been created, and a restore is done involving the
4319 most current Full, it will read the Volume or Volumes by the VirtualFull 
4320 regardless of in which Pool the Volume is found.
4321
4322 The Vbackup is enabled on a Job by Job in the Job resource by specifying
4323 a level of {\bf VirtualFull}.
4324
4325 A typical Job resource definition might look like the following:
4326
4327 \begin{verbatim}
4328 Job {
4329   Name = "MyBackup"
4330   Type = Backup
4331   Client=localhost-fd
4332   FileSet = "Full Set"
4333   Storage = File
4334   Messages = Standard
4335   Pool = Default
4336   SpoolData = yes
4337 }
4338
4339 # Default pool definition
4340 Pool {
4341   Name = Default
4342   Pool Type = Backup
4343   Recycle = yes            # Automatically recycle Volumes
4344   AutoPrune = yes          # Prune expired volumes
4345   Volume Retention = 365d  # one year
4346   NextPool = Full
4347   Storage = File
4348 }
4349
4350 Pool {
4351   Name = Full
4352   Pool Type = Backup
4353   Recycle = yes            # Automatically recycle Volumes
4354   AutoPrune = yes          # Prune expired volumes
4355   Volume Retention = 365d  # one year
4356   Storage = DiskChanger
4357 }
4358
4359 # Definition of file storage device
4360 Storage {
4361   Name = File
4362   Address = localhost
4363   Password = "xxx"
4364   Device = FileStorage
4365   Media Type = File
4366   Maximum Concurrent Jobs = 5
4367 }
4368
4369 # Definition of DDS Virtual tape disk storage device
4370 Storage {
4371   Name = DiskChanger
4372   Address = localhost  # N.B. Use a fully qualified name here
4373   Password = "yyy"
4374   Device = DiskChanger
4375   Media Type = DiskChangerMedia
4376   Maximum Concurrent Jobs = 4
4377   Autochanger = yes
4378 }
4379 \end{verbatim}
4380
4381 Then in bconsole or via a Run schedule, you would run the job as:
4382
4383 \begin{verbatim}
4384 run job=MyBackup level=Full
4385 run job=MyBackup level=Incremental
4386 run job=MyBackup level=Differential
4387 run job=MyBackup level=Incremental
4388 run job=MyBackup level=Incremental
4389 \end{verbatim}
4390
4391 So providing there were changes between each of those jobs, you would end up
4392 with a Full backup, a Differential, which includes the first Incremental
4393 backup, then two Incremental backups.  All the above jobs would be written to
4394 the {\bf Default} pool.
4395
4396 To consolidate those backups into a new Full backup, you would run the
4397 following:
4398
4399 \begin{verbatim}
4400 run job=MyBackup level=VirtualFull
4401 \end{verbatim}
4402
4403 And it would produce a new Full backup without using the client, and the output
4404 would be written to the {\bf Full} Pool which uses the Diskchanger Storage.
4405
4406 If the Virtual Full is run, and there are no prior Jobs, the Virtual Full will
4407 fail with an error.
4408
4409 Note, the Start and End time of the Virtual Full backup is set to the
4410 values for the last job included in the Virtual Full (in the above example,
4411 it is an Increment). This is so that if another incremental is done, which
4412 will be based on the Virtual Full, it will backup all files from the
4413 last Job included in the Virtual Full rather than from the time the Virtual
4414 Full was actually run.
4415
4416
4417
4418 \subsection{Catalog Format}
4419 \index[general]{Catalog Format}
4420 Bacula 3.0 comes with some changes to the catalog format.  The upgrade
4421 operation will convert the FileId field of the File table from 32 bits (max 4
4422 billion table entries) to 64 bits (very large number of items).  The
4423 conversion process can take a bit of time and will likely DOUBLE THE SIZE of
4424 your catalog during the conversion.  Also you won't be able to run jobs during
4425 this conversion period.  For example, a 3 million file catalog will take 2
4426 minutes to upgrade on a normal machine.  Please don't forget to make a valid
4427 backup of your database before executing the upgrade script. See the 
4428 ReleaseNotes for additional details.
4429
4430 \subsection{64 bit Windows Client}
4431 \index[general]{Win64 Client}
4432 Unfortunately, Microsoft's implementation of Volume Shadown Copy (VSS) on
4433 their 64 bit OS versions is not compatible with a 32 bit Bacula Client.
4434 As a consequence, we are also releasing a 64 bit version of the Bacula 
4435 Windows Client (win64bacula-3.0.0.exe) that does work with VSS. 
4436 These binaries should only be installed on 64 bit Windows operating systems.
4437 What is important is not your hardware but whether or not you have
4438 a 64 bit version of the Windows OS.  
4439
4440 Compared to the Win32 Bacula Client, the 64 bit release contains a few differences:
4441 \begin{enumerate}
4442 \item Before installing the Win64 Bacula Client, you must totally
4443       deinstall any prior 2.4.x Client installation using the 
4444       Bacula deinstallation (see the menu item). You may want
4445       to save your .conf files first.
4446 \item Only the Client (File daemon) is ported to Win64, the Director
4447       and the Storage daemon are not in the 64 bit Windows installer.
4448 \item bwx-console is not yet ported.
4449 \item bconsole is ported but it has not been tested.
4450 \item The documentation is not included in the installer.
4451 \item Due to Vista security restrictions imposed on a default installation
4452       of Vista, before upgrading the Client, you must manually stop
4453       any prior version of Bacula from running, otherwise the install
4454       will fail.
4455 \item Due to Vista security restrictions imposed on a default installation
4456       of Vista, attempting to edit the conf files via the menu items
4457       will fail. You must directly edit the files with appropriate 
4458       permissions.  Generally double clicking on the appropriate .conf
4459       file will work providing you have sufficient permissions.
4460 \item All Bacula files are now installed in 
4461       {\bf C:/Program Files/Bacula} except the main menu items,
4462       which are installed as before. This vastly simplifies the installation.
4463 \item If you are running on a foreign language version of Windows, most
4464       likely {\bf C:/Program Files} does not exist, so you should use the
4465       Custom installation and enter an appropriate location to install
4466       the files.
4467 \item The 3.0.0 Win32 Client continues to install files in the locations used
4468       by prior versions. For the next version we will convert it to use
4469       the same installation conventions as the Win64 version.
4470 \end{enumerate}
4471
4472 This project was funded by Bacula Systems.
4473
4474
4475 \subsection{Duplicate Job Control}
4476 \index[general]{Duplicate Jobs}
4477 The new version of Bacula provides four new directives that
4478 give additional control over what Bacula does if duplicate jobs 
4479 are started.  A duplicate job in the sense we use it here means
4480 a second or subsequent job with the same name starts.  This
4481 happens most frequently when the first job runs longer than expected because no 
4482 tapes are available.
4483
4484 The four directives each take as an argument a {\bf yes} or {\bf no} value and
4485 are specified in the Job resource.
4486
4487 They are:
4488
4489 \subsubsection{Allow Duplicate Jobs = \lt{}yes\vb{}no\gt{}}
4490 \index[general]{Allow Duplicate Jobs}
4491   If this directive is set to {\bf yes}, duplicate jobs will be run.  If
4492   the directive is set to {\bf no} (default) then only one job of a given name
4493   may run at one time, and the action that Bacula takes to ensure only
4494   one job runs is determined by the other directives (see below).
4495  
4496   If {\bf Allow Duplicate Jobs} is set to {\bf no} and two jobs
4497   are present and none of the three directives given below permit
4498   Canceling a job, then the current job (the second one started)
4499   will be canceled.
4500
4501 \subsubsection{Allow Higher Duplicates = \lt{}yes\vb{}no\gt{}}
4502 \index[general]{Allow Higher Duplicates}
4503   This directive was in version 5.0.0, but does not work as
4504   expected. If used, it should always be set to no.  In later versions
4505   of Bacula the directive is disabled (disregarded).
4506
4507 \subsubsection{Cancel Running Duplicates = \lt{}yes\vb{}no\gt{}}
4508 \index[general]{Cancel Running Duplicates}
4509   If {\bf Allow Duplicate Jobs} is set to {\bf no} and
4510   if this directive is set to {\bf yes} any job that is already running
4511   will be canceled.  The default is {\bf no}.
4512
4513 \subsubsection{Cancel Queued Duplicates = \lt{}yes\vb{}no\gt{}}
4514 \index[general]{Cancel Queued Duplicates}
4515   If {\bf Allow Duplicate Jobs} is set to {\bf no} and
4516   if this directive is set to {\bf yes} any job that is
4517   already queued to run but not yet running will be canceled.
4518   The default is {\bf no}. 
4519
4520
4521 \subsection{TLS Authentication}
4522 \index[general]{TLS Authentication}
4523 In Bacula version 2.5.x and later, in addition to the normal Bacula
4524 CRAM-MD5 authentication that is used to authenticate each Bacula
4525 connection, you can specify that you want TLS Authentication as well,
4526 which will provide more secure authentication.
4527
4528 This new feature uses Bacula's existing TLS code (normally used for
4529 communications encryption) to do authentication.  To use it, you must
4530 specify all the TLS directives normally used to enable communications
4531 encryption (TLS Enable, TLS Verify Peer, TLS Certificate, ...) and
4532 a new directive:
4533
4534 \subsubsection{TLS Authenticate = yes}
4535 \begin{verbatim}
4536 TLS Authenticate = yes
4537 \end{verbatim}
4538
4539 in the main daemon configuration resource (Director for the Director,
4540 Client for the File daemon, and Storage for the Storage daemon).
4541
4542 When {\bf TLS Authenticate} is enabled, after doing the CRAM-MD5
4543 authentication, Bacula will also do TLS authentication, then TLS 
4544 encryption will be turned off, and the rest of the communication between
4545 the two Bacula daemons will be done without encryption.
4546
4547 If you want to encrypt communications data, use the normal TLS directives
4548 but do not turn on {\bf TLS Authenticate}.
4549
4550 \subsection{bextract non-portable Win32 data}
4551 \index[general]{bextract handles Win32 non-portable data}
4552 {\bf bextract} has been enhanced to be able to restore
4553 non-portable Win32 data to any OS.  Previous versions were 
4554 unable to restore non-portable Win32 data to machines that
4555 did not have the Win32 BackupRead and BackupWrite API calls.
4556
4557 \subsection{State File updated at Job Termination}
4558 \index[general]{State File}
4559 In previous versions of Bacula, the state file, which provides a
4560 summary of previous jobs run in the {\bf status} command output was
4561 updated only when Bacula terminated, thus if the daemon crashed, the
4562 state file might not contain all the run data.  This version of
4563 the Bacula daemons updates the state file on each job termination.
4564
4565 \subsection{MaxFullInterval = \lt{}time-interval\gt{}}
4566 \index[general]{MaxFullInterval}
4567 The new Job resource directive {\bf Max Full Interval = \lt{}time-interval\gt{}}
4568 can be used to specify the maximum time interval between {\bf Full} backup
4569 jobs. When a job starts, if the time since the last Full backup is
4570 greater than the specified interval, and the job would normally be an
4571 {\bf Incremental} or {\bf Differential}, it will be automatically
4572 upgraded to a {\bf Full} backup.
4573
4574 \subsection{MaxDiffInterval = \lt{}time-interval\gt{}}
4575 \index[general]{MaxDiffInterval}
4576 The new Job resource directive {\bf Max Diff Interval = \lt{}time-interval\gt{}}
4577 can be used to specify the maximum time interval between {\bf Differential} backup
4578 jobs. When a job starts, if the time since the last Differential backup is
4579 greater than the specified interval, and the job would normally be an
4580 {\bf Incremental}, it will be automatically
4581 upgraded to a {\bf Differential} backup.
4582
4583 \subsection{Honor No Dump Flag = \lt{}yes\vb{}no\gt{}}
4584 \index[general]{MaxDiffInterval}
4585 On FreeBSD systems, each file has a {\bf no dump flag} that can be set
4586 by the user, and when it is set it is an indication to backup programs
4587 to not backup that particular file.  This version of Bacula contains a
4588 new Options directive within a FileSet resource, which instructs Bacula to
4589 obey this flag.  The new directive is:
4590
4591 \begin{verbatim}
4592   Honor No Dump Flag = yes\vb{}no
4593 \end{verbatim}
4594
4595 The default value is {\bf no}.
4596
4597
4598 \subsection{Exclude Dir Containing = \lt{}filename-string\gt{}}
4599 \index[general]{IgnoreDir}
4600 The {\bf ExcludeDirContaining = \lt{}filename\gt{}} is a new directive that
4601 can be added to the Include section of the FileSet resource.  If the specified
4602 filename ({\bf filename-string}) is found on the Client in any directory to be
4603 backed up, the whole directory will be ignored (not backed up).  For example:
4604
4605 \begin{verbatim}
4606   # List of files to be backed up
4607   FileSet {
4608     Name = "MyFileSet"
4609     Include {
4610       Options {
4611         signature = MD5
4612       }
4613       File = /home
4614       Exclude Dir Containing = .excludeme
4615     }
4616   }
4617 \end{verbatim}
4618
4619 But in /home, there may be hundreds of directories of users and some
4620 people want to indicate that they don't want to have certain
4621 directories backed up. For example, with the above FileSet, if
4622 the user or sysadmin creates a file named {\bf .excludeme} in 
4623 specific directories, such as
4624
4625 \begin{verbatim}
4626    /home/user/www/cache/.excludeme
4627    /home/user/temp/.excludeme
4628 \end{verbatim}
4629
4630 then Bacula will not backup the two directories named:
4631
4632 \begin{verbatim}
4633    /home/user/www/cache
4634    /home/user/temp
4635 \end{verbatim}
4636
4637 NOTE: subdirectories will not be backed up.  That is, the directive
4638 applies to the two directories in question and any children (be they
4639 files, directories, etc).
4640
4641
4642 \subsection{Bacula Plugins}
4643 \index[general]{Plugin}
4644 Support for shared object plugins has been implemented in the Linux, Unix
4645 and Win32 File daemons. The API will be documented separately in
4646 the Developer's Guide or in a new document.  For the moment, there is
4647 a single plugin named {\bf bpipe} that allows an external program to
4648 get control to backup and restore a file.
4649
4650 Plugins are also planned (partially implemented) in the Director and the
4651 Storage daemon.  
4652
4653 \subsubsection{Plugin Directory}
4654 \index[general]{Plugin Directory}
4655 Each daemon (DIR, FD, SD) has a new {\bf Plugin Directory} directive that may
4656 be added to the daemon definition resource. The directory takes a quoted 
4657 string argument, which is the name of the directory in which the daemon can
4658 find the Bacula plugins. If this directive is not specified, Bacula will not
4659 load any plugins. Since each plugin has a distinctive name, all the daemons
4660 can share the same plugin directory. 
4661
4662 \subsubsection{Plugin Options}
4663 \index[general]{Plugin Options}
4664 The {\bf Plugin Options} directive takes a quoted string
4665 argument (after the equal sign) and may be specified in the
4666 Job resource.  The options specified will be passed to all plugins
4667 when they are run.  This each plugin must know what it is looking
4668 for. The value defined in the Job resource can be modified
4669 by the user when he runs a Job via the {\bf bconsole} command line 
4670 prompts.
4671
4672 Note: this directive may be specified, and there is code to modify
4673 the string in the run command, but the plugin options are not yet passed to
4674 the plugin (i.e. not fully implemented).
4675
4676 \subsubsection{Plugin Options ACL}
4677 \index[general]{Plugin Options ACL}
4678 The {\bf Plugin Options ACL} directive may be specified in the
4679 Director's Console resource. It functions as all the other ACL commands
4680 do by permitting users running restricted consoles to specify a 
4681 {\bf Plugin Options} that overrides the one specified in the Job
4682 definition. Without this directive restricted consoles may not modify
4683 the Plugin Options.
4684
4685 \subsubsection{Plugin = \lt{}plugin-command-string\gt{}}
4686 \index[general]{Plugin}
4687 The {\bf Plugin} directive is specified in the Include section of
4688 a FileSet resource where you put your {\bf File = xxx} directives.
4689 For example:
4690
4691 \begin{verbatim}
4692   FileSet {
4693     Name = "MyFileSet"
4694     Include {
4695       Options {
4696         signature = MD5
4697       }
4698       File = /home
4699       Plugin = "bpipe:..."
4700     }
4701   }
4702 \end{verbatim}
4703
4704 In the above example, when the File daemon is processing the directives
4705 in the Include section, it will first backup all the files in {\bf /home}
4706 then it will load the plugin named {\bf bpipe} (actually bpipe-dir.so) from
4707 the Plugin Directory.  The syntax and semantics of the Plugin directive
4708 require the first part of the string up to the colon (:) to be the name
4709 of the plugin. Everything after the first colon is ignored by the File daemon but
4710 is passed to the plugin. Thus the plugin writer may define the meaning of the
4711 rest of the string as he wishes.
4712
4713 Please see the next section for information about the {\bf bpipe} Bacula
4714 plugin.
4715
4716 \subsection{The bpipe Plugin}
4717 \index[general]{The bpipe Plugin}
4718 The {\bf bpipe} plugin is provided in the directory src/plugins/fd/bpipe-fd.c of
4719 the Bacula source distribution. When the plugin is compiled and linking into
4720 the resulting dynamic shared object (DSO), it will have the name {\bf bpipe-fd.so}.
4721 Please note that this is a very simple plugin that was written for
4722 demonstration and test purposes. It is and can be used in production, but
4723 that was never really intended.
4724
4725 The purpose of the plugin is to provide an interface to any system program for
4726 backup and restore. As specified above the {\bf bpipe} plugin is specified in
4727 the Include section of your Job's FileSet resource.  The full syntax of the
4728 plugin directive as interpreted by the {\bf bpipe} plugin (each plugin is free
4729 to specify the sytax as it wishes) is:
4730
4731 \begin{verbatim}
4732   Plugin = "<field1>:<field2>:<field3>:<field4>"
4733 \end{verbatim}
4734
4735 where
4736 \begin{description}
4737 \item {\bf field1} is the name of the plugin with the trailing {\bf -fd.so}
4738 stripped off, so in this case, we would put {\bf bpipe} in this field.
4739
4740 \item {\bf field2} specifies the namespace, which for {\bf bpipe} is the
4741 pseudo path and filename under which the backup will be saved. This pseudo
4742 path and filename will be seen by the user in the restore file tree.
4743 For example, if the value is {\bf /MYSQL/regress.sql}, the data
4744 backed up by the plugin will be put under that "pseudo" path and filename.
4745 You must be careful to choose a naming convention that is unique to avoid
4746 a conflict with a path and filename that actually exists on your system.
4747
4748 \item {\bf field3} for the {\bf bpipe} plugin 
4749 specifies the "reader" program that is called by the plugin during
4750 backup to read the data. {\bf bpipe} will call this program by doing a
4751 {\bf popen} on it. 
4752
4753 \item {\bf field4} for the {\bf bpipe} plugin
4754 specifies the "writer" program that is called by the plugin during
4755 restore to write the data back to the filesystem.  
4756 \end{description}
4757
4758 Please note that for two items above describing the "reader" and "writer"
4759 fields, these programs are "executed" by Bacula, which
4760 means there is no shell interpretation of any command line arguments
4761 you might use.  If you want to use shell characters (redirection of input
4762 or output, ...), then we recommend that you put your command or commands
4763 in a shell script and execute the script. In addition if you backup a
4764 file with the reader program, when running the writer program during
4765 the restore, Bacula will not automatically create the path to the file.
4766 Either the path must exist, or you must explicitly do so with your command
4767 or in a shell script.
4768
4769 Putting it all together, the full plugin directive line might look
4770 like the following:
4771
4772 \begin{verbatim}
4773 Plugin = "bpipe:/MYSQL/regress.sql:mysqldump -f 
4774           --opt --databases bacula:mysql"
4775 \end{verbatim}
4776
4777 The directive has been split into two lines, but within the {\bf bacula-dir.conf} file
4778 would be written on a single line.
4779
4780 This causes the File daemon to call the {\bf bpipe} plugin, which will write
4781 its data into the "pseudo" file {\bf /MYSQL/regress.sql} by calling the 
4782 program {\bf mysqldump -f --opt --database bacula} to read the data during
4783 backup. The mysqldump command outputs all the data for the database named
4784 {\bf bacula}, which will be read by the plugin and stored in the backup.
4785 During restore, the data that was backed up will be sent to the program
4786 specified in the last field, which in this case is {\bf mysql}.  When
4787 {\bf mysql} is called, it will read the data sent to it by the plugn
4788 then write it back to the same database from which it came ({\bf bacula}
4789 in this case).
4790
4791 The {\bf bpipe} plugin is a generic pipe program, that simply transmits 
4792 the data from a specified program to Bacula for backup, and then from Bacula to 
4793 a specified program for restore.
4794
4795 By using different command lines to {\bf bpipe},
4796 you can backup any kind of data (ASCII or binary) depending
4797 on the program called.
4798
4799 \subsection{Microsoft Exchange Server 2003/2007 Plugin}
4800 \index[general]{Microsoft Exchange Server 2003/2007 Plugin}
4801 \subsubsection{Background}
4802 The Exchange plugin was made possible by a funded development project
4803 between Equiinet Ltd -- www.equiinet.com (many thanks) and Bacula Systems.
4804 The code for the plugin was written by James Harper, and the Bacula core
4805 code by Kern Sibbald.  All the code for this funded development has become
4806 part of the Bacula project.  Thanks to everyone who made it happen.
4807
4808 \subsubsection{Concepts}
4809 Although it is possible to backup Exchange using Bacula VSS the Exchange 
4810 plugin adds a good deal of functionality, because while Bacula VSS
4811 completes a full backup (snapshot) of Exchange, it does
4812 not support Incremental or Differential backups, restoring is more
4813 complicated, and a single database restore is not possible.
4814
4815 Microsoft Exchange organises its storage into Storage Groups with
4816 Databases inside them. A default installation of Exchange will have a
4817 single Storage Group called 'First Storage Group', with two Databases
4818 inside it, "Mailbox Store (SERVER NAME)" and 
4819 "Public Folder Store (SERVER NAME)", 
4820 which hold user email and public folders respectively.
4821
4822 In the default configuration, Exchange logs everything that happens to
4823 log files, such that if you have a backup, and all the log files since,
4824 you can restore to the present time. Each Storage Group has its own set
4825 of log files and operates independently of any other Storage Groups. At
4826 the Storage Group level, the logging can be turned off by enabling a
4827 function called "Enable circular logging". At this time the Exchange
4828 plugin will not function if this option is enabled.
4829
4830 The plugin allows backing up of entire storage groups, and the restoring
4831 of entire storage groups or individual databases. Backing up and
4832 restoring at the individual mailbox or email item is not supported but
4833 can be simulated by use of the "Recovery" Storage Group (see below).
4834
4835 \subsubsection{Installing}
4836 The Exchange plugin requires a DLL that is shipped with Microsoft
4837 Exchanger Server called {\bf esebcli2.dll}. Assuming Exchange is installed
4838 correctly the Exchange plugin should find this automatically and run
4839 without any additional installation.
4840
4841 If the DLL can not be found automatically it will need to be copied into
4842 the Bacula installation
4843 directory (eg C:\verb+\+Program Files\verb+\+Bacula\verb+\+bin). The Exchange API DLL is
4844 named esebcli2.dll and is found in C:\verb+\+Program Files\verb+\+Exchsrvr\verb+\+bin on a
4845 default Exchange installation.
4846
4847 \subsubsection{Backing Up}
4848 To back up an Exchange server the Fileset definition must contain at
4849 least {\bf Plugin = "exchange:/@EXCHANGE/Microsoft Information Store"} for
4850 the backup to work correctly. The 'exchange:' bit tells Bacula to look
4851 for the exchange plugin, the '@EXCHANGE' bit makes sure all the backed
4852 up files are prefixed with something that isn't going to share a name
4853 with something outside the plugin, and the 'Microsoft Information Store'
4854 bit is required also. It is also possible to add the name of a storage
4855 group to the "Plugin =" line, eg \\
4856 {\bf Plugin = "exchange:/@EXCHANGE/Microsoft Information Store/First Storage Group"} \\
4857 if you want only a single storage group backed up.
4858
4859 Additionally, you can suffix the 'Plugin =' directive with
4860 ":notrunconfull" which will tell the plugin not to truncate the Exchange
4861 database at the end of a full backup.
4862
4863 An Incremental or Differential backup will backup only the database logs
4864 for each Storage Group by inspecting the "modified date" on each
4865 physical log file. Because of the way the Exchange API works, the last
4866 logfile backed up on each backup will always be backed up by the next
4867 Incremental or Differential backup too. This adds 5MB to each
4868 Incremental or Differential backup size but otherwise does not cause any
4869 problems.
4870
4871 By default, a normal VSS fileset containing all the drive letters will
4872 also back up the Exchange databases using VSS. This will interfere with
4873 the plugin and Exchange's shared ideas of when the last full backup was
4874 done, and may also truncate log files incorrectly. It is important,
4875 therefore, that the Exchange database files be excluded from the backup,
4876 although the folders the files are in should be included, or they will
4877 have to be recreated manually if a bare metal restore is done.
4878
4879 \begin{verbatim}
4880 FileSet {
4881    Include {
4882       File = C:/Program Files/Exchsrvr/mdbdata
4883       Plugin = "exchange:..."
4884    }
4885    Exclude {
4886       File = C:/Program Files/Exchsrvr/mdbdata/E00.chk
4887       File = C:/Program Files/Exchsrvr/mdbdata/E00.log
4888       File = C:/Program Files/Exchsrvr/mdbdata/E000000F.log
4889       File = C:/Program Files/Exchsrvr/mdbdata/E0000010.log
4890       File = C:/Program Files/Exchsrvr/mdbdata/E0000011.log
4891       File = C:/Program Files/Exchsrvr/mdbdata/E00tmp.log
4892       File = C:/Program Files/Exchsrvr/mdbdata/priv1.edb
4893    }
4894 }
4895 \end{verbatim}
4896
4897 The advantage of excluding the above files is that you can significantly
4898 reduce the size of your backup since all the important Exchange files
4899 will be properly saved by the Plugin.
4900
4901
4902 \subsubsection{Restoring}
4903 The restore operation is much the same as a normal Bacula restore, with
4904 the following provisos:
4905
4906 \begin{itemize}
4907 \item  The {\bf Where} restore option must not be specified
4908 \item Each Database directory must be marked as a whole. You cannot just
4909      select (say) the .edb file and not the others.
4910 \item If a Storage Group is restored, the directory of the Storage Group
4911      must be marked too.
4912 \item  It is possible to restore only a subset of the available log files,
4913      but they {\bf must} be contiguous. Exchange will fail to restore correctly
4914      if a log file is missing from the sequence of log files
4915 \item Each database to be restored must be dismounted and marked as "Can be
4916     overwritten by restore"
4917 \item If an entire Storage Group is to be restored (eg all databases and
4918    logs in the Storage Group), then it is best to manually delete the
4919    database files from the server (eg C:\verb+\+Program Files\verb+\+Exchsrvr\verb+\+mdbdata\verb+\+*)
4920    as Exchange can get confused by stray log files lying around.
4921 \end{itemize}
4922
4923 \subsubsection{Restoring to the Recovery Storage Group}
4924 The concept of the Recovery Storage Group is well documented by
4925 Microsoft 
4926 \elink{http://support.microsoft.com/kb/824126}{http://support.microsoft.com/kb/824126}, 
4927 but to briefly summarize...
4928
4929 Microsoft Exchange allows the creation of an additional Storage Group
4930 called the Recovery Storage Group, which is used to restore an older
4931 copy of a database (e.g. before a mailbox was deleted) into without
4932 messing with the current live data. This is required as the Standard and
4933 Small Business Server versions of Exchange can not ordinarily have more
4934 than one Storage Group.
4935
4936 To create the Recovery Storage Group, drill down to the Server in Exchange
4937 System Manager, right click, and select
4938 {\bf "New -> Recovery Storage Group..."}.  Accept or change the file
4939 locations and click OK. On the Recovery Storage Group, right click and
4940 select {\bf "Add Database to Recover..."} and select the database you will
4941 be restoring.
4942
4943 Restore only the single database nominated as the database in the
4944 Recovery Storage Group. Exchange will redirect the restore to the
4945 Recovery Storage Group automatically.
4946 Then run the restore.
4947
4948 \subsubsection{Restoring on Microsoft Server 2007}
4949 Apparently the {\bf Exmerge} program no longer exists in Microsoft Server
4950 2007, and hence you use a new procedure for recovering a single mail box.
4951 This procedure is documented by Microsoft at:
4952 \elink{http://technet.microsoft.com/en-us/library/aa997694.aspx}{http://technet.microsoft.com/en-us/library/aa997694.aspx},
4953 and involves using the {\bf Restore-Mailbox} and {\bf
4954 Get-Mailbox Statistics} shell commands.
4955
4956 \subsubsection{Caveats}
4957 This plugin is still being developed, so you should consider it
4958 currently in BETA test, and thus use in a production environment
4959 should be done only after very careful testing.
4960
4961 When doing a full backup, the Exchange database logs are truncated by
4962 Exchange as soon as the plugin has completed the backup. If the data
4963 never makes it to the backup medium (eg because of spooling) then the
4964 logs will still be truncated, but they will also not have been backed
4965 up. A solution to this is being worked on. You will have to schedule a
4966 new Full backup to ensure that your next backups will be usable.
4967
4968 The "Enable Circular Logging" option cannot be enabled or the plugin
4969 will fail.
4970
4971 Exchange insists that a successful Full backup must have taken place if
4972 an Incremental or Differential backup is desired, and the plugin will
4973 fail if this is not the case. If a restore is done, Exchange will
4974 require that a Full backup be done before an Incremental or Differential
4975 backup is done.
4976
4977 The plugin will most likely not work well if another backup application
4978 (eg NTBACKUP) is backing up the Exchange database, especially if the
4979 other backup application is truncating the log files.
4980
4981 The Exchange plugin has not been tested with the {\bf Accurate} option, so
4982 we recommend either carefully testing or that you avoid this option for
4983 the current time.
4984
4985 The Exchange plugin is not called during processing the bconsole {\bf
4986 estimate} command, and so anything that would be backed up by the plugin
4987 will not be added to the estimate total that is displayed.
4988
4989
4990 \subsection{libdbi Framework}
4991 \index[general]{libdbi Framework}
4992 As a general guideline, Bacula has support for a few catalog database drivers
4993 (MySQL, PostgreSQL, SQLite)
4994 coded natively by the Bacula team.  With the libdbi implementation, which is a
4995 Bacula driver that uses libdbi to access the catalog, we have an open field to
4996 use many different kinds database engines following the needs of users.
4997
4998 The according to libdbi (http://libdbi.sourceforge.net/) project: libdbi
4999 implements a database-independent abstraction layer in C, similar to the
5000 DBI/DBD layer in Perl. Writing one generic set of code, programmers can
5001 leverage the power of multiple databases and multiple simultaneous database
5002 connections by using this framework.
5003
5004 Currently the libdbi driver in Bacula project only supports the same drivers
5005 natively coded in Bacula.  However the libdbi project has support for many
5006 others database engines. You can view the list at
5007 http://libdbi-drivers.sourceforge.net/. In the future all those drivers can be
5008 supported by Bacula, however, they must be tested properly by the Bacula team.
5009
5010 Some of benefits of using libdbi are:
5011 \begin{itemize}
5012 \item The possibility to use proprietary databases engines in which your
5013   proprietary licenses prevent the Bacula team from developing the driver.
5014  \item The possibility to use the drivers written for the libdbi project.
5015  \item The possibility to use other database engines without recompiling Bacula
5016    to use them.  Just change one line in bacula-dir.conf
5017  \item Abstract Database access, this is, unique point to code and profiling
5018    catalog database access.
5019  \end{itemize}
5020  
5021  The following drivers have been tested:
5022  \begin{itemize}
5023  \item PostgreSQL, with and without batch insert
5024  \item Mysql, with and without batch insert
5025  \item SQLite
5026  \item SQLite3
5027  \end{itemize}
5028
5029  In the future, we will test and approve to use others databases engines
5030  (proprietary or not) like DB2, Oracle, Microsoft SQL.
5031
5032  To compile Bacula to support libdbi we need to configure the code with the
5033  --with-dbi and --with-dbi-driver=[database] ./configure options, where
5034  [database] is the database engine to be used with Bacula (of course we can
5035  change the driver in file bacula-dir.conf, see below).  We must configure the
5036  access port of the database engine with the option --with-db-port, because the
5037  libdbi framework doesn't know the default access port of each database.
5038
5039 The next phase is checking (or configuring) the bacula-dir.conf, example:
5040 \begin{verbatim}
5041 Catalog {
5042   Name = MyCatalog
5043   dbdriver = dbi:mysql; dbaddress = 127.0.0.1; dbport = 3306
5044   dbname = regress; user = regress; password = ""
5045 }
5046 \end{verbatim}
5047
5048 The parameter {\bf dbdriver} indicates that we will use the driver dbi with a
5049 mysql database.  Currently the drivers supported by Bacula are: postgresql,
5050 mysql, sqlite, sqlite3; these are the names that may be added to string "dbi:".
5051
5052 The following limitations apply when Bacula is set to use the libdbi framework:
5053  - Not tested on the Win32 platform
5054  - A little performance is lost if comparing with native database driver. 
5055    The reason is bound with the database driver provided by libdbi and the 
5056    simple fact that one more layer of code was added.
5057
5058 It is important to remember, when compiling Bacula with libdbi, the
5059 following packages are needed:
5060  \begin{itemize}
5061   \item libdbi version 1.0.0, http://libdbi.sourceforge.net/
5062   \item libdbi-drivers 1.0.0, http://libdbi-drivers.sourceforge.net/
5063  \end{itemize}
5064  
5065  You can download them and compile them on your system or install the packages
5066  from your OS distribution.
5067
5068 \subsection{Console Command Additions and Enhancements}
5069 \index[general]{Console Additions}                                 
5070
5071 \subsubsection{Display Autochanger Content}
5072 \index[general]{StatusSlots}
5073
5074 The {\bf status slots storage=\lt{}storage-name\gt{}} command displays
5075 autochanger content.
5076
5077 \footnotesize
5078 \begin{verbatim}
5079  Slot |  Volume Name  |  Status  |  Media Type       |   Pool     |
5080 ------+---------------+----------+-------------------+------------|
5081     1 |         00001 |   Append |  DiskChangerMedia |    Default |
5082     2 |         00002 |   Append |  DiskChangerMedia |    Default |
5083     3*|         00003 |   Append |  DiskChangerMedia |    Scratch |
5084     4 |               |          |                   |            |
5085 \end{verbatim}
5086 \normalsize
5087
5088 If you an asterisk ({\bf *}) appears after the slot number, you must run an
5089 {\bf update slots} command to synchronize autochanger content with your
5090 catalog.
5091
5092 \subsubsection{list joblog job=xxx or jobid=nnn}
5093 \index[general]{list joblog}
5094 A new list command has been added that allows you to list the contents
5095 of the Job Log stored in the catalog for either a Job Name (fully qualified)
5096 or for a particular JobId.  The {\bf llist} command will include a line with
5097 the time and date of the entry.
5098
5099 Note for the catalog to have Job Log entries, you must have a directive 
5100 such as:
5101
5102 \begin{verbatim}
5103   catalog = all
5104 \end{verbatim}
5105
5106 In your Director's {\bf Messages} resource.
5107
5108 \subsubsection{Use separator for multiple commands}
5109 \index[general]{Command Separator}
5110   When using bconsole with readline, you can set the command separator with 
5111   \textbf{@separator} command to one
5112   of those characters to write commands who require multiple input in one line.
5113 \begin{verbatim}
5114   !$%&'()*+,-/:;<>?[]^`{|}~
5115 \end{verbatim}
5116
5117 \subsubsection{Deleting Volumes}
5118 The delete volume bconsole command has been modified to
5119 require an asterisk (*) in front of a MediaId otherwise the
5120 value you enter is a taken to be a Volume name. This is so that
5121 users may delete numeric Volume names. The previous Bacula versions
5122 assumed that all input that started with a number was a MediaId.
5123
5124 This new behavior is indicated in the prompt if you read it
5125 carefully.
5126
5127 \subsection{Bare Metal Recovery}
5128 The old bare metal recovery project is essentially dead. One
5129 of the main features of it was that it would build a recovery
5130 CD based on the kernel on your system. The problem was that
5131 every distribution has a different boot procedure and different 
5132 scripts, and worse yet, the boot procedures and scripts change
5133 from one distribution to another.  This meant that maintaining
5134 (keeping up with the changes) the rescue CD was too much work.
5135
5136 To replace it, a new bare metal recovery USB boot stick has been developed
5137 by Bacula Systems.  This technology involves remastering a Ubuntu LiveCD to
5138 boot from a USB key.  
5139
5140 Advantages: 
5141 \begin{enumerate} 
5142 \item Recovery can be done from within graphical environment.  
5143 \item Recovery can be done in a shell.  
5144 \item Ubuntu boots on a large number of Linux systems.  
5145 \item The process of updating the system and adding new
5146    packages is not too difficult. 
5147 \item The USB key can easily be upgraded to newer Ubuntu versions.
5148 \item The USB key has writable partitions for modifications to
5149    the OS and for modification to your home directory.
5150 \item You can add new files/directories to the USB key very easily.
5151 \item You can save the environment from multiple machines on
5152    one USB key.
5153 \item Bacula Systems is funding its ongoing development.
5154 \end{enumerate}
5155
5156 The disadvantages are:
5157 \begin{enumerate}
5158 \item The USB key is usable but currently under development.
5159 \item Not everyone may be familiar with Ubuntu (no worse
5160   than using Knoppix)
5161 \item Some older OSes cannot be booted from USB. This can
5162    be resolved by first booting a Ubuntu LiveCD then plugging
5163    in the USB key.
5164 \item Currently the documentation is sketchy and not yet added
5165    to the main manual. See below ...
5166 \end{enumerate}
5167
5168 The documentation and the code can be found in the {\bf rescue} package
5169 in the directory {\bf linux/usb}.
5170
5171 \subsection{Miscellaneous}
5172 \index[general]{Misc New Features}
5173
5174 \subsubsection{Allow Mixed Priority = \lt{}yes\vb{}no\gt{}}
5175 \index[general]{Allow Mixed Priority}
5176    This directive is only implemented in version 2.5 and later.  When
5177    set to {\bf yes} (default {\bf no}), this job may run even if lower
5178    priority jobs are already running.  This means a high priority job
5179    will not have to wait for other jobs to finish before starting.
5180    The scheduler will only mix priorities when all running jobs have
5181    this set to true.
5182
5183    Note that only higher priority jobs will start early.  Suppose the
5184    director will allow two concurrent jobs, and that two jobs with
5185    priority 10 are running, with two more in the queue.  If a job with
5186    priority 5 is added to the queue, it will be run as soon as one of
5187    the running jobs finishes.  However, new priority 10 jobs will not
5188    be run until the priority 5 job has finished.
5189
5190 \subsubsection{Bootstrap File Directive -- FileRegex}
5191 \index[general]{Bootstrap File Directive}
5192   {\bf FileRegex} is a new command that can be added to the bootstrap
5193   (.bsr) file.  The value is a regular expression.  When specified, only
5194   matching filenames will be restored.
5195
5196   During a restore, if all File records are pruned from the catalog
5197   for a Job, normally Bacula can restore only all files saved. That
5198   is there is no way using the catalog to select individual files.
5199   With this new feature, Bacula will ask if you want to specify a Regex
5200   expression for extracting only a part of the full backup.
5201
5202 \begin{verbatim}
5203   Building directory tree for JobId(s) 1,3 ...
5204   There were no files inserted into the tree, so file selection
5205   is not possible.Most likely your retention policy pruned the files
5206   
5207   Do you want to restore all the files? (yes\vb{}no): no
5208   
5209   Regexp matching files to restore? (empty to abort): /tmp/regress/(bin|tests)/
5210   Bootstrap records written to /tmp/regress/working/zog4-dir.restore.1.bsr
5211 \end{verbatim}
5212
5213 \subsubsection{Bootstrap File Optimization Changes}
5214 In order to permit proper seeking on disk files, we have extended the bootstrap
5215 file format to include a {\bf VolStartAddr} and {\bf VolEndAddr} records. Each
5216 takes a 64 bit unsigned integer range (i.e. nnn-mmm) which defines the start
5217 address range and end address range respectively.  These two directives replace
5218 the {\bf VolStartFile}, {\bf VolEndFile}, {\bf VolStartBlock} and {\bf
5219   VolEndBlock} directives.  Bootstrap files containing the old directives will
5220 still work, but will not properly take advantage of proper disk seeking, and
5221 may read completely to the end of a disk volume during a restore.  With the new
5222 format (automatically generated by the new Director), restores will seek
5223 properly and stop reading the volume when all the files have been restored.
5224
5225 \subsubsection{Solaris ZFS/NFSv4 ACLs}
5226 This is an upgrade of the previous Solaris ACL backup code
5227 to the new library format, which will backup both the old
5228 POSIX(UFS) ACLs as well as the ZFS ACLs.
5229
5230 The new code can also restore POSIX(UFS) ACLs to a ZFS filesystem
5231 (it will translate the POSIX(UFS)) ACL into a ZFS/NFSv4 one) it can also
5232 be used to transfer from UFS to ZFS filesystems.
5233
5234
5235 \subsubsection{Virtual Tape Emulation}
5236 \index[general]{Virtual Tape Emulation}
5237 We now have a Virtual Tape emulator that allows us to run though 99.9\% of
5238 the tape code but actually reading and writing to a disk file. Used with the
5239 \textbf{disk-changer} script, you can now emulate an autochanger with 10 drives
5240 and 700 slots. This feature is most useful in testing.  It is enabled
5241 by using {\bf Device Type = vtape} in the Storage daemon's Device
5242 directive. This feature is only implemented on Linux machines and should not be
5243 used for production.
5244
5245 \subsubsection{Bat Enhancements}
5246 \index[general]{Bat Enhancements}
5247 Bat (the Bacula Administration Tool) GUI program has been significantly
5248 enhanced and stabilized. In particular, there are new table based status 
5249 commands; it can now be easily localized using Qt4 Linguist.
5250
5251 The Bat communications protocol has been significantly enhanced to improve
5252 GUI handling. Note, you {\bf must} use a the bat that is distributed with
5253 the Director you are using otherwise the communications protocol will not
5254 work.
5255
5256 \subsubsection{RunScript Enhancements}
5257 \index[general]{RunScript Enhancements}
5258 The {\bf RunScript} resource has been enhanced to permit multiple
5259 commands per RunScript.  Simply specify multiple {\bf Command} directives
5260 in your RunScript.
5261
5262 \begin{verbatim}
5263 Job {
5264   Name = aJob
5265   RunScript {
5266     Command = "/bin/echo test"
5267     Command = "/bin/echo an other test"
5268     Command = "/bin/echo 3 commands in the same runscript"
5269     RunsWhen = Before
5270   }
5271  ...
5272 }
5273 \end{verbatim}
5274
5275 A new Client RunScript {\bf RunsWhen} keyword of {\bf AfterVSS} has been
5276 implemented, which runs the command after the Volume Shadow Copy has been made.
5277
5278 Console commands can be specified within a RunScript by using:
5279 {\bf Console = \lt{}command\gt{}}, however, this command has not been 
5280 carefully tested and debugged and is known to easily crash the Director.
5281 We would appreciate feedback.  Due to the recursive nature of this command, we
5282 may remove it before the final release.
5283
5284 \subsubsection{Status Enhancements}
5285 \index[general]{Status Enhancements}
5286 The bconsole {\bf status dir} output has been enhanced to indicate
5287 Storage daemon job spooling and despooling activity.
5288
5289 \subsubsection{Connect Timeout}
5290 \index[general]{Connect Timeout}
5291 The default connect timeout to the File
5292 daemon has been set to 3 minutes. Previously it was 30 minutes.
5293
5294 \subsubsection{ftruncate for NFS Volumes}
5295 \index[general]{ftruncate for NFS Volumes}
5296 If you write to a Volume mounted by NFS (say on a local file server),
5297 in previous Bacula versions, when the Volume was recycled, it was not
5298 properly truncated because NFS does not implement ftruncate (file 
5299 truncate). This is now corrected in the new version because we have
5300 written code (actually a kind user) that deletes and recreates the Volume,
5301 thus accomplishing the same thing as a truncate.
5302
5303 \subsubsection{Support for Ubuntu}
5304 The new version of Bacula now recognizes the Ubuntu (and Kubuntu)
5305 version of Linux, and thus now provides correct autostart routines.
5306 Since Ubuntu officially supports Bacula, you can also obtain any
5307 recent release of Bacula from the Ubuntu repositories.
5308
5309 \subsubsection{Recycle Pool = \lt{}pool-name\gt{}}
5310 \index[general]{Recycle Pool}
5311 The new \textbf{RecyclePool} directive defines to which pool the Volume will
5312 be placed (moved) when it is recycled. Without this directive, a Volume will
5313 remain in the same pool when it is recycled. With this directive, it can be
5314 moved automatically to any existing pool during a recycle. This directive is
5315 probably most useful when defined in the Scratch pool, so that volumes will
5316 be recycled back into the Scratch pool.
5317
5318 \subsubsection{FD Version}
5319 \index[general]{FD Version}
5320 The File daemon to Director protocol now includes a version 
5321 number, which although there is no visible change for users, 
5322 will help us in future versions automatically determine
5323 if a File daemon is not compatible.
5324
5325 \subsubsection{Max Run Sched Time = \lt{}time-period-in-seconds\gt{}}
5326 \index[general]{Max Run Sched Time}
5327 The time specifies the maximum allowed time that a job may run, counted from
5328 when the job was scheduled. This can be useful to prevent jobs from running
5329 during working hours. We can see it like \texttt{Max Start Delay + Max Run
5330   Time}.
5331
5332 \subsubsection{Max Wait Time = \lt{}time-period-in-seconds\gt{}}
5333 \index[general]{Max Wait Time}
5334 Previous \textbf{MaxWaitTime} directives aren't working as expected, instead
5335 of checking the maximum allowed time that a job may block for a resource,
5336 those directives worked like \textbf{MaxRunTime}. Some users are reporting to
5337 use \textbf{Incr/Diff/Full Max Wait Time} to control the maximum run time of
5338 their job depending on the level. Now, they have to use
5339 \textbf{Incr/Diff/Full Max Run Time}.  \textbf{Incr/Diff/Full Max Wait Time}
5340 directives are now deprecated.
5341
5342 \subsubsection{Incremental|Differential Max Wait Time = \lt{}time-period-in-seconds\gt{}} 
5343 \index[general]{Incremental Max Wait Time}
5344 \index[general]{Differential Max Wait Time}
5345
5346 These directives have been deprecated in favor of
5347 \texttt{Incremental|Differential Max Run Time}.
5348
5349 \subsubsection{Max Run Time directives}
5350 \index[general]{Max Run Time directives}
5351 Using \textbf{Full/Diff/Incr Max Run Time}, it's now possible to specify the
5352 maximum allowed time that a job can run depending on the level.
5353
5354 \addcontentsline{lof}{figure}{Job time control directives}
5355 \begin{center}
5356 \includegraphics[width=\linewidth]{different_time}
5357 \end{center}
5358
5359 \subsubsection{Statistics Enhancements}
5360 \index[general]{Statistics Enhancements}
5361 If you (or probably your boss) want to have statistics on your backups to
5362 provide some \textit{Service Level Agreement} indicators, you could use a few
5363 SQL queries on the Job table to report how many:
5364
5365 \begin{itemize}
5366 \item jobs have run
5367 \item jobs have been successful
5368 \item files have been backed up
5369 \item ...
5370 \end{itemize}
5371
5372 However, these statistics are accurate only if your job retention is greater
5373 than your statistics period. Ie, if jobs are purged from the catalog, you won't
5374 be able to use them. 
5375
5376 Now, you can use the \textbf{update stats [days=num]} console command to fill
5377 the JobHistory table with new Job records. If you want to be sure to take in
5378 account only \textbf{good jobs}, ie if one of your important job has failed but
5379 you have fixed the problem and restarted it on time, you probably want to
5380 delete the first \textit{bad} job record and keep only the successful one. For
5381 that simply let your staff do the job, and update JobHistory table after two or
5382 three days depending on your organization using the \textbf{[days=num]} option.
5383
5384 These statistics records aren't used for restoring, but mainly for
5385 capacity planning, billings, etc.
5386
5387 The Bweb interface provides a statistics module that can use this feature. You
5388 can also use tools like Talend or extract information by yourself.
5389
5390 The \textbf{Statistics Retention = \lt{}time\gt{}} director directive defines
5391 the length of time that Bacula will keep statistics job records in the Catalog
5392 database after the Job End time. (In \texttt{JobHistory} table) When this time
5393 period expires, and if user runs \texttt{prune stats} command, Bacula will
5394 prune (remove) Job records that are older than the specified period.
5395
5396 You can use the following Job resource in your nightly \textbf{BackupCatalog}
5397 job to maintain statistics.
5398 \begin{verbatim}
5399 Job {
5400   Name = BackupCatalog
5401   ...
5402   RunScript {
5403     Console = "update stats days=3"
5404     Console = "prune stats yes"
5405     RunsWhen = After
5406     RunsOnClient = no
5407   }
5408 }
5409 \end{verbatim}
5410
5411 \subsubsection{ScratchPool = \lt{}pool-resource-name\gt{}}
5412 \index[general]{ScratchPool}
5413 This directive permits to specify a specific \textsl{Scratch} pool for the
5414 current pool. This is useful when using multiple storage sharing the same
5415 mediatype or when you want to dedicate volumes to a particular set of pool.
5416
5417 \subsubsection{Enhanced Attribute Despooling}
5418 \index[general]{Attribute Despooling}
5419 If the storage daemon and the Director are on the same machine, the spool file
5420 that contains attributes is read directly by the Director instead of being
5421 transmitted across the network. That should reduce load and speedup insertion.
5422
5423 \subsubsection{SpoolSize = \lt{}size-specification-in-bytes\gt{}}
5424 \index[general]{SpoolSize}
5425 A new Job directive permits to specify the spool size per job. This is used
5426 in advanced job tunning. {\bf SpoolSize={\it bytes}}
5427
5428 \subsubsection{MaximumConsoleConnections = \lt{}number\gt{}}
5429 \index[general]{MaximumConsoleConnections}
5430 A new director directive permits to specify the maximum number of Console
5431 Connections that could run concurrently. The default is set to 20, but you may
5432 set it to a larger number.
5433
5434 \subsubsection{VerId = \lt{}string\gt{}}
5435 \index[general]{VerId}
5436 A new director directive permits to specify a personnal identifier that will be
5437 displayed in the \texttt{version} command.
5438
5439 \subsubsection{dbcheck enhancements}
5440 \index[general]{dbcheck enhancements}
5441 If you are using Mysql, dbcheck will now ask you if you want to create
5442 temporary indexes to speed up orphaned Path and Filename elimination. 
5443
5444 A new \texttt{-B} option allows you to print catalog information in a simple
5445 text based format. This is useful to backup it in a secure way.
5446
5447 \begin{verbatim}
5448  $ dbcheck -B 
5449  catalog=MyCatalog
5450  db_type=SQLite
5451  db_name=regress
5452  db_driver=
5453  db_user=regress
5454  db_password=
5455  db_address=
5456  db_port=0
5457  db_socket=
5458 \end{verbatim} %$
5459
5460 You can now specify the database connection port in the command line.
5461
5462 \subsubsection{{-}{-}docdir configure option}
5463 \index[general]{{-}{-}docdir configure option}
5464 You can use {-}{-}docdir= on the ./configure command to
5465 specify the directory where you want Bacula to install the
5466 LICENSE, ReleaseNotes, ChangeLog, ... files.   The default is 
5467 {\bf /usr/share/doc/bacula}.
5468       
5469 \subsubsection{{-}{-}htmldir configure option}
5470 \index[general]{{-}{-}htmldir configure option}
5471 You can use {-}{-}htmldir= on the ./configure command to
5472 specify the directory where you want Bacula to install the bat html help
5473 files. The default is {\bf /usr/share/doc/bacula/html}
5474
5475 \subsubsection{{-}{-}with-plugindir configure option}
5476 \index[general]{{-}{-}plugindir configure option}
5477 You can use {-}{-}plugindir= on the ./configure command to
5478 specify the directory where you want Bacula to install
5479 the plugins (currently only bpipe-fd). The default is
5480 /usr/lib.