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