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