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