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