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