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