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