]> git.sur5r.net Git - bacula/docs/blob - docs/manuals/en/main/newfeatures.tex
e00ff47a6f506ad74267621ebb95ae7b5337b6fa
[bacula/docs] / docs / manuals / en / main / newfeatures.tex
1 \chapter{New Features in 5.0.1}
2
3 This chapter presents the new features that are in the released Bacula version
4 5.0.1. This version mainly fixes a number of bugs found in version 5.0.0 during
5 the onging development process.
6
7 \section{Truncate volume after purge}
8 \label{sec:actiononpurge}
9
10 The Pool directive \textbf{ActionOnPurge=Truncate} instructs Bacula to truncate
11 the volume when it is purged with the new command \texttt{purge volume
12   action}.It is useful to prevent disk based volumes from consuming too much
13 space.
14
15 \begin{verbatim}
16 Pool {
17   Name = Default
18   Action On Purge = Truncate
19   ...
20 }
21 \end{verbatim}
22
23 As usual You can also set this property with the \texttt{update volume} command
24 \begin{verbatim}
25 *update volume=xxx actiononpurge=Truncate
26 *update volume=xxx actiononpurge=None
27 \end{verbatim}
28
29 To ask Bacula to truncate your \texttt{Purged} volumes, you need to use the
30 following command in interactive mode or in a RunScript as shown after:
31 \begin{verbatim}
32 *purge volume action=truncate storage=File allpools
33 # or by default, action=all
34 *purge volume action storage=File pool=Default
35 \end{verbatim}
36
37 This is possible to specify the volume name, the media type, the pool, the
38 storage, etc\dots (see \texttt{help purge}) Be sure that your storage device is
39 idle when you decide to run this command.
40
41 \begin{verbatim}
42 Job {
43  Name = CatalogBackup
44  ...
45  RunScript {
46    RunsWhen=After
47    RunsOnClient=No
48    Console = "purge volume action=all allpools storage=File"
49  }
50 }
51 \end{verbatim}
52
53 \textbf{Important note}: This feature doesn't work as
54 expected in version 5.0.0. Please do not use it before version 5.0.1.
55
56 \chapter{New Features in 5.0.0}
57
58 \section{Maximum Concurent Jobs for Devices}
59 \label{sec:maximumconcurentjobdevice}
60
61 {\bf Maximum Concurrent Jobs} is a new Device directive in the Storage
62 Daemon configuration permits setting the maximum number of Jobs that can
63 run concurrently on a specified Device.  Using this directive, it is
64 possible to have different Jobs using multiple drives, because when the
65 Maximum Concurrent Jobs limit is reached, the Storage Daemon will start new
66 Jobs on any other available compatible drive.  This facilitates writing to
67 multiple drives with multiple Jobs that all use the same Pool.
68
69 This project was funded by Bacula Systems.
70
71 \section{Restore from Multiple Storage Daemons}
72 \index[general]{Restore}
73
74 Previously, you were able to restore from multiple devices in a single Storage
75 Daemon. Now, Bacula is able to restore from multiple Storage Daemons. For
76 example, if your full backup runs on a Storage Daemon with an autochanger, and
77 your incremental jobs use another Storage Daemon with lots of disks, Bacula
78 will switch automatically from one Storage Daemon to an other within the same
79 Restore job.
80
81 You must upgrade your File Daemon to version 3.1.3 or greater to use this
82 feature.
83
84 This project was funded by Bacula Systems with the help of Equiinet.
85
86 \section{File Deduplication using Base Jobs}
87 A base job is sort of like a Full save except that you will want the FileSet to
88 contain only files that are unlikely to change in the future (i.e.  a snapshot
89 of most of your system after installing it).  After the base job has been run,
90 when you are doing a Full save, you specify one or more Base jobs to be used.
91 All files that have been backed up in the Base job/jobs but not modified will
92 then be excluded from the backup.  During a restore, the Base jobs will be
93 automatically pulled in where necessary.
94
95 This is something none of the competition does, as far as we know (except
96 perhaps BackupPC, which is a Perl program that saves to disk only).  It is big
97 win for the user, it makes Bacula stand out as offering a unique optimization
98 that immediately saves time and money.  Basically, imagine that you have 100
99 nearly identical Windows or Linux machine containing the OS and user files.
100 Now for the OS part, a Base job will be backed up once, and rather than making
101 100 copies of the OS, there will be only one.  If one or more of the systems
102 have some files updated, no problem, they will be automatically restored.
103
104 A new Job directive \texttt{Base=Jobx, Joby...} permits to specify the list of
105 files that will be used during Full backup as base.
106
107 \begin{verbatim}
108 Job {
109    Name = BackupLinux
110    Level= Base
111    ...
112 }
113
114 Job {
115    Name = BackupZog4
116    Base = BackupZog4, BackupLinux
117    Accurate = yes
118    ...
119 }
120 \end{verbatim}
121
122 In this example, the job \texttt{BackupZog4} will use the most recent version
123 of all files contained in \texttt{BackupZog4} and \texttt{BackupLinux}
124 jobs. Base jobs should have run with \texttt{level=Base} to be used.
125
126 By default, Bacula will compare permissions bits, user and group fields,
127 modification time, size and the checksum of the file to choose between the
128 current backup and the BaseJob file list. You can change this behavior with the
129 \texttt{BaseJob} FileSet option. This option works like the \texttt{verify=}
130 one, that is described in the \ilink{FileSet}{FileSetResource} chapter.
131
132 \begin{verbatim}
133 FileSet {
134   Name = Full
135   Include = {
136     Options {
137        BaseJob  = pmugcs5
138        Accurate = mcs5
139        Verify   = pin5
140     }
141     File = /
142   }
143 }
144 \end{verbatim}
145
146 \textbf{Important note}: The current implementation doesn't permit to scan
147 volume with \textbf{bscan}. The result wouldn't permit to restore files easily.
148
149 This project was funded by Bacula Systems.
150
151 \section{AllowCompression = \lt{}yes\vb{}no\gt{}}
152 \index[dir]{AllowCompression}
153
154 This new directive may be added to Storage resource within the Director's
155 configuration to allow users to selectively disable the client compression for
156 any job which writes to this storage resource.
157
158 For example:
159 \begin{verbatim}
160 Storage {
161   Name = UltriumTape
162   Address = ultrium-tape
163   Password = storage_password # Password for Storage Daemon
164   Device = Ultrium
165   Media Type = LTO 3
166   AllowCompression = No # Tape drive has hardware compression
167 }
168 \end{verbatim}
169 The above example would cause any jobs running with the UltriumTape storage
170 resource to run without compression from the client file daemons.  This
171 effectively overrides any compression settings defined at the FileSet level.
172
173 This feature is probably most useful if you have a tape drive which supports
174 hardware compression.  By setting the \texttt{AllowCompression = No} directive
175 for your tape drive storage resource, you can avoid additional load on the file
176 daemon and possibly speed up tape backups.
177
178 This project was funded by Collaborative Fusion, Inc.
179
180 \section{Accurate Fileset Options}
181 \label{sec:accuratefileset}
182
183 In previous versions, the accurate code used the file creation and modification
184 times to determine if a file was modified or not. Now you can specify which
185 attributes to use (time, size, checksum, permission, owner, group, \dots),
186 similar to the Verify options.
187
188 \begin{verbatim}
189 FileSet {
190   Name = Full
191   Include = {
192     Options {
193        Accurate = mcs5
194        Verify   = pin5
195     }
196     File = /
197   }
198 }
199 \end{verbatim}
200
201 \begin{description}  
202 \item {\bf i}  compare the inodes  
203 \item {\bf p}  compare the permission bits  
204 \item {\bf n}  compare the number of links  
205 \item {\bf u}  compare the user id  
206 \item {\bf g}  compare the group id  
207 \item {\bf s}  compare the size  
208 \item {\bf a}  compare the access time  
209 \item {\bf m}  compare the modification time (st\_mtime)  
210 \item {\bf c}  compare the change time (st\_ctime)  
211 \item {\bf d}  report file size decreases  
212 \item {\bf 5}  compare the MD5 signature  
213 \item {\bf 1}  compare the SHA1 signature  
214 \end{description}
215
216 \textbf{Important note:} If you decide to use checksum in Accurate jobs,
217 the File Daemon will have to read all files even if they normally would not
218 be saved.  This increases the I/O load, but also the accuracy of the
219 deduplication.  By default, Bacula will check modification/creation time
220 and size.
221
222 This project was funded by Bacula Systems.
223
224 \section{Tab-completion for Bconsole}
225 \label{sec:tabcompletion}
226
227 If you build \texttt{bconsole} with readline support, you will be able to use
228 the new auto-completion mode. This mode supports all commands, gives help
229 inside command, and lists resources when required. It works also in the restore
230 mode.
231
232 To use this feature, you should have readline development package loaded on
233 your system, and use the following option in configure.
234 \begin{verbatim}
235 ./configure --with-readline=/usr/include/readline --disable-conio ...
236 \end{verbatim}
237
238 The new bconsole won't be able to tab-complete with older directors.
239
240 This project was funded by Bacula Systems.
241
242 \section{Pool File and Job retention}
243 \label{sec:poolfilejobretention}
244
245 % TODO check
246 We added two new Pool directives, \texttt{FileRetention} and
247 \texttt{JobRetention}, that take precedence over Client directives of the same
248 name. It allows you to control the Catalog pruning algorithm Pool by Pool. For
249 example, you can decide to increase Retention times for Archive or OffSite Pool.
250
251 \section{Read-only File Daemon using capabilities}
252 \label{sec:fdreadonly}
253 This feature implements support of keeping \textbf{ReadAll} capabilities after
254 UID/GID switch, this allows FD to keep root read but drop write permission.
255
256 It introduces new \texttt{bacula-fd} option (\texttt{-k}) specifying that
257 \textbf{ReadAll} capabilities should be kept after UID/GID switch.
258
259 \begin{verbatim}
260 root@localhost:~# bacula-fd -k -u nobody -g nobody
261 \end{verbatim}
262
263 The code for this feature was contributed by AltLinux.
264
265 \section{Bvfs API}
266 \label{sec:bvfs}
267
268 To help developers of restore GUI interfaces, we have added new \textsl{dot
269   commands} that permit browsing the catalog in a very simple way.
270
271 \begin{itemize}
272 \item \texttt{.bvfs\_update [jobid=x,y,z]} This command is required to update
273   the Bvfs cache in the catalog. You need to run it before any access to the
274   Bvfs layer.
275
276 \item \texttt{.bvfs\_lsdirs jobid=x,y,z path=/path | pathid=101} This command
277   will list all directories in the specified \texttt{path} or
278   \texttt{pathid}. Using \texttt{pathid} avoids problems with character
279   encoding of path/filenames.
280
281 \item \texttt{.bvfs\_lsfiles jobid=x,y,z path=/path | pathid=101} This command
282   will list all files in the specified \texttt{path} or \texttt{pathid}. Using
283   \texttt{pathid} avoids problems with character encoding.
284 \end{itemize}
285
286 You can use \texttt{limit=xxx} and \texttt{offset=yyy} to limit the amount of
287 data that will be displayed.
288
289 \begin{verbatim}
290 * .bvfs_update jobid=1,2
291 * .bvfs_update
292 * .bvfs_lsdir path=/ jobid=1,2
293 \end{verbatim}
294
295 This project was funded by Bacula Systems.
296
297 \section{Testing your Tape Drive}
298 \label{sec:btapespeed}
299
300 To determine the best configuration of your tape drive, you can run the new
301 \texttt{speed} command available in the \texttt{btape} program.
302
303 This command can have the following arguments:
304 \begin{itemize}
305 \item[\texttt{file\_size=n}] Specify the Maximum File Size for this test
306   (between 1 and 5GB). This counter is in GB.
307 \item[\texttt{nb\_file=n}] Specify the number of file to be written. The amount
308   of data should be greater than your memory ($file\_size*nb\_file$).
309 \item[\texttt{skip\_zero}] This flag permits to skip tests with constant
310   data.
311 \item[\texttt{skip\_random}] This flag permits to skip tests with random
312   data.
313 \item[\texttt{skip\_raw}] This flag permits to skip tests with raw access.
314 \item[\texttt{skip\_block}] This flag permits to skip tests with Bacula block
315   access.
316 \end{itemize}
317
318 \begin{verbatim}
319 *speed file_size=3 skip_raw
320 btape.c:1078 Test with zero data and bacula block structure.
321 btape.c:956 Begin writing 3 files of 3.221 GB with blocks of 129024 bytes.
322 ++++++++++++++++++++++++++++++++++++++++++
323 btape.c:604 Wrote 1 EOF to "Drive-0" (/dev/nst0)
324 btape.c:406 Volume bytes=3.221 GB. Write rate = 44.128 MB/s
325 ...
326 btape.c:383 Total Volume bytes=9.664 GB. Total Write rate = 43.531 MB/s
327
328 btape.c:1090 Test with random data, should give the minimum throughput.
329 btape.c:956 Begin writing 3 files of 3.221 GB with blocks of 129024 bytes.
330 +++++++++++++++++++++++++++++++++++++++++++
331 btape.c:604 Wrote 1 EOF to "Drive-0" (/dev/nst0)
332 btape.c:406 Volume bytes=3.221 GB. Write rate = 7.271 MB/s
333 +++++++++++++++++++++++++++++++++++++++++++
334 ...
335 btape.c:383 Total Volume bytes=9.664 GB. Total Write rate = 7.365 MB/s
336
337 \end{verbatim}
338
339 When using compression, the random test will give your the minimum throughput
340 of your drive . The test using constant string will give you the maximum speed
341 of your hardware chain. (cpu, memory, scsi card, cable, drive, tape).
342
343 You can change the block size in the Storage Daemon configuration file.
344
345 \section{New {\bf Block Checksum} Device Directive}
346 You may now turn off the Block Checksum (CRC32) code
347 that Bacula uses when writing blocks to a Volume.  This is
348 done by adding:
349
350 \begin{verbatim}
351 Block Checksum = no
352 \end{verbatim}
353
354 doing so can reduce the Storage daemon CPU usage slightly.  It
355 will also permit Bacula to read a Volume that has corrupted data.
356
357 The default is {\bf yes} -- i.e. the checksum is computed on write
358 and checked on read. 
359
360 We do not recommend to turn this off particularly on older tape
361 drives or for disk Volumes where doing so may allow corrupted data
362 to go undetected.
363
364 \section{New Bat Features}
365
366 Those new features were funded by Bacula Systems.
367
368 \subsection{Media List View}
369
370 By clicking on ``Media'', you can see the list of all your volumes. You will be
371 able to filter by Pool, Media Type, Location,\dots And sort the result directly
372 in the table. The old ``Media'' view is now known as ``Pool''.
373 \begin{figure}[htbp]
374   \centering
375   \includegraphics[width=13cm]{\idir bat-mediaview.eps}
376   \label{fig:mediaview}
377 \end{figure}
378
379
380 \subsection{Media Information View}
381
382 By double-clicking on a volume (on the Media list, in the Autochanger content
383 or in the Job information panel), you can access a detailed overview of your
384 Volume. (cf \ref{fig:mediainfo}.)
385 \begin{figure}[htbp]
386   \centering
387   \includegraphics[width=13cm]{\idir bat11.eps}  
388   \caption{Media information}
389   \label{fig:mediainfo}
390 \end{figure}
391
392 \subsection{Job Information View}
393
394 By double-clicking on a Job record (on the Job run list or in the Media
395 information panel), you can access a detailed overview of your Job. (cf
396 \ref{fig:jobinfo}.)
397 \begin{figure}[htbp]
398   \centering
399   \includegraphics[width=13cm]{\idir bat12.eps}  
400   \caption{Job information}
401   \label{fig:jobinfo}
402 \end{figure}
403
404 \subsection{Autochanger Content View}
405
406 By double-clicking on a Storage record (on the Storage list panel), you can
407 access a detailed overview of your Autochanger. (cf \ref{fig:jobinfo}.)
408 \begin{figure}[htbp]
409   \centering
410   \includegraphics[width=13cm]{\idir bat13.eps}  
411   \caption{Autochanger content}
412   \label{fig:achcontent}
413 \end{figure}
414
415 To use this feature, you need to use the latest mtx-changer script
416 version. (With new \texttt{listall} and \texttt{transfer} commands)
417
418 \section{Bat on Windows}
419 We have ported {\bf bat} to Windows and it is now installed 
420 by default when the installer is run.  It works quite well 
421 on Win32, but has not had a lot of testing there, so your
422 feedback would be welcome.  Unfortunately, eventhough it is
423 installed by default, it does not yet work on 64 bit Windows
424 operating systems.
425
426 \section{New Win32 Installer}
427 The Win32 installer has been modified in several very important
428 ways.  
429 \begin{itemize}
430 \item You must deinstall any current version of the
431 Win32 File daemon before upgrading to the new one. 
432 If you forget to do so, the new installation will fail.
433 To correct this failure, you must manually shutdown 
434 and deinstall the old File daemon. 
435 \item All files (other than menu links) are installed
436 in {\bf c:/Program Files/Bacula}.  
437 \item The installer no longer sets this
438 file to require administrator privileges by default. If you want
439 to do so, please do it manually using the {\bf cacls} program.
440 For example:
441 \begin{verbatim}
442 cacls "C:\Program Files\Bacula" /T /G SYSTEM:F Administrators:F
443 \end{verbatim}
444 \item The server daemons (Director and Storage daemon) are
445 no longer included in the Windows installer.  If you want the
446 Windows servers, you will either need to build them yourself (note
447 they have not been ported to 64 bits), or you can contact 
448 Bacula Systems about this.
449 \end{itemize}
450
451 \section{Win64 Installer}
452 We have corrected a number of problems that required manual
453 editing of the conf files.  In most cases, it should now
454 install and work.  {\bf bat} is by default installed in
455 {\bf c:/Program Files/Bacula/bin32} rather than
456 {\bf c:/Program Files/Bacula} as is the case with the 32
457 bit Windows installer.
458
459 \section{Bare Metal Recovery USB Key}
460 We have made a number of significant improvements in the
461 Bare Metal Recovery USB key.  Please see the README files
462 it the {\bf rescue} release for more details.
463
464
465
466 \section{bconsole Timeout Option}
467 You can now use the -u option of {\bf bconsole} to set a timeout in seconds
468 for commands. This is useful with GUI programs that use {\bf bconsole}
469 to interface to the Director.
470
471 \section{Important Changes}
472 \label{sec:importantchanges}
473
474 \begin{itemize}
475 \item You are now allowed to Migrate, Copy, and Virtual Full to read and write
476   to the same Pool. The Storage daemon ensures that you do not read and
477   write to the same Volume.
478 \item The \texttt{Device Poll Interval} is now 5 minutes. (previously did not
479   poll by default).
480 \item The new \texttt{mtx-changer} script has two new options, \texttt{listall}
481   and \texttt{transfer}. Be sure to apply any custom changes on to the 
482   mtx-changer script, or better yet, use mtx-changer.conf to configure
483   them.
484 \item To enhance security of the \texttt{BackupCatalog} job, we provide a new
485   script (\texttt{make\_catalog\_backup.pl}) that does not expose your catalog
486   password. If you want to use the new script, you will need to 
487   manually change the \texttt{BackupCatalog} Job definition.
488 \item The \texttt{bconsole} \texttt{help} command now accepts
489   an argument, which if provided produces information on that
490   command (ex: \texttt{help run}).
491 \end{itemize}
492
493 \subsection{Custom Catalog queries}
494
495 If you wish to add specialized commands that list the contents of the catalog,
496 you can do so by adding them to the \texttt{query.sql} file. This
497 \texttt{query.sql} file is now empty by default.  The file
498 \texttt{examples/sample-query.sql} has an a number of sample commands
499 you might find useful.
500
501 \subsection{Deprecated parts}
502
503 The following items have been \textbf{deprecated} for a long time, and are now
504 removed from the code.
505 \begin{itemize}
506 \item Gnome console
507 \item Support for SQLite 2
508 \end{itemize}
509
510 \section{Misc Changes}
511 \label{sec:miscchanges}
512
513 \begin{itemize}
514 \item Updated Nagios check\_bacula
515 \item Updated man files
516 \item Added OSX package generation script in platforms/darwin
517 \item Added Spanish and Ukrainian Bacula translations
518 \item Enable/disable command shows only Jobs that can change
519 \item Added \texttt{show disabled} command to show disabled Jobs
520 \item Many ACL improvements
521 \item Added Level to FD status Job output
522 \item Begin Ingres DB driver (not yet working)
523 \item Split RedHat spec files into bacula, bat, mtx, and docs
524 \item Reorganized the manuals (fewer separate manuals)
525 \item Added lock/unlock order protection in lock manager
526 \item Allow 64 bit sizes for a number of variables
527 \item Fixed several deadlocks or potential race conditions in the SD
528 \end{itemize}
529
530 \chapter{Released Version 3.0.3 and 3.0.3a}
531
532 There are no new features in version 3.0.3.  This version simply fixes a
533 number of bugs found in version 3.0.2 during the onging development
534 process.
535
536 \chapter{New Features in Released Version 3.0.2}
537
538 This chapter presents the new features added to the
539 Released Bacula Version 3.0.2.
540
541 \section{Full Restore from a Given JobId}
542 \index[general]{Restore menu}
543
544 This feature allows selecting a single JobId and having Bacula
545 automatically select all the other jobs that comprise a full backup up to
546 and including the selected date (through JobId).
547
548 Assume we start with the following jobs:
549 \begin{verbatim}
550 +-------+--------------+---------------------+-------+----------+------------+
551 | jobid | client       | starttime           | level | jobfiles | jobbytes   |
552 +-------+--------------+---------------------+-------+----------+------------
553 | 6     | localhost-fd | 2009-07-15 11:45:49 | I     | 2        | 0          |
554 | 5     | localhost-fd | 2009-07-15 11:45:45 | I     | 15       | 44143      |
555 | 3     | localhost-fd | 2009-07-15 11:45:38 | I     | 1        | 10         |
556 | 1     | localhost-fd | 2009-07-15 11:45:30 | F     | 1527     | 44143073   |
557 +-------+--------------+---------------------+-------+----------+------------+
558 \end{verbatim}
559
560 Below is an example of this new feature (which is number 12 in the
561 menu).
562
563 \begin{verbatim}
564 * restore
565 To select the JobIds, you have the following choices:
566      1: List last 20 Jobs run
567      2: List Jobs where a given File is saved
568 ...
569     12: Select full restore to a specified Job date
570     13: Cancel
571
572 Select item:  (1-13): 12
573 Enter JobId to get the state to restore: 5
574 Selecting jobs to build the Full state at 2009-07-15 11:45:45
575 You have selected the following JobIds: 1,3,5
576
577 Building directory tree for JobId(s) 1,3,5 ...  +++++++++++++++++++
578 1,444 files inserted into the tree.
579 \end{verbatim}
580
581 This project was funded by Bacula Systems.
582
583 \section{Source Address}
584 \index[general]{Source Address}
585
586 A feature has been added which allows the administrator to specify the address
587 from which the Director and File daemons will establish connections.  This
588 may be used to simplify system configuration overhead when working in complex
589 networks utilizing multi-homing and policy-routing.
590
591 To accomplish this, two new configuration directives have been implemented:
592 \begin{verbatim}
593 FileDaemon {
594   FDSourceAddress=10.0.1.20    # Always initiate connections from this address
595 }
596
597 Director {
598   DirSourceAddress=10.0.1.10   # Always initiate connections from this address
599 }
600 \end{verbatim}
601
602 Simply adding specific host routes on the OS
603 would have an undesirable side-effect: any
604 application trying to contact the destination host would be forced to use the
605 more specific route possibly diverting management traffic onto a backup VLAN.
606 Instead of adding host routes for each client connected to a multi-homed backup
607 server (for example where there are management and backup VLANs), one can
608 use the new directives to specify a specific source address at the application
609 level.
610
611 Additionally, this allows the simplification and abstraction of firewall rules
612 when dealing with a Hot-Standby director or storage daemon configuration.  The
613 Hot-standby pair may share a CARP address, which connections must be sourced
614 from, while system services listen and act from the unique interface addresses.
615
616 This project was funded by Collaborative Fusion, Inc.
617
618 \section{Show volume availability when doing restore}
619
620 When doing a restore the selection dialog ends by displaying this
621 screen:
622
623 \begin{verbatim}
624   The job will require the following
625    Volume(s)                 Storage(s)                SD Device(s)
626    ===========================================================================
627    *000741L3                  LTO-4                     LTO3 
628    *000866L3                  LTO-4                     LTO3 
629    *000765L3                  LTO-4                     LTO3 
630    *000764L3                  LTO-4                     LTO3 
631    *000756L3                  LTO-4                     LTO3 
632    *001759L3                  LTO-4                     LTO3 
633    *001763L3                  LTO-4                     LTO3 
634     001762L3                  LTO-4                     LTO3 
635     001767L3                  LTO-4                     LTO3 
636
637 Volumes marked with ``*'' are online (in the autochanger).
638 \end{verbatim}
639
640 This should help speed up large restores by minimizing the time spent
641 waiting for the operator to discover that he must change tapes in the library.
642
643 This project was funded by Bacula Systems.
644
645 \section{Accurate estimate command}
646
647 The \texttt{estimate} command can now use the accurate code to detect changes
648 and give a better estimation.
649
650 You can set the accurate behavior on the command line by using
651 \texttt{accurate=yes\vb{}no} or use the Job setting as default value.
652
653 \begin{verbatim}
654 * estimate listing accurate=yes level=incremental job=BackupJob
655 \end{verbatim}
656
657 This project was funded by Bacula Systems.
658
659 \chapter{New Features in 3.0.0}
660 \label{NewFeaturesChapter}
661 \index[general]{New Features}
662
663 This chapter presents the new features added to the development 2.5.x
664 versions to be released as Bacula version 3.0.0 sometime in April 2009.
665
666 \section{Accurate Backup}
667 \index[general]{Accurate Backup}
668
669 As with most other backup programs, by default Bacula decides what files to
670 backup for Incremental and Differental backup by comparing the change
671 (st\_ctime) and modification (st\_mtime) times of the file to the time the last
672 backup completed.  If one of those two times is later than the last backup
673 time, then the file will be backed up.  This does not, however, permit tracking
674 what files have been deleted and will miss any file with an old time that may
675 have been restored to or moved onto the client filesystem.
676
677 \subsection{Accurate = \lt{}yes\vb{}no\gt{}}
678 If the {\bf Accurate = \lt{}yes\vb{}no\gt{}} directive is enabled (default no) in
679 the Job resource, the job will be run as an Accurate Job. For a {\bf Full}
680 backup, there is no difference, but for {\bf Differential} and {\bf
681   Incremental} backups, the Director will send a list of all previous files
682 backed up, and the File daemon will use that list to determine if any new files
683 have been added or or moved and if any files have been deleted. This allows
684 Bacula to make an accurate backup of your system to that point in time so that
685 if you do a restore, it will restore your system exactly.  
686
687 One note of caution
688 about using Accurate backup is that it requires more resources (CPU and memory)
689 on both the Director and the Client machines to create the list of previous
690 files backed up, to send that list to the File daemon, for the File daemon to
691 keep the list (possibly very big) in memory, and for the File daemon to do
692 comparisons between every file in the FileSet and the list.  In particular,
693 if your client has lots of files (more than a few million), you will need
694 lots of memory on the client machine.
695
696 Accurate must not be enabled when backing up with a plugin that is not
697 specially designed to work with Accurate. If you enable it, your restores
698 will probably not work correctly.
699
700 This project was funded by Bacula Systems.
701                                        
702
703
704 \section{Copy Jobs}
705 \index[general]{Copy Jobs}
706
707 A new {\bf Copy} job type 'C' has been implemented. It is similar to the
708 existing Migration feature with the exception that the Job that is copied is
709 left unchanged.  This essentially creates two identical copies of the same
710 backup. However, the copy is treated as a copy rather than a backup job, and
711 hence is not directly available for restore.  The {\bf restore} command lists
712 copy jobs and allows selection of copies by using \texttt{jobid=}
713 option. If the keyword {\bf copies} is present on the command line, Bacula will
714 display the list of all copies for selected jobs.
715
716 \begin{verbatim}
717 * restore copies
718 [...]
719 These JobIds have copies as follows:
720 +-------+------------------------------------+-----------+------------------+
721 | JobId | Job                                | CopyJobId | MediaType        |
722 +-------+------------------------------------+-----------+------------------+
723 | 2     | CopyJobSave.2009-02-17_16.31.00.11 | 7         | DiskChangerMedia |
724 +-------+------------------------------------+-----------+------------------+
725 +-------+-------+----------+----------+---------------------+------------------+
726 | JobId | Level | JobFiles | JobBytes | StartTime           | VolumeName       |
727 +-------+-------+----------+----------+---------------------+------------------+
728 | 19    | F     | 6274     | 76565018 | 2009-02-17 16:30:45 | ChangerVolume002 |
729 | 2     | I     | 1        | 5        | 2009-02-17 16:30:51 | FileVolume001    |
730 +-------+-------+----------+----------+---------------------+------------------+
731 You have selected the following JobIds: 19,2
732
733 Building directory tree for JobId(s) 19,2 ...  ++++++++++++++++++++++++++++++++++++++++++++
734 5,611 files inserted into the tree.
735 ...
736 \end{verbatim}
737
738
739 The Copy Job runs without using the File daemon by copying the data from the
740 old backup Volume to a different Volume in a different Pool. See the Migration
741 documentation for additional details. For copy Jobs there is a new selection
742 directive named {\bf PoolUncopiedJobs} which selects all Jobs that were
743 not already copied to another Pool. 
744
745 As with Migration, the Client, Volume, Job, or SQL query, are
746 other possible ways of selecting the Jobs to be copied. Selection
747 types like SmallestVolume, OldestVolume, PoolOccupancy and PoolTime also
748 work, but are probably more suited for Migration Jobs. 
749
750 If Bacula finds a Copy of a job record that is purged (deleted) from the catalog,
751 it will promote the Copy to a \textsl{real} backup job and will make it available for
752 automatic restore. If more than one Copy is available, it will promote the copy
753 with the smallest JobId.
754
755 A nice solution which can be built with the new Copy feature is often
756 called disk-to-disk-to-tape backup (DTDTT). A sample config could
757 look something like the one below:
758
759 \begin{verbatim}
760 Pool {
761   Name = FullBackupsVirtualPool
762   Pool Type = Backup
763   Purge Oldest Volume = Yes
764   Storage = vtl
765   NextPool = FullBackupsTapePool
766 }
767
768 Pool {
769   Name = FullBackupsTapePool
770   Pool Type = Backup
771   Recycle = Yes
772   AutoPrune = Yes
773   Volume Retention = 365 days
774   Storage = superloader
775 }
776
777 #
778 # Fake fileset for copy jobs
779 #
780 Fileset {
781   Name = None
782   Include {
783     Options {
784       signature = MD5
785     }
786   }
787 }
788
789 #
790 # Fake client for copy jobs
791 #
792 Client {
793   Name = None
794   Address = localhost
795   Password = "NoNe"
796   Catalog = MyCatalog
797 }
798
799 #
800 # Default template for a CopyDiskToTape Job
801 #
802 JobDefs {
803   Name = CopyDiskToTape
804   Type = Copy
805   Messages = StandardCopy
806   Client = None
807   FileSet = None
808   Selection Type = PoolUncopiedJobs
809   Maximum Concurrent Jobs = 10
810   SpoolData = No
811   Allow Duplicate Jobs = Yes
812   Allow Higher Duplicates = No
813   Cancel Queued Duplicates = No
814   Cancel Running Duplicates = No
815   Priority = 13
816 }
817
818 Schedule {
819    Name = DaySchedule7:00
820    Run = Level=Full daily at 7:00
821 }
822
823 Job {
824   Name = CopyDiskToTapeFullBackups
825   Enabled = Yes
826   Schedule = DaySchedule7:00
827   Pool = FullBackupsVirtualPool
828   JobDefs = CopyDiskToTape
829 }
830 \end{verbatim}
831
832 The example above had 2 pool which are copied using the PoolUncopiedJobs
833 selection criteria. Normal Full backups go to the Virtual pool and are copied
834 to the Tape pool the next morning.
835
836 The command \texttt{list copies [jobid=x,y,z]} lists copies for a given
837 \textbf{jobid}.
838
839 \begin{verbatim}
840 *list copies
841 +-------+------------------------------------+-----------+------------------+
842 | JobId | Job                                | CopyJobId | MediaType        |
843 +-------+------------------------------------+-----------+------------------+
844 |     9 | CopyJobSave.2008-12-20_22.26.49.05 |        11 | DiskChangerMedia |
845 +-------+------------------------------------+-----------+------------------+
846 \end{verbatim}
847
848 \section{ACL Updates}
849 \index[general]{ACL Updates}
850 The whole ACL code had been overhauled and in this version each platforms has
851 different streams for each type of acl available on such an platform. As ACLs
852 between platforms tend to be not that portable (most implement POSIX acls but
853 some use an other draft or a completely different format) we currently only
854 allow certain platform specific ACL streams to be decoded and restored on the
855 same platform that they were created on.  The old code allowed to restore ACL
856 cross platform but the comments already mention that not being to wise. For
857 backward compatability the new code will accept the two old ACL streams and
858 handle those with the platform specific handler. But for all new backups it
859 will save the ACLs using the new streams.
860
861 Currently the following platforms support ACLs:
862
863 \begin{itemize}
864  \item {\bf AIX}
865  \item {\bf Darwin/OSX}
866  \item {\bf FreeBSD}
867  \item {\bf HPUX}
868  \item {\bf IRIX}
869  \item {\bf Linux}
870  \item {\bf Tru64}
871  \item {\bf Solaris}
872 \end{itemize}
873
874 Currently we support the following ACL types (these ACL streams use a reserved
875 part of the stream numbers):
876
877 \begin{itemize}
878 \item {\bf STREAM\_ACL\_AIX\_TEXT} 1000 AIX specific string representation from
879   acl\_get
880  \item {\bf STREAM\_ACL\_DARWIN\_ACCESS\_ACL} 1001 Darwin (OSX) specific acl\_t
881    string representation from acl\_to\_text (POSIX acl)
882   \item {\bf STREAM\_ACL\_FREEBSD\_DEFAULT\_ACL} 1002 FreeBSD specific acl\_t
883     string representation from acl\_to\_text (POSIX acl) for default acls.
884   \item {\bf STREAM\_ACL\_FREEBSD\_ACCESS\_ACL} 1003 FreeBSD specific acl\_t
885     string representation from acl\_to\_text (POSIX acl) for access acls.
886   \item {\bf STREAM\_ACL\_HPUX\_ACL\_ENTRY} 1004 HPUX specific acl\_entry
887     string representation from acltostr (POSIX acl)
888   \item {\bf STREAM\_ACL\_IRIX\_DEFAULT\_ACL} 1005 IRIX specific acl\_t string
889     representation from acl\_to\_text (POSIX acl) for default acls.
890   \item {\bf STREAM\_ACL\_IRIX\_ACCESS\_ACL} 1006 IRIX specific acl\_t string
891     representation from acl\_to\_text (POSIX acl) for access acls.
892   \item {\bf STREAM\_ACL\_LINUX\_DEFAULT\_ACL} 1007 Linux specific acl\_t
893     string representation from acl\_to\_text (POSIX acl) for default acls.
894   \item {\bf STREAM\_ACL\_LINUX\_ACCESS\_ACL} 1008 Linux specific acl\_t string
895     representation from acl\_to\_text (POSIX acl) for access acls.
896   \item {\bf STREAM\_ACL\_TRU64\_DEFAULT\_ACL} 1009 Tru64 specific acl\_t
897     string representation from acl\_to\_text (POSIX acl) for default acls.
898   \item {\bf STREAM\_ACL\_TRU64\_DEFAULT\_DIR\_ACL} 1010 Tru64 specific acl\_t
899     string representation from acl\_to\_text (POSIX acl) for default acls.
900   \item {\bf STREAM\_ACL\_TRU64\_ACCESS\_ACL} 1011 Tru64 specific acl\_t string
901     representation from acl\_to\_text (POSIX acl) for access acls.
902   \item {\bf STREAM\_ACL\_SOLARIS\_ACLENT} 1012 Solaris specific aclent\_t
903     string representation from acltotext or acl\_totext (POSIX acl)
904   \item {\bf STREAM\_ACL\_SOLARIS\_ACE} 1013 Solaris specific ace\_t string
905     representation from from acl\_totext (NFSv4 or ZFS acl)
906 \end{itemize}
907
908 In future versions we might support conversion functions from one type of acl
909 into an other for types that are either the same or easily convertable. For now
910 the streams are seperate and restoring them on a platform that doesn't
911 recognize them will give you a warning.
912
913 \section{Extended Attributes}
914 \index[general]{Extended Attributes}
915 Something that was on the project list for some time is now implemented for
916 platforms that support a similar kind of interface. Its the support for backup
917 and restore of so called extended attributes. As extended attributes are so
918 platform specific these attributes are saved in seperate streams for each
919 platform.  Restores of the extended attributes can only be performed on the
920 same platform the backup was done.  There is support for all types of extended
921 attributes, but restoring from one type of filesystem onto an other type of
922 filesystem on the same platform may lead to supprises.  As extended attributes
923 can contain any type of data they are stored as a series of so called
924 value-pairs.  This data must be seen as mostly binary and is stored as such.
925 As security labels from selinux are also extended attributes this option also
926 stores those labels and no specific code is enabled for handling selinux
927 security labels.
928
929 Currently the following platforms support extended attributes:
930 \begin{itemize}
931  \item {\bf Darwin/OSX}
932  \item {\bf FreeBSD}
933  \item {\bf Linux}
934  \item {\bf NetBSD}
935 \end{itemize}
936
937 On linux acls are also extended attributes, as such when you enable ACLs on a
938 Linux platform it will NOT save the same data twice e.g. it will save the ACLs
939 and not the same exteneded attribute.
940
941 To enable the backup of extended attributes please add the following to your
942 fileset definition.
943 \begin{verbatim}
944   FileSet {
945     Name = "MyFileSet"
946     Include {
947       Options {
948         signature = MD5
949         xattrsupport = yes
950       }
951       File = ...
952     }
953   }
954 \end{verbatim}
955
956 \section{Shared objects}
957 \index[general]{Shared objects}
958 A default build of Bacula will now create the libraries as shared objects
959 (.so) rather than static libraries as was previously the case.  
960 The shared libraries are built using {\bf libtool} so it should be quite
961 portable.
962
963 An important advantage of using shared objects is that on a machine with the
964 Directory, File daemon, the Storage daemon, and a console, you will have only
965 one copy of the code in memory rather than four copies.  Also the total size of
966 the binary release is smaller since the library code appears only once rather
967 than once for every program that uses it; this results in significant reduction
968 in the size of the binaries particularly for the utility tools.
969  
970 In order for the system loader to find the shared objects when loading the
971 Bacula binaries, the Bacula shared objects must either be in a shared object
972 directory known to the loader (typically /usr/lib) or they must be in the
973 directory that may be specified on the {\bf ./configure} line using the {\bf
974   {-}{-}libdir} option as:
975
976 \begin{verbatim}
977   ./configure --libdir=/full-path/dir
978 \end{verbatim}
979
980 the default is /usr/lib. If {-}{-}libdir is specified, there should be
981 no need to modify your loader configuration provided that
982 the shared objects are installed in that directory (Bacula
983 does this with the make install command). The shared objects
984 that Bacula references are:
985
986 \begin{verbatim}
987 libbaccfg.so
988 libbacfind.so
989 libbacpy.so
990 libbac.so
991 \end{verbatim}
992
993 These files are symbolically linked to the real shared object file,
994 which has a version number to permit running multiple versions of
995 the libraries if desired (not normally the case).
996
997 If you have problems with libtool or you wish to use the old
998 way of building static libraries, or you want to build a static
999 version of Bacula you may disable
1000 libtool on the configure command line with:
1001
1002 \begin{verbatim}
1003   ./configure --disable-libtool
1004 \end{verbatim}
1005
1006
1007 \section{Building Static versions of Bacula}
1008 \index[general]{Static linking}
1009 In order to build static versions of Bacula, in addition
1010 to configuration options that were needed you now must
1011 also add --disable-libtool.  Example
1012
1013 \begin{verbatim}
1014   ./configure --enable-static-client-only --disable-libtool
1015 \end{verbatim}
1016
1017
1018 \section{Virtual Backup (Vbackup)}
1019 \index[general]{Virtual Backup}
1020 \index[general]{Vbackup}
1021
1022 Bacula's virtual backup feature is often called Synthetic Backup or
1023 Consolidation in other backup products.  It permits you to consolidate the
1024 previous Full backup plus the most recent Differential backup and any
1025 subsequent Incremental backups into a new Full backup.  This new Full
1026 backup will then be considered as the most recent Full for any future
1027 Incremental or Differential backups.  The VirtualFull backup is
1028 accomplished without contacting the client by reading the previous backup
1029 data and writing it to a volume in a different pool.
1030
1031 In some respects the Vbackup feature works similar to a Migration job, in
1032 that Bacula normally reads the data from the pool specified in the 
1033 Job resource, and writes it to the {\bf Next Pool} specified in the 
1034 Job resource. Note, this means that usually the output from the Virtual
1035 Backup is written into a different pool from where your prior backups
1036 are saved. Doing it this way guarantees that you will not get a deadlock
1037 situation attempting to read and write to the same volume in the Storage
1038 daemon. If you then want to do subsequent backups, you may need to
1039 move the Virtual Full Volume back to your normal backup pool.
1040 Alternatively, you can set your {\bf Next Pool} to point to the current
1041 pool.  This will cause Bacula to read and write to Volumes in the
1042 current pool. In general, this will work, because Bacula will
1043 not allow reading and writing on the same Volume. In any case, once
1044 a VirtualFull has been created, and a restore is done involving the
1045 most current Full, it will read the Volume or Volumes by the VirtualFull 
1046 regardless of in which Pool the Volume is found.
1047
1048 The Vbackup is enabled on a Job by Job in the Job resource by specifying
1049 a level of {\bf VirtualFull}.
1050
1051 A typical Job resource definition might look like the following:
1052
1053 \begin{verbatim}
1054 Job {
1055   Name = "MyBackup"
1056   Type = Backup
1057   Client=localhost-fd
1058   FileSet = "Full Set"
1059   Storage = File
1060   Messages = Standard
1061   Pool = Default
1062   SpoolData = yes
1063 }
1064
1065 # Default pool definition
1066 Pool {
1067   Name = Default
1068   Pool Type = Backup
1069   Recycle = yes            # Automatically recycle Volumes
1070   AutoPrune = yes          # Prune expired volumes
1071   Volume Retention = 365d  # one year
1072   NextPool = Full
1073   Storage = File
1074 }
1075
1076 Pool {
1077   Name = Full
1078   Pool Type = Backup
1079   Recycle = yes            # Automatically recycle Volumes
1080   AutoPrune = yes          # Prune expired volumes
1081   Volume Retention = 365d  # one year
1082   Storage = DiskChanger
1083 }
1084
1085 # Definition of file storage device
1086 Storage {
1087   Name = File
1088   Address = localhost
1089   Password = "xxx"
1090   Device = FileStorage
1091   Media Type = File
1092   Maximum Concurrent Jobs = 5
1093 }
1094
1095 # Definition of DDS Virtual tape disk storage device
1096 Storage {
1097   Name = DiskChanger
1098   Address = localhost  # N.B. Use a fully qualified name here
1099   Password = "yyy"
1100   Device = DiskChanger
1101   Media Type = DiskChangerMedia
1102   Maximum Concurrent Jobs = 4
1103   Autochanger = yes
1104 }
1105 \end{verbatim}
1106
1107 Then in bconsole or via a Run schedule, you would run the job as:
1108
1109 \begin{verbatim}
1110 run job=MyBackup level=Full
1111 run job=MyBackup level=Incremental
1112 run job=MyBackup level=Differential
1113 run job=MyBackup level=Incremental
1114 run job=MyBackup level=Incremental
1115 \end{verbatim}
1116
1117 So providing there were changes between each of those jobs, you would end up
1118 with a Full backup, a Differential, which includes the first Incremental
1119 backup, then two Incremental backups.  All the above jobs would be written to
1120 the {\bf Default} pool.
1121
1122 To consolidate those backups into a new Full backup, you would run the
1123 following:
1124
1125 \begin{verbatim}
1126 run job=MyBackup level=VirtualFull
1127 \end{verbatim}
1128
1129 And it would produce a new Full backup without using the client, and the output
1130 would be written to the {\bf Full} Pool which uses the Diskchanger Storage.
1131
1132 If the Virtual Full is run, and there are no prior Jobs, the Virtual Full will
1133 fail with an error.
1134
1135 Note, the Start and End time of the Virtual Full backup is set to the
1136 values for the last job included in the Virtual Full (in the above example,
1137 it is an Increment). This is so that if another incremental is done, which
1138 will be based on the Virtual Full, it will backup all files from the
1139 last Job included in the Virtual Full rather than from the time the Virtual
1140 Full was actually run.
1141
1142
1143
1144 \section{Catalog Format}
1145 \index[general]{Catalog Format}
1146 Bacula 3.0 comes with some changes to the catalog format.  The upgrade
1147 operation will convert the FileId field of the File table from 32 bits (max 4
1148 billion table entries) to 64 bits (very large number of items).  The
1149 conversion process can take a bit of time and will likely DOUBLE THE SIZE of
1150 your catalog during the conversion.  Also you won't be able to run jobs during
1151 this conversion period.  For example, a 3 million file catalog will take 2
1152 minutes to upgrade on a normal machine.  Please don't forget to make a valid
1153 backup of your database before executing the upgrade script. See the 
1154 ReleaseNotes for additional details.
1155
1156 \section{64 bit Windows Client}
1157 \index[general]{Win64 Client}
1158 Unfortunately, Microsoft's implementation of Volume Shadown Copy (VSS) on
1159 their 64 bit OS versions is not compatible with a 32 bit Bacula Client.
1160 As a consequence, we are also releasing a 64 bit version of the Bacula 
1161 Windows Client (win64bacula-3.0.0.exe) that does work with VSS. 
1162 These binaries should only be installed on 64 bit Windows operating systems.
1163 What is important is not your hardware but whether or not you have
1164 a 64 bit version of the Windows OS.  
1165
1166 Compared to the Win32 Bacula Client, the 64 bit release contains a few differences:
1167 \begin{enumerate}
1168 \item Before installing the Win64 Bacula Client, you must totally
1169       deinstall any prior 2.4.x Client installation using the 
1170       Bacula deinstallation (see the menu item). You may want
1171       to save your .conf files first.
1172 \item Only the Client (File daemon) is ported to Win64, the Director
1173       and the Storage daemon are not in the 64 bit Windows installer.
1174 \item bwx-console is not yet ported.
1175 \item bconsole is ported but it has not been tested.
1176 \item The documentation is not included in the installer.
1177 \item Due to Vista security restrictions imposed on a default installation
1178       of Vista, before upgrading the Client, you must manually stop
1179       any prior version of Bacula from running, otherwise the install
1180       will fail.
1181 \item Due to Vista security restrictions imposed on a default installation
1182       of Vista, attempting to edit the conf files via the menu items
1183       will fail. You must directly edit the files with appropriate 
1184       permissions.  Generally double clicking on the appropriate .conf
1185       file will work providing you have sufficient permissions.
1186 \item All Bacula files are now installed in 
1187       {\bf C:/Program Files/Bacula} except the main menu items,
1188       which are installed as before. This vastly simplifies the installation.
1189 \item If you are running on a foreign language version of Windows, most
1190       likely {\bf C:/Program Files} does not exist, so you should use the
1191       Custom installation and enter an appropriate location to install
1192       the files.
1193 \item The 3.0.0 Win32 Client continues to install files in the locations used
1194       by prior versions. For the next version we will convert it to use
1195       the same installation conventions as the Win64 version.
1196 \end{enumerate}
1197
1198 This project was funded by Bacula Systems.
1199
1200
1201 \section{Duplicate Job Control}
1202 \index[general]{Duplicate Jobs}
1203 The new version of Bacula provides four new directives that
1204 give additional control over what Bacula does if duplicate jobs 
1205 are started.  A duplicate job in the sense we use it here means
1206 a second or subsequent job with the same name starts.  This
1207 happens most frequently when the first job runs longer than expected because no 
1208 tapes are available.
1209
1210 The four directives each take as an argument a {\bf yes} or {\bf no} value and
1211 are specified in the Job resource.
1212
1213 They are:
1214
1215 \subsection{Allow Duplicate Jobs = \lt{}yes\vb{}no\gt{}}
1216 \index[general]{Allow Duplicate Jobs}
1217   If this directive is enabled duplicate jobs will be run.  If
1218   the directive is set to {\bf no} (default) then only one job of a given name
1219   may run at one time, and the action that Bacula takes to ensure only
1220   one job runs is determined by the other directives (see below).
1221  
1222   If {\bf Allow Duplicate Jobs} is set to {\bf no} and two jobs
1223   are present and none of the three directives given below permit
1224   cancelling a job, then the current job (the second one started)
1225   will be cancelled.
1226
1227
1228 \subsection{Allow Higher Duplicates = \lt{}yes\vb{}no\gt{}}
1229 \index[general]{Allow Higher Duplicates}
1230   If this directive is set to {\bf yes} (default) the job with a higher
1231   priority (lower priority number) will be permitted to run, and
1232   the current job will be cancelled.  If the
1233   priorities of the two jobs are the same, the outcome is determined by
1234   other directives (see below).
1235
1236 \subsection{Cancel Queued Duplicates = \lt{}yes\vb{}no\gt{}}
1237 \index[general]{Cancel Queued Duplicates}
1238   If {\bf Allow Duplicate Jobs} is set to {\bf no} and
1239   if this directive is set to {\bf yes} any job that is
1240   already queued to run but not yet running will be canceled.
1241   The default is {\bf no}. 
1242
1243 \subsection{Cancel Running Duplicates = \lt{}yes\vb{}no\gt{}}
1244 \index[general]{Cancel Running Duplicates}
1245   If {\bf Allow Duplicate Jobs} is set to {\bf no} and
1246   if this directive is set to {\bf yes} any job that is already running
1247   will be canceled.  The default is {\bf no}.
1248
1249
1250 \section{TLS Authentication}
1251 \index[general]{TLS Authentication}
1252 In Bacula version 2.5.x and later, in addition to the normal Bacula
1253 CRAM-MD5 authentication that is used to authenticate each Bacula
1254 connection, you can specify that you want TLS Authentication as well,
1255 which will provide more secure authentication.
1256
1257 This new feature uses Bacula's existing TLS code (normally used for
1258 communications encryption) to do authentication.  To use it, you must
1259 specify all the TLS directives normally used to enable communications
1260 encryption (TLS Enable, TLS Verify Peer, TLS Certificate, ...) and
1261 a new directive:
1262
1263 \subsection{TLS Authenticate = yes}
1264 \begin{verbatim}
1265 TLS Authenticate = yes
1266 \end{verbatim}
1267
1268 in the main daemon configuration resource (Director for the Director,
1269 Client for the File daemon, and Storage for the Storage daemon).
1270
1271 When {\bf TLS Authenticate} is enabled, after doing the CRAM-MD5
1272 authentication, Bacula will also do TLS authentication, then TLS 
1273 encryption will be turned off, and the rest of the communication between
1274 the two Bacula daemons will be done without encryption.
1275
1276 If you want to encrypt communications data, use the normal TLS directives
1277 but do not turn on {\bf TLS Authenticate}.
1278
1279 \section{bextract non-portable Win32 data}
1280 \index[general]{bextract handles Win32 non-portable data}
1281 {\bf bextract} has been enhanced to be able to restore
1282 non-portable Win32 data to any OS.  Previous versions were 
1283 unable to restore non-portable Win32 data to machines that
1284 did not have the Win32 BackupRead and BackupWrite API calls.
1285
1286 \section{State File updated at Job Termination}
1287 \index[general]{State File}
1288 In previous versions of Bacula, the state file, which provides a
1289 summary of previous jobs run in the {\bf status} command output was
1290 updated only when Bacula terminated, thus if the daemon crashed, the
1291 state file might not contain all the run data.  This version of
1292 the Bacula daemons updates the state file on each job termination.
1293
1294 \section{MaxFullInterval = \lt{}time-interval\gt{}}
1295 \index[general]{MaxFullInterval}
1296 The new Job resource directive {\bf Max Full Interval = \lt{}time-interval\gt{}}
1297 can be used to specify the maximum time interval between {\bf Full} backup
1298 jobs. When a job starts, if the time since the last Full backup is
1299 greater than the specified interval, and the job would normally be an
1300 {\bf Incremental} or {\bf Differential}, it will be automatically
1301 upgraded to a {\bf Full} backup.
1302
1303 \section{MaxDiffInterval = \lt{}time-interval\gt{}}
1304 \index[general]{MaxDiffInterval}
1305 The new Job resource directive {\bf Max Diff Interval = \lt{}time-interval\gt{}}
1306 can be used to specify the maximum time interval between {\bf Differential} backup
1307 jobs. When a job starts, if the time since the last Differential backup is
1308 greater than the specified interval, and the job would normally be an
1309 {\bf Incremental}, it will be automatically
1310 upgraded to a {\bf Differential} backup.
1311
1312 \section{Honor No Dump Flag = \lt{}yes\vb{}no\gt{}}
1313 \index[general]{MaxDiffInterval}
1314 On FreeBSD systems, each file has a {\bf no dump flag} that can be set
1315 by the user, and when it is set it is an indication to backup programs
1316 to not backup that particular file.  This version of Bacula contains a
1317 new Options directive within a FileSet resource, which instructs Bacula to
1318 obey this flag.  The new directive is:
1319
1320 \begin{verbatim}
1321   Honor No Dump Flag = yes\vb{}no
1322 \end{verbatim}
1323
1324 The default value is {\bf no}.
1325
1326
1327 \section{Exclude Dir Containing = \lt{}filename-string\gt{}}
1328 \index[general]{IgnoreDir}
1329 The {\bf ExcludeDirContaining = \lt{}filename\gt{}} is a new directive that
1330 can be added to the Include section of the FileSet resource.  If the specified
1331 filename ({\bf filename-string}) is found on the Client in any directory to be
1332 backed up, the whole directory will be ignored (not backed up).  For example:
1333
1334 \begin{verbatim}
1335   # List of files to be backed up
1336   FileSet {
1337     Name = "MyFileSet"
1338     Include {
1339       Options {
1340         signature = MD5
1341       }
1342       File = /home
1343       Exclude Dir Containing = .excludeme
1344     }
1345   }
1346 \end{verbatim}
1347
1348 But in /home, there may be hundreds of directories of users and some
1349 people want to indicate that they don't want to have certain
1350 directories backed up. For example, with the above FileSet, if
1351 the user or sysadmin creates a file named {\bf .excludeme} in 
1352 specific directories, such as
1353
1354 \begin{verbatim}
1355    /home/user/www/cache/.excludeme
1356    /home/user/temp/.excludeme
1357 \end{verbatim}
1358
1359 then Bacula will not backup the two directories named:
1360
1361 \begin{verbatim}
1362    /home/user/www/cache
1363    /home/user/temp
1364 \end{verbatim}
1365
1366 NOTE: subdirectories will not be backed up.  That is, the directive
1367 applies to the two directories in question and any children (be they
1368 files, directories, etc).
1369
1370
1371 \section{Bacula Plugins}
1372 \index[general]{Plugin}
1373 Support for shared object plugins has been implemented in the Linux, Unix
1374 and Win32 File daemons. The API will be documented separately in
1375 the Developer's Guide or in a new document.  For the moment, there is
1376 a single plugin named {\bf bpipe} that allows an external program to
1377 get control to backup and restore a file.
1378
1379 Plugins are also planned (partially implemented) in the Director and the
1380 Storage daemon.  
1381
1382 \subsection{Plugin Directory}
1383 \index[general]{Plugin Directory}
1384 Each daemon (DIR, FD, SD) has a new {\bf Plugin Directory} directive that may
1385 be added to the daemon definition resource. The directory takes a quoted 
1386 string argument, which is the name of the directory in which the daemon can
1387 find the Bacula plugins. If this directive is not specified, Bacula will not
1388 load any plugins. Since each plugin has a distinctive name, all the daemons
1389 can share the same plugin directory. 
1390
1391 \subsection{Plugin Options}
1392 \index[general]{Plugin Options}
1393 The {\bf Plugin Options} directive takes a quoted string
1394 arguement (after the equal sign) and may be specified in the
1395 Job resource.  The options specified will be passed to all plugins
1396 when they are run.  This each plugin must know what it is looking
1397 for. The value defined in the Job resource can be modified
1398 by the user when he runs a Job via the {\bf bconsole} command line 
1399 prompts.
1400
1401 Note: this directive may be specified, and there is code to modify
1402 the string in the run command, but the plugin options are not yet passed to
1403 the plugin (i.e. not fully implemented).
1404
1405 \subsection{Plugin Options ACL}
1406 \index[general]{Plugin Options ACL}
1407 The {\bf Plugin Options ACL} directive may be specified in the
1408 Director's Console resource. It functions as all the other ACL commands
1409 do by permitting users running restricted consoles to specify a 
1410 {\bf Plugin Options} that overrides the one specified in the Job
1411 definition. Without this directive restricted consoles may not modify
1412 the Plugin Options.
1413
1414 \subsection{Plugin = \lt{}plugin-command-string\gt{}}
1415 \index[general]{Plugin}
1416 The {\bf Plugin} directive is specified in the Include section of
1417 a FileSet resource where you put your {\bf File = xxx} directives.
1418 For example:
1419
1420 \begin{verbatim}
1421   FileSet {
1422     Name = "MyFileSet"
1423     Include {
1424       Options {
1425         signature = MD5
1426       }
1427       File = /home
1428       Plugin = "bpipe:..."
1429     }
1430   }
1431 \end{verbatim}
1432
1433 In the above example, when the File daemon is processing the directives
1434 in the Include section, it will first backup all the files in {\bf /home}
1435 then it will load the plugin named {\bf bpipe} (actually bpipe-dir.so) from
1436 the Plugin Directory.  The syntax and semantics of the Plugin directive
1437 require the first part of the string up to the colon (:) to be the name
1438 of the plugin. Everything after the first colon is ignored by the File daemon but
1439 is passed to the plugin. Thus the plugin writer may define the meaning of the
1440 rest of the string as he wishes.
1441
1442 Please see the next section for information about the {\bf bpipe} Bacula
1443 plugin.
1444
1445 \section{The bpipe Plugin}
1446 \index[general]{The bpipe Plugin}
1447 The {\bf bpipe} plugin is provided in the directory src/plugins/fd/bpipe-fd.c of
1448 the Bacula source distribution. When the plugin is compiled and linking into
1449 the resulting dynamic shared object (DSO), it will have the name {\bf bpipe-fd.so}.
1450
1451 The purpose of the plugin is to provide an interface to any system program for
1452 backup and restore. As specified above the {\bf bpipe} plugin is specified in
1453 the Include section of your Job's FileSet resource.  The full syntax of the
1454 plugin directive as interpreted by the {\bf bpipe} plugin (each plugin is free
1455 to specify the sytax as it wishes) is:
1456
1457 \begin{verbatim}
1458   Plugin = "<field1>:<field2>:<field3>:<field4>"
1459 \end{verbatim}
1460
1461 where
1462 \begin{description}
1463 \item {\bf field1} is the name of the plugin with the trailing {\bf -fd.so}
1464 stripped off, so in this case, we would put {\bf bpipe} in this field.
1465
1466 \item {\bf field2} specifies the namespace, which for {\bf bpipe} is the
1467 pseudo path and filename under which the backup will be saved. This pseudo
1468 path and filename will be seen by the user in the restore file tree.
1469 For example, if the value is {\bf /MYSQL/regress.sql}, the data
1470 backed up by the plugin will be put under that "pseudo" path and filename.
1471 You must be careful to choose a naming convention that is unique to avoid
1472 a conflict with a path and filename that actually exists on your system.
1473
1474 \item {\bf field3} for the {\bf bpipe} plugin 
1475 specifies the "reader" program that is called by the plugin during
1476 backup to read the data. {\bf bpipe} will call this program by doing a
1477 {\bf popen} on it.
1478
1479 \item {\bf field4} for the {\bf bpipe} plugin
1480 specifies the "writer" program that is called by the plugin during
1481 restore to write the data back to the filesystem.  
1482 \end{description}
1483
1484 Putting it all together, the full plugin directive line might look
1485 like the following:
1486
1487 \begin{verbatim}
1488 Plugin = "bpipe:/MYSQL/regress.sql:mysqldump -f 
1489           --opt --databases bacula:mysql"
1490 \end{verbatim}
1491
1492 The directive has been split into two lines, but within the {\bf bacula-dir.conf} file
1493 would be written on a single line.
1494
1495 This causes the File daemon to call the {\bf bpipe} plugin, which will write
1496 its data into the "pseudo" file {\bf /MYSQL/regress.sql} by calling the 
1497 program {\bf mysqldump -f --opt --database bacula} to read the data during
1498 backup. The mysqldump command outputs all the data for the database named
1499 {\bf bacula}, which will be read by the plugin and stored in the backup.
1500 During restore, the data that was backed up will be sent to the program
1501 specified in the last field, which in this case is {\bf mysql}.  When
1502 {\bf mysql} is called, it will read the data sent to it by the plugn
1503 then write it back to the same database from which it came ({\bf bacula}
1504 in this case).
1505
1506 The {\bf bpipe} plugin is a generic pipe program, that simply transmits 
1507 the data from a specified program to Bacula for backup, and then from Bacula to 
1508 a specified program for restore.
1509
1510 By using different command lines to {\bf bpipe},
1511 you can backup any kind of data (ASCII or binary) depending
1512 on the program called.
1513
1514 \section{Microsoft Exchange Server 2003/2007 Plugin}
1515 \index[general]{Microsoft Exchange Server 2003/2007 Plugin}
1516 \subsection{Background}
1517 The Exchange plugin was made possible by a funded development project
1518 between Equiinet Ltd -- www.equiinet.com (many thanks) and Bacula Systems.
1519 The code for the plugin was written by James Harper, and the Bacula core
1520 code by Kern Sibbald.  All the code for this funded development has become
1521 part of the Bacula project.  Thanks to everyone who made it happen.
1522
1523 \subsection{Concepts}
1524 Although it is possible to backup Exchange using Bacula VSS the Exchange 
1525 plugin adds a good deal of functionality, because while Bacula VSS
1526 completes a full backup (snapshot) of Exchange, it does
1527 not support Incremental or Differential backups, restoring is more
1528 complicated, and a single database restore is not possible.
1529
1530 Microsoft Exchange organises its storage into Storage Groups with
1531 Databases inside them. A default installation of Exchange will have a
1532 single Storage Group called 'First Storage Group', with two Databases
1533 inside it, "Mailbox Store (SERVER NAME)" and 
1534 "Public Folder Store (SERVER NAME)", 
1535 which hold user email and public folders respectively.
1536
1537 In the default configuration, Exchange logs everything that happens to
1538 log files, such that if you have a backup, and all the log files since,
1539 you can restore to the present time. Each Storage Group has its own set
1540 of log files and operates independently of any other Storage Groups. At
1541 the Storage Group level, the logging can be turned off by enabling a
1542 function called "Enable circular logging". At this time the Exchange
1543 plugin will not function if this option is enabled.
1544
1545 The plugin allows backing up of entire storage groups, and the restoring
1546 of entire storage groups or individual databases. Backing up and
1547 restoring at the individual mailbox or email item is not supported but
1548 can be simulated by use of the "Recovery" Storage Group (see below).
1549
1550 \subsection{Installing}
1551 The Exchange plugin requires a DLL that is shipped with Microsoft
1552 Exchanger Server called {\bf esebcli2.dll}. Assuming Exchange is installed
1553 correctly the Exchange plugin should find this automatically and run
1554 without any additional installation.
1555
1556 If the DLL can not be found automatically it will need to be copied into
1557 the Bacula installation
1558 directory (eg C:\verb+\+Program Files\verb+\+Bacula\verb+\+bin). The Exchange API DLL is
1559 named esebcli2.dll and is found in C:\verb+\+Program Files\verb+\+Exchsrvr\verb+\+bin on a
1560 default Exchange installation.
1561
1562 \subsection{Backing Up}
1563 To back up an Exchange server the Fileset definition must contain at
1564 least {\bf Plugin = "exchange:/@EXCHANGE/Microsoft Information Store"} for
1565 the backup to work correctly. The 'exchange:' bit tells Bacula to look
1566 for the exchange plugin, the '@EXCHANGE' bit makes sure all the backed
1567 up files are prefixed with something that isn't going to share a name
1568 with something outside the plugin, and the 'Microsoft Information Store'
1569 bit is required also. It is also possible to add the name of a storage
1570 group to the "Plugin =" line, eg \\
1571 {\bf Plugin = "exchange:/@EXCHANGE/Microsoft Information Store/First Storage Group"} \\
1572 if you want only a single storage group backed up.
1573
1574 Additionally, you can suffix the 'Plugin =' directive with
1575 ":notrunconfull" which will tell the plugin not to truncate the Exchange
1576 database at the end of a full backup.
1577
1578 An Incremental or Differential backup will backup only the database logs
1579 for each Storage Group by inspecting the "modified date" on each
1580 physical log file. Because of the way the Exchange API works, the last
1581 logfile backed up on each backup will always be backed up by the next
1582 Incremental or Differential backup too. This adds 5MB to each
1583 Incremental or Differential backup size but otherwise does not cause any
1584 problems.
1585
1586 By default, a normal VSS fileset containing all the drive letters will
1587 also back up the Exchange databases using VSS. This will interfere with
1588 the plugin and Exchange's shared ideas of when the last full backup was
1589 done, and may also truncate log files incorrectly. It is important,
1590 therefore, that the Exchange database files be excluded from the backup,
1591 although the folders the files are in should be included, or they will
1592 have to be recreated manually if a baremetal restore is done.
1593
1594 \begin{verbatim}
1595 FileSet {
1596    Include {
1597       File = C:/Program Files/Exchsrvr/mdbdata
1598       Plugin = "exchange:..."
1599    }
1600    Exclude {
1601       File = C:/Program Files/Exchsrvr/mdbdata/E00.chk
1602       File = C:/Program Files/Exchsrvr/mdbdata/E00.log
1603       File = C:/Program Files/Exchsrvr/mdbdata/E000000F.log
1604       File = C:/Program Files/Exchsrvr/mdbdata/E0000010.log
1605       File = C:/Program Files/Exchsrvr/mdbdata/E0000011.log
1606       File = C:/Program Files/Exchsrvr/mdbdata/E00tmp.log
1607       File = C:/Program Files/Exchsrvr/mdbdata/priv1.edb
1608    }
1609 }
1610 \end{verbatim}
1611
1612 The advantage of excluding the above files is that you can significantly
1613 reduce the size of your backup since all the important Exchange files
1614 will be properly saved by the Plugin.
1615
1616
1617 \subsection{Restoring}
1618 The restore operation is much the same as a normal Bacula restore, with
1619 the following provisos:
1620
1621 \begin{itemize}
1622 \item  The {\bf Where} restore option must not be specified
1623 \item Each Database directory must be marked as a whole. You cannot just
1624      select (say) the .edb file and not the others.
1625 \item If a Storage Group is restored, the directory of the Storage Group
1626      must be marked too.
1627 \item  It is possible to restore only a subset of the available log files,
1628      but they {\bf must} be contiguous. Exchange will fail to restore correctly
1629      if a log file is missing from the sequence of log files
1630 \item Each database to be restored must be dismounted and marked as "Can be
1631     overwritten by restore"
1632 \item If an entire Storage Group is to be restored (eg all databases and
1633    logs in the Storage Group), then it is best to manually delete the
1634    database files from the server (eg C:\verb+\+Program Files\verb+\+Exchsrvr\verb+\+mdbdata\verb+\+*)
1635    as Exchange can get confused by stray log files lying around.
1636 \end{itemize}
1637
1638 \subsection{Restoring to the Recovery Storage Group}
1639 The concept of the Recovery Storage Group is well documented by
1640 Microsoft 
1641 \elink{http://support.microsoft.com/kb/824126}{http://support.microsoft.com/kb/824126}, 
1642 but to briefly summarize...
1643
1644 Microsoft Exchange allows the creation of an additional Storage Group
1645 called the Recovery Storage Group, which is used to restore an older
1646 copy of a database (e.g. before a mailbox was deleted) into without
1647 messing with the current live data. This is required as the Standard and
1648 Small Business Server versions of Exchange can not ordinarily have more
1649 than one Storage Group.
1650
1651 To create the Recovery Storage Group, drill down to the Server in Exchange
1652 System Manager, right click, and select
1653 {\bf "New -> Recovery Storage Group..."}.  Accept or change the file
1654 locations and click OK. On the Recovery Storage Group, right click and
1655 select {\bf "Add Database to Recover..."} and select the database you will
1656 be restoring.
1657
1658 Restore only the single database nominated as the database in the
1659 Recovery Storage Group. Exchange will redirect the restore to the
1660 Recovery Storage Group automatically.
1661 Then run the restore.
1662
1663 \subsection{Restoring on Microsoft Server 2007}
1664 Apparently the {\bf Exmerge} program no longer exists in Microsoft Server
1665 2007, and henc you use a new proceedure for recovering a single mail box.
1666 This procedure is ducomented by Microsoft at:
1667 \elink{http://technet.microsoft.com/en-us/library/aa997694.aspx}{http://technet.microsoft.com/en-us/library/aa997694.aspx},
1668 and involves using the {\bf Restore-Mailbox} and {\bf
1669 Get-MailboxStatistics} shell commands.
1670
1671 \subsection{Caveats}
1672 This plugin is still being developed, so you should consider it
1673 currently in BETA test, and thus use in a production environment
1674 should be done only after very careful testing.
1675
1676 When doing a full backup, the Exchange database logs are truncated by
1677 Exchange as soon as the plugin has completed the backup. If the data
1678 never makes it to the backup medium (eg because of spooling) then the
1679 logs will still be truncated, but they will also not have been backed
1680 up. A solution to this is being worked on. You will have to schedule a
1681 new Full backup to ensure that your next backups will be usable.
1682
1683 The "Enable Circular Logging" option cannot be enabled or the plugin
1684 will fail.
1685
1686 Exchange insists that a successful Full backup must have taken place if
1687 an Incremental or Differential backup is desired, and the plugin will
1688 fail if this is not the case. If a restore is done, Exchange will
1689 require that a Full backup be done before an Incremental or Differential
1690 backup is done.
1691
1692 The plugin will most likely not work well if another backup application
1693 (eg NTBACKUP) is backing up the Exchange database, especially if the
1694 other backup application is truncating the log files.
1695
1696 The Exchange plugin has not been tested with the {\bf Accurate} option, so
1697 we recommend either carefully testing or that you avoid this option for
1698 the current time.
1699
1700 The Exchange plugin is not called during processing the bconsole {\bf
1701 estimate} command, and so anything that would be backed up by the plugin
1702 will not be added to the estimate total that is displayed.
1703
1704
1705 \section{libdbi Framework}
1706 \index[general]{libdbi Framework}
1707 As a general guideline, Bacula has support for a few catalog database drivers
1708 (MySQL, PostgreSQL, SQLite)
1709 coded natively by the Bacula team.  With the libdbi implementation, which is a
1710 Bacula driver that uses libdbi to access the catalog, we have an open field to
1711 use many different kinds database engines following the needs of users.
1712
1713 The according to libdbi (http://libdbi.sourceforge.net/) project: libdbi
1714 implements a database-independent abstraction layer in C, similar to the
1715 DBI/DBD layer in Perl. Writing one generic set of code, programmers can
1716 leverage the power of multiple databases and multiple simultaneous database
1717 connections by using this framework.
1718
1719 Currently the libdbi driver in Bacula project only supports the same drivers
1720 natively coded in Bacula.  However the libdbi project has support for many
1721 others database engines. You can view the list at
1722 http://libdbi-drivers.sourceforge.net/. In the future all those drivers can be
1723 supported by Bacula, however, they must be tested properly by the Bacula team.
1724
1725 Some of benefits of using libdbi are:
1726 \begin{itemize}
1727 \item The possibility to use proprietary databases engines in which your
1728   proprietary licenses prevent the Bacula team from developing the driver.
1729  \item The possibility to use the drivers written for the libdbi project.
1730  \item The possibility to use other database engines without recompiling Bacula
1731    to use them.  Just change one line in bacula-dir.conf
1732  \item Abstract Database access, this is, unique point to code and profiling
1733    catalog database access.
1734  \end{itemize}
1735  
1736  The following drivers have been tested:
1737  \begin{itemize}
1738  \item PostgreSQL, with and without batch insert
1739  \item Mysql, with and without batch insert
1740  \item SQLite
1741  \item SQLite3
1742  \end{itemize}
1743
1744  In the future, we will test and approve to use others databases engines
1745  (proprietary or not) like DB2, Oracle, Microsoft SQL.
1746
1747  To compile Bacula to support libdbi we need to configure the code with the
1748  --with-dbi and --with-dbi-driver=[database] ./configure options, where
1749  [database] is the database engine to be used with Bacula (of course we can
1750  change the driver in file bacula-dir.conf, see below).  We must configure the
1751  access port of the database engine with the option --with-db-port, because the
1752  libdbi framework doesn't know the default access port of each database.
1753
1754 The next phase is checking (or configuring) the bacula-dir.conf, example:
1755 \begin{verbatim}
1756 Catalog {
1757   Name = MyCatalog
1758   dbdriver = dbi:mysql; dbaddress = 127.0.0.1; dbport = 3306
1759   dbname = regress; user = regress; password = ""
1760 }
1761 \end{verbatim}
1762
1763 The parameter {\bf dbdriver} indicates that we will use the driver dbi with a
1764 mysql database.  Currently the drivers supported by Bacula are: postgresql,
1765 mysql, sqlite, sqlite3; these are the names that may be added to string "dbi:".
1766
1767 The following limitations apply when Bacula is set to use the libdbi framework:
1768  - Not tested on the Win32 platform
1769  - A little performance is lost if comparing with native database driver. 
1770    The reason is bound with the database driver provided by libdbi and the 
1771    simple fact that one more layer of code was added.
1772
1773 It is important to remember, when compiling Bacula with libdbi, the
1774 following packages are needed:
1775  \begin{itemize}
1776   \item libdbi version 1.0.0, http://libdbi.sourceforge.net/
1777   \item libdbi-drivers 1.0.0, http://libdbi-drivers.sourceforge.net/
1778  \end{itemize}
1779  
1780  You can download them and compile them on your system or install the packages
1781  from your OS distribution.
1782
1783 \section{Console Command Additions and Enhancements}
1784 \index[general]{Console Additions}                                 
1785
1786 \subsection{Display Autochanger Content}
1787 \index[general]{StatusSlots}
1788
1789 The {\bf status slots storage=\lt{}storage-name\gt{}} command displays
1790 autochanger content.
1791
1792 \footnotesize
1793 \begin{verbatim}
1794  Slot |  Volume Name  |  Status  |  Media Type       |   Pool     |
1795 ------+---------------+----------+-------------------+------------|
1796     1 |         00001 |   Append |  DiskChangerMedia |    Default |
1797     2 |         00002 |   Append |  DiskChangerMedia |    Default |
1798     3*|         00003 |   Append |  DiskChangerMedia |    Scratch |
1799     4 |               |          |                   |            |
1800 \end{verbatim}
1801 \normalsize
1802
1803 If you an asterisk ({\bf *}) appears after the slot number, you must run an
1804 {\bf update slots} command to synchronize autochanger content with your
1805 catalog.
1806
1807 \subsection{list joblog job=xxx or jobid=nnn}
1808 \index[general]{list joblog}
1809 A new list command has been added that allows you to list the contents
1810 of the Job Log stored in the catalog for either a Job Name (fully qualified)
1811 or for a particular JobId.  The {\bf llist} command will include a line with
1812 the time and date of the entry.
1813
1814 Note for the catalog to have Job Log entries, you must have a directive 
1815 such as:
1816
1817 \begin{verbatim}
1818   catalog = all
1819 \end{verbatim}
1820
1821 In your Director's {\bf Messages} resource.
1822
1823 \subsection{Use separator for multiple commands}
1824 \index[general]{Command Separator}
1825   When using bconsole with readline, you can set the command separator with 
1826   \textbf{@separator} command to one
1827   of those characters to write commands who require multiple input in one line.
1828 \begin{verbatim}
1829   !$%&'()*+,-/:;<>?[]^`{|}~
1830 \end{verbatim}
1831
1832 \subsection{Deleting Volumes}
1833 The delete volume bconsole command has been modified to
1834 require an asterisk (*) in front of a MediaId otherwise the
1835 value you enter is a taken to be a Volume name. This is so that
1836 users may delete numeric Volume names. The previous Bacula versions
1837 assumed that all input that started with a number was a MediaId.
1838
1839 This new behavior is indicated in the prompt if you read it
1840 carefully.
1841
1842 \section{Bare Metal Recovery}
1843 The old bare metal recovery project is essentially dead. One
1844 of the main features of it was that it would build a recovery
1845 CD based on the kernel on your system. The problem was that
1846 every distribution has a different boot procedure and different 
1847 scripts, and worse yet, the boot procedures and scripts change
1848 from one distribution to another.  This meant that maintaining
1849 (keeping up with the changes) the rescue CD was too much work.
1850
1851 To replace it, a new bare metal recovery USB boot stick has been developed
1852 by Bacula Systems.  This technology involves remastering a Ubuntu LiveCD to
1853 boot from a USB key.  
1854
1855 Advantages: 
1856 \begin{enumerate} 
1857 \item Recovery can be done from within graphical environment.  
1858 \item Recovery can be done in a shell.  
1859 \item Ubuntu boots on a large number of Linux systems.  
1860 \item The process of updating the system and adding new
1861    packages is not too difficult. 
1862 \item The USB key can easily be upgraded to newer Ubuntu versions.
1863 \item The USB key has writable partitions for modifications to
1864    the OS and for modification to your home directory.
1865 \item You can add new files/directories to the USB key very easily.
1866 \item You can save the environment from multiple machines on
1867    one USB key.
1868 \item Bacula Systems is funding its ongoing development.
1869 \end{enumerate}
1870
1871 The disadvantages are:
1872 \begin{enumerate}
1873 \item The USB key is usable but currently under development.
1874 \item Not everyone may be familiar with Ubuntu (no worse
1875   than using Knoppix)
1876 \item Some older OSes cannot be booted from USB. This can
1877    be resolved by first booting a Ubuntu LiveCD then plugging
1878    in the USB key.
1879 \item Currently the documentation is sketchy and not yet added
1880    to the main manual. See below ...
1881 \end{enumerate}
1882
1883 The documentation and the code can be found in the {\bf rescue} package
1884 in the directory {\bf linux/usb}.
1885
1886 \section{Miscellaneous}
1887 \index[general]{Misc New Features}
1888
1889 \subsection{Allow Mixed Priority = \lt{}yes\vb{}no\gt{}}
1890 \index[general]{Allow Mixed Priority}
1891    This directive is only implemented in version 2.5 and later.  When
1892    set to {\bf yes} (default {\bf no}), this job may run even if lower
1893    priority jobs are already running.  This means a high priority job
1894    will not have to wait for other jobs to finish before starting.
1895    The scheduler will only mix priorities when all running jobs have
1896    this set to true.
1897
1898    Note that only higher priority jobs will start early.  Suppose the
1899    director will allow two concurrent jobs, and that two jobs with
1900    priority 10 are running, with two more in the queue.  If a job with
1901    priority 5 is added to the queue, it will be run as soon as one of
1902    the running jobs finishes.  However, new priority 10 jobs will not
1903    be run until the priority 5 job has finished.
1904
1905 \subsection{Bootstrap File Directive -- FileRegex}
1906 \index[general]{Bootstrap File Directive}
1907   {\bf FileRegex} is a new command that can be added to the bootstrap
1908   (.bsr) file.  The value is a regular expression.  When specified, only
1909   matching filenames will be restored.
1910
1911   During a restore, if all File records are pruned from the catalog
1912   for a Job, normally Bacula can restore only all files saved. That
1913   is there is no way using the catalog to select individual files.
1914   With this new feature, Bacula will ask if you want to specify a Regex
1915   expression for extracting only a part of the full backup.
1916
1917 \begin{verbatim}
1918   Building directory tree for JobId(s) 1,3 ...
1919   There were no files inserted into the tree, so file selection
1920   is not possible.Most likely your retention policy pruned the files
1921   
1922   Do you want to restore all the files? (yes\vb{}no): no
1923   
1924   Regexp matching files to restore? (empty to abort): /tmp/regress/(bin|tests)/
1925   Bootstrap records written to /tmp/regress/working/zog4-dir.restore.1.bsr
1926 \end{verbatim}
1927
1928 \subsection{Bootstrap File Optimization Changes}
1929 In order to permit proper seeking on disk files, we have extended the bootstrap
1930 file format to include a {\bf VolStartAddr} and {\bf VolEndAddr} records. Each
1931 takes a 64 bit unsigned integer range (i.e. nnn-mmm) which defines the start
1932 address range and end address range respectively.  These two directives replace
1933 the {\bf VolStartFile}, {\bf VolEndFile}, {\bf VolStartBlock} and {\bf
1934   VolEndBlock} directives.  Bootstrap files containing the old directives will
1935 still work, but will not properly take advantage of proper disk seeking, and
1936 may read completely to the end of a disk volume during a restore.  With the new
1937 format (automatically generated by the new Director), restores will seek
1938 properly and stop reading the volume when all the files have been restored.
1939
1940 \subsection{Solaris ZFS/NFSv4 ACLs}
1941 This is an upgrade of the previous Solaris ACL backup code
1942 to the new library format, which will backup both the old
1943 POSIX(UFS) ACLs as well as the ZFS ACLs.
1944
1945 The new code can also restore POSIX(UFS) ACLs to a ZFS filesystem
1946 (it will translate the POSIX(UFS)) ACL into a ZFS/NFSv4 one) it can also
1947 be used to transfer from UFS to ZFS filesystems.
1948
1949
1950 \subsection{Virtual Tape Emulation}
1951 \index[general]{Virtual Tape Emulation}
1952 We now have a Virtual Tape emulator that allows us to run though 99.9\% of
1953 the tape code but actually reading and writing to a disk file. Used with the
1954 \textbf{disk-changer} script, you can now emulate an autochanger with 10 drives
1955 and 700 slots. This feature is most useful in testing.  It is enabled
1956 by using {\bf Device Type = vtape} in the Storage daemon's Device
1957 directive. This feature is only implemented on Linux machines and should not be
1958 used for production.
1959
1960 \subsection{Bat Enhancements}
1961 \index[general]{Bat Enhancements}
1962 Bat (the Bacula Administration Tool) GUI program has been significantly
1963 enhanced and stabilized. In particular, there are new table based status 
1964 commands; it can now be easily localized using Qt4 Linguist.
1965
1966 The Bat communications protocol has been significantly enhanced to improve
1967 GUI handling. Note, you {\bf must} use a the bat that is distributed with
1968 the Director you are using otherwise the communications protocol will not
1969 work.
1970
1971 \subsection{RunScript Enhancements}
1972 \index[general]{RunScript Enhancements}
1973 The {\bf RunScript} resource has been enhanced to permit multiple
1974 commands per RunScript.  Simply specify multiple {\bf Command} directives
1975 in your RunScript.
1976
1977 \begin{verbatim}
1978 Job {
1979   Name = aJob
1980   RunScript {
1981     Command = "/bin/echo test"
1982     Command = "/bin/echo an other test"
1983     Command = "/bin/echo 3 commands in the same runscript"
1984     RunsWhen = Before
1985   }
1986  ...
1987 }
1988 \end{verbatim}
1989
1990 A new Client RunScript {\bf RunsWhen} keyword of {\bf AfterVSS} has been
1991 implemented, which runs the command after the Volume Shadow Copy has been made.
1992
1993 Console commands can be specified within a RunScript by using:
1994 {\bf Console = \lt{}command\gt{}}, however, this command has not been 
1995 carefully tested and debugged and is known to easily crash the Director.
1996 We would appreciate feedback.  Due to the recursive nature of this command, we
1997 may remove it before the final release.
1998
1999 \subsection{Status Enhancements}
2000 \index[general]{Status Enhancements}
2001 The bconsole {\bf status dir} output has been enhanced to indicate
2002 Storage daemon job spooling and despooling activity.
2003
2004 \subsection{Connect Timeout}
2005 \index[general]{Connect Timeout}
2006 The default connect timeout to the File
2007 daemon has been set to 3 minutes. Previously it was 30 minutes.
2008
2009 \subsection{ftruncate for NFS Volumes}
2010 \index[general]{ftruncate for NFS Volumes}
2011 If you write to a Volume mounted by NFS (say on a local file server),
2012 in previous Bacula versions, when the Volume was recycled, it was not
2013 properly truncated because NFS does not implement ftruncate (file 
2014 truncate). This is now corrected in the new version because we have
2015 written code (actually a kind user) that deletes and recreates the Volume,
2016 thus accomplishing the same thing as a truncate.
2017
2018 \subsection{Support for Ubuntu}
2019 The new version of Bacula now recognizes the Ubuntu (and Kubuntu)
2020 version of Linux, and thus now provides correct autostart routines.
2021 Since Ubuntu officially supports Bacula, you can also obtain any
2022 recent release of Bacula from the Ubuntu repositories.
2023
2024 \subsection{Recycle Pool = \lt{}pool-name\gt{}}
2025 \index[general]{Recycle Pool}
2026 The new \textbf{RecyclePool} directive defines to which pool the Volume will
2027 be placed (moved) when it is recycled. Without this directive, a Volume will
2028 remain in the same pool when it is recycled. With this directive, it can be
2029 moved automatically to any existing pool during a recycle. This directive is
2030 probably most useful when defined in the Scratch pool, so that volumes will
2031 be recycled back into the Scratch pool.
2032
2033 \subsection{FD Version}
2034 \index[general]{FD Version}
2035 The File daemon to Director protocol now includes a version 
2036 number, which although there is no visible change for users, 
2037 will help us in future versions automatically determine
2038 if a File daemon is not compatible.
2039
2040 \subsection{Max Run Sched Time = \lt{}time-period-in-seconds\gt{}}
2041 \index[general]{Max Run Sched Time}
2042 The time specifies the maximum allowed time that a job may run, counted from
2043 when the job was scheduled. This can be useful to prevent jobs from running
2044 during working hours. We can see it like \texttt{Max Start Delay + Max Run
2045   Time}.
2046
2047 \subsection{Max Wait Time = \lt{}time-period-in-seconds\gt{}}
2048 \index[general]{Max Wait Time}
2049 Previous \textbf{MaxWaitTime} directives aren't working as expected, instead
2050 of checking the maximum allowed time that a job may block for a resource,
2051 those directives worked like \textbf{MaxRunTime}. Some users are reporting to
2052 use \textbf{Incr/Diff/Full Max Wait Time} to control the maximum run time of
2053 their job depending on the level. Now, they have to use
2054 \textbf{Incr/Diff/Full Max Run Time}.  \textbf{Incr/Diff/Full Max Wait Time}
2055 directives are now deprecated.
2056
2057 \subsection{Incremental|Differential Max Wait Time = \lt{}time-period-in-seconds\gt{}} 
2058 \index[general]{Incremental Max Wait Time}
2059 \index[general]{Differential Max Wait Time}
2060
2061 These directives have been deprecated in favor of
2062 \texttt{Incremental|Differential Max Run Time}.
2063
2064 \subsection{Max Run Time directives}
2065 \index[general]{Max Run Time directives}
2066 Using \textbf{Full/Diff/Incr Max Run Time}, it's now possible to specify the
2067 maximum allowed time that a job can run depending on the level.
2068
2069 \addcontentsline{lof}{figure}{Job time control directives}
2070 \includegraphics{\idir different_time.eps}
2071
2072 \subsection{Statistics Enhancements}
2073 \index[general]{Statistics Enhancements}
2074 If you (or probably your boss) want to have statistics on your backups to
2075 provide some \textit{Service Level Agreement} indicators, you could use a few
2076 SQL queries on the Job table to report how many:
2077
2078 \begin{itemize}
2079 \item jobs have run
2080 \item jobs have been successful
2081 \item files have been backed up
2082 \item ...
2083 \end{itemize}
2084
2085 However, these statistics are accurate only if your job retention is greater
2086 than your statistics period. Ie, if jobs are purged from the catalog, you won't
2087 be able to use them. 
2088
2089 Now, you can use the \textbf{update stats [days=num]} console command to fill
2090 the JobHistory table with new Job records. If you want to be sure to take in
2091 account only \textbf{good jobs}, ie if one of your important job has failed but
2092 you have fixed the problem and restarted it on time, you probably want to
2093 delete the first \textit{bad} job record and keep only the successful one. For
2094 that simply let your staff do the job, and update JobHistory table after two or
2095 three days depending on your organization using the \textbf{[days=num]} option.
2096
2097 These statistics records aren't used for restoring, but mainly for
2098 capacity planning, billings, etc.
2099
2100 The Bweb interface provides a statistics module that can use this feature. You
2101 can also use tools like Talend or extract information by yourself.
2102
2103 The \textbf{Statistics Retention = \lt{}time\gt{}} director directive defines
2104 the length of time that Bacula will keep statistics job records in the Catalog
2105 database after the Job End time. (In \texttt{JobHistory} table) When this time
2106 period expires, and if user runs \texttt{prune stats} command, Bacula will
2107 prune (remove) Job records that are older than the specified period.
2108
2109 You can use the following Job resource in your nightly \textbf{BackupCatalog}
2110 job to maintain statistics.
2111 \begin{verbatim}
2112 Job {
2113   Name = BackupCatalog
2114   ...
2115   RunScript {
2116     Console = "update stats days=3"
2117     Console = "prune stats yes"
2118     RunsWhen = After
2119     RunsOnClient = no
2120   }
2121 }
2122 \end{verbatim}
2123
2124 \subsection{ScratchPool = \lt{}pool-resource-name\gt{}}
2125 \index[general]{ScratchPool}
2126 This directive permits to specify a specific \textsl{Scratch} pool for the
2127 current pool. This is useful when using multiple storage sharing the same
2128 mediatype or when you want to dedicate volumes to a particular set of pool.
2129
2130 \subsection{Enhanced Attribute Despooling}
2131 \index[general]{Attribute Despooling}
2132 If the storage daemon and the Director are on the same machine, the spool file
2133 that contains attributes is read directly by the Director instead of being
2134 transmitted across the network. That should reduce load and speedup insertion.
2135
2136 \subsection{SpoolSize = \lt{}size-specification-in-bytes\gt{}}
2137 \index[general]{SpoolSize}
2138 A new Job directive permits to specify the spool size per job. This is used
2139 in advanced job tunning. {\bf SpoolSize={\it bytes}}
2140
2141 \subsection{MaxConsoleConnections = \lt{}number\gt{}}
2142 \index[general]{MaxConsoleConnections}
2143 A new director directive permits to specify the maximum number of Console
2144 Connections that could run concurrently. The default is set to 20, but you may
2145 set it to a larger number.
2146
2147 \subsection{VerId = \lt{}string\gt{}}
2148 \index[general]{VerId}
2149 A new director directive permits to specify a personnal identifier that will be
2150 displayed in the \texttt{version} command.
2151
2152 \subsection{dbcheck enhancements}
2153 \index[general]{dbcheck enhancements}
2154 If you are using Mysql, dbcheck will now ask you if you want to create
2155 temporary indexes to speed up orphaned Path and Filename elimination. 
2156
2157 A new \texttt{-B} option allows you to print catalog information in a simple
2158 text based format. This is useful to backup it in a secure way.
2159
2160 \begin{verbatim}
2161  $ dbcheck -B 
2162  catalog=MyCatalog
2163  db_type=SQLite
2164  db_name=regress
2165  db_driver=
2166  db_user=regress
2167  db_password=
2168  db_address=
2169  db_port=0
2170  db_socket=
2171 \end{verbatim} %$
2172
2173 You can now specify the database connection port in the command line.
2174
2175 \subsection{{-}{-}docdir configure option}
2176 \index[general]{{-}{-}docdir configure option}
2177 You can use {-}{-}docdir= on the ./configure command to
2178 specify the directory where you want Bacula to install the
2179 LICENSE, ReleaseNotes, ChangeLog, ... files.   The default is 
2180 {\bf /usr/share/doc/bacula}.
2181       
2182 \subsection{{-}{-}htmldir configure option}
2183 \index[general]{{-}{-}htmldir configure option}
2184 You can use {-}{-}htmldir= on the ./configure command to
2185 specify the directory where you want Bacula to install the bat html help
2186 files. The default is {\bf /usr/share/doc/bacula/html}
2187
2188 \subsection{{-}{-}with-plugindir configure option}
2189 \index[general]{{-}{-}plugindir configure option}
2190 You can use {-}{-}plugindir= on the ./configure command to
2191 specify the directory where you want Bacula to install
2192 the plugins (currently only bpipe-fd). The default is
2193 /usr/lib.