]> git.sur5r.net Git - bacula/docs/blob - docs/manuals/en/concepts/newfeatures.tex
Fix doc html install directory doc
[bacula/docs] / docs / manuals / en / concepts / newfeatures.tex
1 %%
2
3 %%
4
5 \chapter{New Features}
6 \label{NewFeaturesChapter}
7 \index[general]{New Features}
8
9 This chapter presents the new features added to the development 2.5.x
10 versions to be released as Bacula version 3.0.0 sometime in April 2009.
11
12 \section{Accurate Backup}
13 \index[general]{Accurate Backup}
14
15 As with most other backup programs, by default Bacula decides what files to
16 backup for Incremental and Differental backup by comparing the change
17 (st\_ctime) and modification (st\_mtime) times of the file to the time the last
18 backup completed.  If one of those two times is later than the last backup
19 time, then the file will be backed up.  This does not, however, permit tracking
20 what files have been deleted and will miss any file with an old time that may
21 have been restored to or moved onto the client filesystem.
22
23 \subsection{Accurate = \lt{}yes|no\gt{}}
24 If the {\bf Accurate = \lt{}yes|no\gt{}} directive is enabled (default no) in
25 the Job resource, the job will be run as an Accurate Job. For a {\bf Full}
26 backup, there is no difference, but for {\bf Differential} and {\bf
27   Incremental} backups, the Director will send a list of all previous files
28 backed up, and the File daemon will use that list to determine if any new files
29 have been added or or moved and if any files have been deleted. This allows
30 Bacula to make an accurate backup of your system to that point in time so that
31 if you do a restore, it will restore your system exactly.  One note of caution
32 about using Accurate backup is that it requires more resources (CPU and memory)
33 on both the Director and the Client machines to create the list of previous
34 files backed up, to send that list to the File daemon, for the File daemon to
35 keep the list (possibly very big) in memory, and for the File daemon to do
36 comparisons between every file in the FileSet and the list.
37
38 Accurate must not be enabled when backing up with a plugin that is not
39 specially designed to work with Accurate. If you enable it, your restores
40 will probably not work correctly.
41                                        
42
43
44 \section{Copy Jobs}
45 \index[general]{Copy Jobs}
46
47 A new {\bf Copy} job type 'C' has been implemented. It is similar to the
48 existing Migration feature with the exception that the Job that is copied is
49 left unchanged.  This essentially creates two identical copies of the same
50 backup. However, the copy is treated as a copy rather than a backup job, and
51 hence is not directly available for restore.  The {\bf restore} command lists
52 copy jobs and allows selection of copies by using \texttt{jobid=}
53 option. If the keyword {\bf copies} is present on the command line, Bacula will
54 display the list of all copies for selected jobs.
55
56 \begin{verbatim}
57 * restore copies
58 [...]
59 These JobIds have copies as follows:
60 +-------+------------------------------------+-----------+------------------+
61 | JobId | Job                                | CopyJobId | MediaType        |
62 +-------+------------------------------------+-----------+------------------+
63 | 2     | CopyJobSave.2009-02-17_16.31.00.11 | 7         | DiskChangerMedia |
64 +-------+------------------------------------+-----------+------------------+
65 +-------+-------+----------+----------+---------------------+------------------+
66 | JobId | Level | JobFiles | JobBytes | StartTime           | VolumeName       |
67 +-------+-------+----------+----------+---------------------+------------------+
68 | 19    | F     | 6274     | 76565018 | 2009-02-17 16:30:45 | ChangerVolume002 |
69 | 2     | I     | 1        | 5        | 2009-02-17 16:30:51 | FileVolume001    |
70 +-------+-------+----------+----------+---------------------+------------------+
71 You have selected the following JobIds: 19,2
72
73 Building directory tree for JobId(s) 19,2 ...  ++++++++++++++++++++++++++++++++++++++++++++
74 5,611 files inserted into the tree.
75 ...
76 \end{verbatim}
77
78
79 The Copy Job runs without using the File daemon by copying the data from the
80 old backup Volume to a different Volume in a different Pool. See the Migration
81 documentation for additional details. For copy Jobs there is a new selection
82 criterium named PoolUncopiedJobs which copies all jobs from a pool to an other
83 pool which were not copied before. Next to that the client, volume, job or sql
84 query are possible ways of selecting jobs which should be copied.  Selection
85 types like smallestvolume, oldestvolume, pooloccupancy and pooltime are
86 probably more suited for migration jobs only. But we could imagine some people
87 have a valid use for those kind of copy jobs too.
88
89 If bacula founds a copy when a job record is purged (deleted) from the catalog,
90 it will promote the copy as \textsl{real} backup and will make it available for
91 automatic restore. If more than one copy is available, it will promote the copy
92 with the smallest jobid.
93
94 A nice solution which can be build with the new copy jobs is what is
95 called the disk-to-disk-to-tape backup (DTDTT). A sample config could
96 look somethings like the one below:
97
98 \begin{verbatim}
99 Pool {
100   Name = FullBackupsVirtualPool
101   Pool Type = Backup
102   Purge Oldest Volume = Yes
103   Storage = vtl
104   NextPool = FullBackupsTapePool
105 }
106
107 Pool {
108   Name = FullBackupsTapePool
109   Pool Type = Backup
110   Recycle = Yes
111   AutoPrune = Yes
112   Volume Retention = 365 days
113   Storage = superloader
114 }
115
116 #
117 # Fake fileset for copy jobs
118 #
119 Fileset {
120   Name = None
121   Include {
122     Options {
123       signature = MD5
124     }
125   }
126 }
127
128 #
129 # Fake client for copy jobs
130 #
131 Client {
132   Name = None
133   Address = localhost
134   Password = "NoNe"
135   Catalog = MyCatalog
136 }
137
138 #
139 # Default template for a CopyDiskToTape Job
140 #
141 JobDefs {
142   Name = CopyDiskToTape
143   Type = Copy
144   Messages = StandardCopy
145   Client = None
146   FileSet = None
147   Selection Type = PoolUncopiedJobs
148   Maximum Concurrent Jobs = 10
149   SpoolData = No
150   Allow Duplicate Jobs = Yes
151   Allow Higher Duplicates = No
152   Cancel Queued Duplicates = No
153   Cancel Running Duplicates = No
154   Priority = 13
155 }
156
157 Schedule {
158    Name = DaySchedule7:00
159    Run = Level=Full daily at 7:00
160 }
161
162 Job {
163   Name = CopyDiskToTapeFullBackups
164   Enabled = Yes
165   Schedule = DaySchedule7:00
166   Pool = FullBackupsVirtualPool
167   JobDefs = CopyDiskToTape
168 }
169 \end{verbatim}
170
171 The example above had 2 pool which are copied using the PoolUncopiedJobs
172 selection criteria. Normal Full backups go to the Virtual pool and are copied
173 to the Tape pool the next morning.
174
175 The command \texttt{list copies [jobid=x,y,z]} lists copies for a given
176 \textbf{jobid}.
177
178 \begin{verbatim}
179 *list copies
180 +-------+------------------------------------+-----------+------------------+
181 | JobId | Job                                | CopyJobId | MediaType        |
182 +-------+------------------------------------+-----------+------------------+
183 |     9 | CopyJobSave.2008-12-20_22.26.49.05 |        11 | DiskChangerMedia |
184 +-------+------------------------------------+-----------+------------------+
185 \end{verbatim}
186
187 \section{ACL Updates}
188 \index[general]{ACL Updates}
189 The whole ACL code had been overhauled and in this version each platforms has
190 different streams for each type of acl available on such an platform. As ACLs
191 between platforms tend to be not that portable (most implement POSIX acls but
192 some use an other draft or a completely different format) we currently only
193 allow certain platform specific ACL streams to be decoded and restored on the
194 same platform that they were created on.  The old code allowed to restore ACL
195 cross platform but the comments already mention that not being to wise. For
196 backward compatability the new code will accept the two old ACL streams and
197 handle those with the platform specific handler. But for all new backups it
198 will save the ACLs using the new streams.
199
200 Currently the following platforms support ACLs:
201
202 \begin{itemize}
203  \item {\bf AIX}
204  \item {\bf Darwin/OSX}
205  \item {\bf FreeBSD}
206  \item {\bf HPUX}
207  \item {\bf IRIX}
208  \item {\bf Linux}
209  \item {\bf Tru64}
210  \item {\bf Solaris}
211 \end{itemize}
212
213 Currently we support the following ACL types (these ACL streams use a reserved
214 part of the stream numbers):
215
216 \begin{itemize}
217 \item {\bf STREAM\_ACL\_AIX\_TEXT} 1000 AIX specific string representation from
218   acl\_get
219  \item {\bf STREAM\_ACL\_DARWIN\_ACCESS\_ACL} 1001 Darwin (OSX) specific acl\_t
220    string representation from acl\_to\_text (POSIX acl)
221   \item {\bf STREAM\_ACL\_FREEBSD\_DEFAULT\_ACL} 1002 FreeBSD specific acl\_t
222     string representation from acl\_to\_text (POSIX acl) for default acls.
223   \item {\bf STREAM\_ACL\_FREEBSD\_ACCESS\_ACL} 1003 FreeBSD specific acl\_t
224     string representation from acl\_to\_text (POSIX acl) for access acls.
225   \item {\bf STREAM\_ACL\_HPUX\_ACL\_ENTRY} 1004 HPUX specific acl\_entry
226     string representation from acltostr (POSIX acl)
227   \item {\bf STREAM\_ACL\_IRIX\_DEFAULT\_ACL} 1005 IRIX specific acl\_t string
228     representation from acl\_to\_text (POSIX acl) for default acls.
229   \item {\bf STREAM\_ACL\_IRIX\_ACCESS\_ACL} 1006 IRIX specific acl\_t string
230     representation from acl\_to\_text (POSIX acl) for access acls.
231   \item {\bf STREAM\_ACL\_LINUX\_DEFAULT\_ACL} 1007 Linux specific acl\_t
232     string representation from acl\_to\_text (POSIX acl) for default acls.
233   \item {\bf STREAM\_ACL\_LINUX\_ACCESS\_ACL} 1008 Linux specific acl\_t string
234     representation from acl\_to\_text (POSIX acl) for access acls.
235   \item {\bf STREAM\_ACL\_TRU64\_DEFAULT\_ACL} 1009 Tru64 specific acl\_t
236     string representation from acl\_to\_text (POSIX acl) for default acls.
237   \item {\bf STREAM\_ACL\_TRU64\_DEFAULT\_DIR\_ACL} 1010 Tru64 specific acl\_t
238     string representation from acl\_to\_text (POSIX acl) for default acls.
239   \item {\bf STREAM\_ACL\_TRU64\_ACCESS\_ACL} 1011 Tru64 specific acl\_t string
240     representation from acl\_to\_text (POSIX acl) for access acls.
241   \item {\bf STREAM\_ACL\_SOLARIS\_ACLENT} 1012 Solaris specific aclent\_t
242     string representation from acltotext or acl\_totext (POSIX acl)
243   \item {\bf STREAM\_ACL\_SOLARIS\_ACE} 1013 Solaris specific ace\_t string
244     representation from from acl\_totext (NFSv4 or ZFS acl)
245 \end{itemize}
246
247 In future versions we might support conversion functions from one type of acl
248 into an other for types that are either the same or easily convertable. For now
249 the streams are seperate and restoring them on a platform that doesn't
250 recognize them will give you a warning.
251
252 \section{Extended Attributes}
253 \index[general]{Extended Attributes}
254 Something that was on the project list for some time is now implemented for
255 platforms that support a similar kind of interface. Its the support for backup
256 and restore of so called extended attributes. As extended attributes are so
257 platform specific these attributes are saved in seperate streams for each
258 platform. Restores can only be performed on the same platform the backup was
259 done. There is support for all types of extended attributes, but restoring from
260 one type of filesystem onto an other type of filesystem on the same platform
261 may lead to supprises. As extended attributes can contain any type of data they
262 are stored as a series of so called value-pairs. This data must be seen as
263 mostly binary and is stored as such. As security labels from selinux are also
264 extended attributes this option also stores those labels and no specific code
265 is enabled for handling selinux security labels.
266
267 Currently the following platforms support extended attributes:
268 \begin{itemize}
269  \item {\bf Darwin/OSX}
270  \item {\bf FreeBSD}
271  \item {\bf Linux}
272  \item {\bf NetBSD}
273 \end{itemize}
274
275 On linux acls are also extended attributes, as such when you enable ACLs on a
276 Linux platform it will NOT save the same data twice e.g. it will save the ACLs
277 and not the same exteneded attribute.
278
279 To enable the backup of extended attributes please add the following to your
280 fileset definition.
281 \begin{verbatim}
282   FileSet {
283     Name = "MyFileSet"
284     Include {
285       Options {
286         signature = MD5
287         xattrsupport = yes
288       }
289       File = ...
290     }
291   }
292 \end{verbatim}
293
294 \section{Shared objects}
295 \index[general]{Shared objects}
296 A default build of Bacula will now create the libraries as shared objects
297 (.so) rather than static libraries as was previously the case.  
298 The shared libraries are built using {\bf libtool} so it should be quite
299 portable.
300
301 An important advantage of using shared objects is that on a machine with the
302 Directory, File daemon, the Storage daemon, and a console, you will have only
303 one copy of the code in memory rather than four copies.  Also the total size of
304 the binary release is smaller since the library code appears only once rather
305 than once for every program that uses it; this results in significant reduction
306 in the size of the binaries particularly for the utility tools.
307  
308 In order for the system loader to find the shared objects when loading the
309 Bacula binaries, the Bacula shared objects must either be in a shared object
310 directory known to the loader (typically /usr/lib) or they must be in the
311 directory that may be specified on the {\bf ./configure} line using the {\bf
312   {-}{-}libdir} option as:
313
314 \begin{verbatim}
315   ./configure --libdir=/full-path/dir
316 \end{verbatim}
317
318 the default is /usr/lib. If {-}{-}libdir is specified, there should be
319 no need to modify your loader configuration provided that
320 the shared objects are installed in that directory (Bacula
321 does this with the make install command). The shared objects
322 that Bacula references are:
323
324 \begin{verbatim}
325 libbaccfg.so
326 libbacfind.so
327 libbacpy.so
328 libbac.so
329 \end{verbatim}
330
331 These files are symbolically linked to the real shared object file,
332 which has a version number to permit running multiple versions of
333 the libraries if desired (not normally the case).
334
335 If you have problems with libtool or you wish to use the old
336 way of building static libraries, you can do so by disabling
337 libtool on the configure command line with:
338
339 \begin{verbatim}
340   ./configure --disable-libtool
341 \end{verbatim}
342
343
344 \section{Virtual Backup (Vbackup)}
345 \index[general]{Virtual Backup}
346 \index[general]{Vbackup}
347
348 Bacula's virtual backup feature is often called Synthetic Backup or
349 Consolidation in other backup products.  It permits you to consolidate
350 the previous Full backup plus the most recent Differential backup and any
351 subsequent Incremental backups into a new Full backup. This is accomplished
352 without contacting the client by reading the previous backup data and 
353 writing it to a volume in a different pool.  
354
355 In some respects the Vbackup feature works similar to a Migration job, in
356 that Bacula normally reads the data from the pool specified in the 
357 Job resource, and writes it to the {\bf Next Pool} specified in the 
358 Job resource. Note, this means that usually the output from the Virtual
359 Backup is written into a different pool from where your prior backups
360 are saved. Doing it this way guarantees that you will not get a deadlock
361 situation attempting to read and write to the same volume in the Storage
362 daemon. If you then want to do subsequent backups, you may need to
363 move the Virtual Full Volume back to your normal backup pool.
364 Alternatively, you can set your {\bf Next Pool} to point to the current
365 pool.  This will cause Bacula to read and write to Volumes in the
366 current pool. In general, this will work, but doing the Virtual Full
367 requires reading more than one Volume, this procedure may cause a 
368 deadlock where Bacula is writing on a Volume that is later needed 
369 for reading.
370
371 The Vbackup is enabled on a Job by Job in the Job resource by specifying
372 a level of {\bf VirtualFull}.
373
374 A typical Job resource definition might look like the following:
375
376 \begin{verbatim}
377 Job {
378   Name = "MyBackup"
379   Type = Backup
380   Client=localhost-fd
381   FileSet = "Full Set"
382   Storage = File
383   Messages = Standard
384   Pool = Default
385   SpoolData = yes
386 }
387
388 # Default pool definition
389 Pool {
390   Name = Default
391   Pool Type = Backup
392   Recycle = yes            # Automatically recycle Volumes
393   AutoPrune = yes          # Prune expired volumes
394   Volume Retention = 365d  # one year
395   NextPool = Full
396   Storage = File
397 }
398
399 Pool {
400   Name = Full
401   Pool Type = Backup
402   Recycle = yes            # Automatically recycle Volumes
403   AutoPrune = yes          # Prune expired volumes
404   Volume Retention = 365d  # one year
405   Storage = DiskChanger
406 }
407
408 # Definition of file storage device
409 Storage {
410   Name = File
411   Address = localhost
412   Password = "xxx"
413   Device = FileStorage
414   Media Type = File
415   Maximum Concurrent Jobs = 5
416 }
417
418 # Definition of DDS Virtual tape disk storage device
419 Storage {
420   Name = DiskChanger
421   Address = localhost  # N.B. Use a fully qualified name here
422   Password = "yyy"
423   Device = DiskChanger
424   Media Type = DiskChangerMedia
425   Maximum Concurrent Jobs = 4
426   Autochanger = yes
427 }
428 \end{verbatim}
429
430 Then in bconsole or via a Run schedule, you would run the job as:
431
432 \begin{verbatim}
433 run job=MyBackup level=Full
434 run job=MyBackup level=Incremental
435 run job=MyBackup level=Differential
436 run job=MyBackup level=Incremental
437 run job=MyBackup level=Incremental
438 \end{verbatim}
439
440 So providing there were changes between each of those jobs, you would end up
441 with a Full backup, a Differential, which includes the first Incremental
442 backup, then two Incremental backups.  All the above jobs would be written to
443 the {\bf Default} pool.
444
445 To consolidate those backups into a new Full backup, you would run the
446 following:
447
448 \begin{verbatim}
449 run job=MyBackup level=VirtualFull
450 \end{verbatim}
451
452 And it would produce a new Full backup without using the client, and the output
453 would be written to the {\bf Full} Pool which uses the Diskchanger Storage.
454
455 If the Virtual Full is run, and there are no prior Jobs, the Virtual Full will
456 fail with an error.
457
458 Note, the Start and End time of the Virtual Full backup is set to the
459 values for the last job included in the Virtual Full (in the above example,
460 it is an Increment). This is so that if another incremental is done, which
461 will be based on the Virtual Full, it will backup all files from the
462 last Job included in the Virtual Full rather than from the time the Virtual
463 Full was actually run.
464
465
466
467 \section{Catalog Format}
468 \index[general]{Catalog Format}
469 Bacula 3.0 comes with some changes on the catalog format.  The upgrade
470 operation will convert an essential field of the File table that permits to
471 handle more than 4 billion objects over the time, and this operation will take
472 TIME and will likely DOUBLE THE SIZE of your catalog during the conversion.
473 You won't be able to run jobs during this period.  For example, a 3 million
474 files catalog will take 2 minutes to upgrade on a normal machine.  Please don't
475 forget to make a valid backup of your database before executing the upgrade
476 script.
477
478 \section{Duplicate Job Control}
479 \index[general]{Duplicate Jobs}
480 The new version of Bacula provides four new directives that
481 give additional control over what Bacula does if duplicate jobs 
482 are started.  A duplicate job in the sense we use it here means
483 a second or subsequent job with the same name starts.  This
484 happens most frequently when the first job runs longer than expected because no 
485 tapes are available.
486
487 The four directives each take as an argument a {\bf yes} or {\bf no} value and
488 are specified in the Job resource.
489
490 They are:
491
492 \subsection{Allow Duplicate Jobs = \lt{}yes|no\gt{}}
493 \index[general]{Allow Duplicate Jobs}
494   If this directive is enabled duplicate jobs will be run.  If
495   the directive is set to {\bf no} (default) then only one job of a given name
496   may run at one time, and the action that Bacula takes to ensure only
497   one job runs is determined by the other directives (see below).
498
499 \subsection{Allow Higher Duplicates = \lt{}yes|no\gt{}}
500 \index[general]{Allow Higher Duplicates}
501   If this directive is set to {\bf yes} (default) the job with a higher
502   priority (lower priority number) will be permitted to run.  If the
503   priorities of the two jobs are the same, the outcome is determined by
504   other directives (see below).
505
506 \subsection{Cancel Queued Duplicates = \lt{}yes|no\gt{}}
507 \index[general]{Cancel Queued Duplicates}
508   If this directive is set to {\bf yes} (default) any job that is
509   already queued to run but not yet running will be canceled.
510
511 \subsection{Cancel Running Duplicates = \lt{}yes|no\gt{}}
512 \index[general]{Cancel Running Duplicates}
513   If this directive is set to {\bf yes} any job that is already running
514   will be canceled.  The default is {\bf no}.
515
516
517 \section{TLS Authentication}
518 \index[general]{TLS Authentication}
519 In Bacula version 2.5.x and later, in addition to the normal Bacula
520 CRAM-MD5 authentication that is used to authenticate each Bacula
521 connection, you can specify that you want TLS Authentication as well,
522 which will provide more secure authentication.
523
524 This new feature uses Bacula's existing TLS code (normally used for
525 communications encryption) to do authentication.  To use it, you must
526 specify all the TLS directives normally used to enable communications
527 encryption (TLS Enable, TLS Verify Peer, TLS Certificate, ...) and
528 a new directive:
529
530 \subsection{TLS Authenticate = yes}
531 \begin{verbatim}
532 TLS Authenticate = yes
533 \end{verbatim}
534
535 in the main daemon configuration resource (Director for the Director,
536 Client for the File daemon, and Storage for the Storage daemon).
537
538 When {\bf TLS Authenticate} is enabled, after doing the CRAM-MD5
539 authentication, Bacula will do the normal TLS authentication, then TLS 
540 encryption will be turned off.
541
542 If you want to encrypt communications data, do not turn on {\bf TLS
543 Authenticate}.
544
545 \section{bextract non-portable Win32 data}
546 \index[general]{bextract handles Win32 non-portable data}
547 {\bf bextract} has been enhanced to be able to restore
548 non-portable Win32 data to any OS.  Previous versions were 
549 unable to restore non-portable Win32 data to machines that
550 did not have the Win32 BackupRead and BackupWrite API calls.
551
552 \section{State File updated at Job Termination}
553 \index[general]{State File}
554 In previous versions of Bacula, the state file, which provides a
555 summary of previous jobs run in the {\bf status} command output was
556 updated only when Bacula terminated, thus if the daemon crashed, the
557 state file might not contain all the run data.  This version of
558 the Bacula daemons updates the state file on each job termination.
559
560 \section{MaxFullInterval = \lt{}time-interval\gt{}}
561 \index[general]{MaxFullInterval}
562 The new Job resource directive {\bf Max Full Interval = \lt{}time-interval\gt{}}
563 can be used to specify the maximum time interval between {\bf Full} backup
564 jobs. When a job starts, if the time since the last Full backup is
565 greater than the specified interval, and the job would normally be an
566 {\bf Incremental} or {\bf Differential}, it will be automatically
567 upgraded to a {\bf Full} backup.
568
569 \section{MaxDiffInterval = \lt{}time-interval\gt{}}
570 \index[general]{MaxDiffInterval}
571 The new Job resource directive {\bf Max Diff Interval = \lt{}time-interval\gt{}}
572 can be used to specify the maximum time interval between {\bf Differential} backup
573 jobs. When a job starts, if the time since the last Differential backup is
574 greater than the specified interval, and the job would normally be an
575 {\bf Incremental}, it will be automatically
576 upgraded to a {\bf Differential} backup.
577
578 \section{Honor No Dump Flag = \lt{}yes|no\gt{}}
579 \index[general]{MaxDiffInterval}
580 On FreeBSD systems, each file has a {\bf no dump flag} that can be set
581 by the user, and when it is set it is an indication to backup programs
582 to not backup that particular file.  This version of Bacula contains a
583 new Options directive within a FileSet resource, which instructs Bacula to
584 obey this flag.  The new directive is:
585
586 \begin{verbatim}
587   Honor No Dump Flag = yes|no
588 \end{verbatim}
589
590 The default value is {\bf no}.
591
592
593 \section{Exclude Dirs Containing = \lt{}filename-string\gt{}}
594 \index[general]{IgnoreDir}
595 The {\bf ExcludeDirsContaining = \lt{}filename\gt{}} is a new directive that
596 can be added to the Include section of the FileSet resource.  If the specified
597 filename ({\bf filename-string}) is found on the Client in any directory to be
598 backed up, the whole directory will be ignored (not backed up).  For example:
599
600 \begin{verbatim}
601   # List of files to be backed up
602   FileSet {
603     Name = "MyFileSet"
604     Include {
605       Options {
606         signature = MD5
607       }
608       File = /home
609       Exclude Dirs Containing = .excludeme
610     }
611   }
612 \end{verbatim}
613
614 But in /home, there may be hundreds of directories of users and some
615 people want to indicate that they don't want to have certain
616 directories backed up. For example, with the above FileSet, if
617 the user or sysadmin creates a file named {\bf .excludeme} in 
618 specific directories, such as
619
620 \begin{verbatim}
621    /home/user/www/cache/.excludeme
622    /home/user/temp/.excludeme
623 \end{verbatim}
624
625 then Bacula will not backup the two directories named:
626
627 \begin{verbatim}
628    /home/user/www/cache
629    /home/user/temp
630 \end{verbatim}
631
632 NOTE: subdirectories will not be backed up.  That is, the directive
633 applies to the two directories in question and any children (be they
634 files, directories, etc).
635
636
637
638 \section{Bacula Plugins}
639 \index[general]{Plugin}
640 Support for shared object plugins has been implemented in the Linux, Unix
641 and Win32 File daemons. The API will be documented separately in
642 the Developer's Guide or in a new document.  For the moment, there is
643 a single plugin named {\bf bpipe} that allows an external program to
644 get control to backup and restore a file.
645
646 Plugins are also planned (partially implemented) in the Director and the
647 Storage daemon.  
648
649 \subsection{Plugin Directory}
650 \index[general]{Plugin Directory}
651 Each daemon (DIR, FD, SD) has a new {\bf Plugin Directory} directive that may
652 be added to the daemon definition resource. The directory takes a quoted 
653 string argument, which is the name of the directory in which the daemon can
654 find the Bacula plugins. If this directive is not specified, Bacula will not
655 load any plugins. Since each plugin has a distinctive name, all the daemons
656 can share the same plugin directory. 
657
658 \subsection{Plugin Options}
659 \index[general]{Plugin Options}
660 The {\bf Plugin Options} directive takes a quoted string
661 arguement (after the equal sign) and may be specified in the
662 Job resource.  The options specified will be passed to all plugins
663 when they are run.  This each plugin must know what it is looking
664 for. The value defined in the Job resource can be modified
665 by the user when he runs a Job via the {\bf bconsole} command line 
666 prompts.
667
668 Note: this directive may be specified, and there is code to modify
669 the string in the run command, but the plugin options are not yet passed to
670 the plugin (i.e. not fully implemented).
671
672 \subsection{Plugin Options ACL}
673 \index[general]{Plugin Options ACL}
674 The {\bf Plugin Options ACL} directive may be specified in the
675 Director's Console resource. It functions as all the other ACL commands
676 do by permitting users running restricted consoles to specify a 
677 {\bf Plugin Options} that overrides the one specified in the Job
678 definition. Without this directive restricted consoles may not modify
679 the Plugin Options.
680
681 \subsection{Plugin = \lt{}plugin-command-string\gt{}}
682 \index[general]{Plugin}
683 The {\bf Plugin} directive is specified in the Include section of
684 a FileSet resource where you put your {\bf File = xxx} directives.
685 For example:
686
687 \begin{verbatim}
688   FileSet {
689     Name = "MyFileSet"
690     Include {
691       Options {
692         signature = MD5
693       }
694       File = /home
695       Plugin = "bpipe:..."
696     }
697   }
698 \end{verbatim}
699
700 In the above example, when the File daemon is processing the directives
701 in the Include section, it will first backup all the files in {\bf /home}
702 then it will load the plugin named {\bf bpipe} (actually bpipe-dir.so) from
703 the Plugin Directory.  The syntax and semantics of the Plugin directive
704 require the first part of the string up to the colon (:) to be the name
705 of the plugin. Everything after the first colon is ignored by the File daemon but
706 is passed to the plugin. Thus the plugin writer may define the meaning of the
707 rest of the string as he wishes.
708
709 Please see the next section for information about the {\bf bpipe} Bacula
710 plugin.
711
712 \section{The bpipe Plugin}
713 \index[general]{The bpipe Plugin}
714 The {\bf bpipe} plugin is provided in the directory src/plugins/fd/bpipe-fd.c of
715 the Bacula source distribution. When the plugin is compiled and linking into
716 the resulting dynamic shared object (DSO), it will have the name {\bf bpipe-fd.so}.
717
718 The purpose of the plugin is to provide an interface to any system program for
719 backup and restore. As specified above the {\bf bpipe} plugin is specified in
720 the Include section of your Job's FileSet resource.  The full syntax of the
721 plugin directive as interpreted by the {\bf bpipe} plugin (each plugin is free
722 to specify the sytax as it wishes) is:
723
724 \begin{verbatim}
725   Plugin = "<field1>:<field2>:<field3>:<field4>"
726 \end{verbatim}
727
728 where
729 \begin{description}
730 \item {\bf field1} is the name of the plugin with the trailing {\bf -fd.so}
731 stripped off, so in this case, we would put {\bf bpipe} in this field.
732
733 \item {\bf field2} specifies the namespace, which for {\bf bpipe} is the
734 pseudo path and filename under which the backup will be saved. This pseudo
735 path and filename will be seen by the user in the restore file tree.
736 For example, if the value is {\bf /MYSQL/regress.sql}, the data
737 backed up by the plugin will be put under that "pseudo" path and filename.
738 You must be careful to choose a naming convention that is unique to avoid
739 a conflict with a path and filename that actually exists on your system.
740
741 \item {\bf field3} for the {\bf bpipe} plugin 
742 specifies the "reader" program that is called by the plugin during
743 backup to read the data. {\bf bpipe} will call this program by doing a
744 {\bf popen} on it.
745
746 \item {\bf field4} for the {\bf bpipe} plugin
747 specifies the "writer" program that is called by the plugin during
748 restore to write the data back to the filesystem.  
749 \end{description}
750
751 Putting it all together, the full plugin directive line might look
752 like the following:
753
754 \begin{verbatim}
755 Plugin = "bpipe:/MYSQL/regress.sql:mysqldump -f 
756           --opt --databases bacula:mysql"
757 \end{verbatim}
758
759 The directive has been split into two lines, but within the {\bf bacula-dir.conf} file
760 would be written on a single line.
761
762 This causes the File daemon to call the {\bf bpipe} plugin, which will write
763 its data into the "pseudo" file {\bf /MYSQL/regress.sql} by calling the 
764 program {\bf mysqldump -f --opt --database bacula} to read the data during
765 backup. The mysqldump command outputs all the data for the database named
766 {\bf bacula}, which will be read by the plugin and stored in the backup.
767 During restore, the data that was backed up will be sent to the program
768 specified in the last field, which in this case is {\bf mysql}.  When
769 {\bf mysql} is called, it will read the data sent to it by the plugn
770 then write it back to the same database from which it came ({\bf bacula}
771 in this case).
772
773 The {\bf bpipe} plugin is a generic pipe program, that simply transmits 
774 the data from a specified program to Bacula for backup, and then from Bacula to 
775 a specified program for restore.
776
777 By using different command lines to {\bf bpipe},
778 you can backup any kind of data (ASCII or binary) depending
779 on the program called.
780
781 \section{Microsoft Exchange Server 2003/2007 Plugin}
782 \index[general]{Microsoft Exchange Server 2003/2007 Plugin}
783 \subsection{Concepts}
784 Although it is possible to backup Exchange using Bacula VSS the Exchange 
785 plugin adds a good deal of functionality, because while Bacula VSS
786 completes a full backup (snapshot) of Exchange, it does
787 not support Incremental or Differential backups, restoring is more
788 complicated, and a single database restore is not possible.
789
790 Microsoft Exchange organises its storage into Storage Groups with
791 Databases inside them. A default installation of Exchange will have a
792 single Storage Group called 'First Storage Group', with two Databases
793 inside it, "Mailbox Store (SERVER NAME)" and 
794 "Public Folder Store (SERVER NAME)", 
795 which hold user email and public folders respectively.
796
797 In the default configuration, Exchange logs everything that happens to
798 log files, such that if you have a backup, and all the log files since,
799 you can restore to the present time. Each Storage Group has its own set
800 of log files and operates independently of any other Storage Groups. At
801 the Storage Group level, the logging can be turned off by enabling a
802 function called "Enable circular logging". At this time the Exchange
803 plugin will not function if this option is enabled.
804
805 The plugin allows backing up of entire storage groups, and the restoring
806 of entire storage groups or individual databases. Backing up and
807 restoring at the individual mailbox or email item is not supported but
808 can be simulated by use of the "Recovery" Storage Group (see below).
809
810 \subsection{Installing}
811 The Exchange plugin requires a DLL that is shipped with Microsoft
812 Exchanger Server called {\bf esebcli2.dll}. Assuming Exchange is installed
813 correctly the Exchange plugin should find this automatically and run
814 without any additional installation.
815
816 If the DLL can not be found automatically it will need to be copied into
817 the Bacula installation
818 directory (eg C:\verb+\+Program Files\verb+\+Bacula\verb+\+bin). The Exchange API DLL is
819 named esebcli2.dll and is found in C:\verb+\+Program Files\verb+\+Exchsrvr\verb+\+bin on a
820 default Exchange installation.
821
822 \subsection{Backup up}
823 To back up an Exchange server the Fileset definition must contain at
824 least {\bf Plugin = "exchange:/@EXCHANGE/Microsoft Information Store"} for
825 the backup to work correctly. The 'exchange:' bit tells Bacula to look
826 for the exchange plugin, the '@EXCHANGE' bit makes sure all the backed
827 up files are prefixed with something that isn't going to share a name
828 with something outside the plugin, and the 'Microsoft Information Store'
829 bit is required also. It is also possible to add the name of a storage
830 group to the "Plugin =" line, eg \\
831 {\bf Plugin = "exchange:/@EXCHANGE/Microsoft Information Store/First Storage Group"} \\
832 if you want only a single storage group backed up.
833
834 Additionally, you can suffix the 'Plugin =' directive with
835 ":notrunconfull" which will tell the plugin not to truncate the Exchange
836 database at the end of a full backup.
837
838 An Incremental or Differential backup will backup only the database logs
839 for each Storage Group by inspecting the "modified date" on each
840 physical log file. Because of the way the Exchange API works, the last
841 logfile backed up on each backup will always be backed up by the next
842 Incremental or Differential backup too. This adds 5MB to each
843 Incremental or Differential backup size but otherwise does not cause any
844 problems.
845
846 By default, a normal VSS fileset containing all the drive letters will
847 also back up the Exchange databases using VSS. This will interfere with
848 the plugin and Exchange's shared ideas of when the last full backup was
849 done, and may also truncate log files incorrectly. It is important,
850 therefore, that the Exchange database files be excluded from the backup,
851 although the folders the files are in should be included, or they will
852 have to be recreated manually if a baremetal restore is done.
853
854 \begin{verbatim}
855 FileSet {
856    Include {
857       File = C:/Program Files/Exchsrvr/mdbdata
858       Plugin = "exchange:..."
859    }
860    Exclude {
861       File = C:/Program Files/Exchsrvr/mdbdata/E00.chk
862       File = C:/Program Files/Exchsrvr/mdbdata/E00.log
863       File = C:/Program Files/Exchsrvr/mdbdata/E000000F.log
864       File = C:/Program Files/Exchsrvr/mdbdata/E0000010.log
865       File = C:/Program Files/Exchsrvr/mdbdata/E0000011.log
866       File = C:/Program Files/Exchsrvr/mdbdata/E00tmp.log
867       File = C:/Program Files/Exchsrvr/mdbdata/priv1.edb
868    }
869 }
870 \end{verbatim}
871
872 The advantage of excluding the above files is that you can significantly
873 reduce the size of your backup since all the important Exchange files
874 will be properly saved by the Plugin.
875
876
877 \subsection{Restoring}
878 The restore operation is much the same as a normal Bacula restore, with
879 the following provisos:
880
881 \begin{itemize}
882 \item  The {\bf Where} restore option must not be specified
883 \item Each Database directory must be marked as a whole. You cannot just
884      select (say) the .edb file and not the others.
885 \item If a Storage Group is restored, the directory of the Storage Group
886      must be marked too.
887 \item  It is possible to restore only a subset of the available log files,
888      but they {\bf must} be contiguous. Exchange will fail to restore correctly
889      if a log file is missing from the sequence of log files
890 \item Each database to be restored must be dismounted and marked as "Can be
891     overwritten by restore"
892 \item If an entire Storage Group is to be restored (eg all databases and
893    logs in the Storage Group), then it is best to manually delete the
894    database files from the server (eg C:\verb+\+Program Files\verb+\+Exchsrvr\verb+\+mdbdata\verb+\+*)
895    as Exchange can get confused by stray log files lying around.
896 \end{itemize}
897
898 \subsection{Restoring to the Recovery Storage Group}
899 The concept of the Recovery Storage Group is well documented by
900 Microsoft 
901 \elink{http://support.microsoft.com/kb/824126}{http://support.microsoft.com/kb/824126}, 
902 but to briefly summarize...
903
904 Microsoft Exchange allows the creation of an additional Storage Group
905 called the Recovery Storage Group, which is used to restore an older
906 copy of a database (e.g. before a mailbox was deleted) into without
907 messing with the current live data. This is required as the Standard and
908 Small Business Server versions of Exchange can not ordinarily have more
909 than one Storage Group.
910
911 To create the Recovery Storage Group, drill down to the Server in Exchange
912 System Manager, right click, and select
913 {\bf "New -> Recovery Storage Group..."}.  Accept or change the file
914 locations and click OK. On the Recovery Storage Group, right click and
915 select {\bf "Add Database to Recover..."} and select the database you will
916 be restoring.
917
918 Restore only the single database nominated as the database in the
919 Recovery Storage Group. Exchange will redirect the restore to the
920 Recovery Storage Group automatically.
921 Then run the restore.
922
923 \subsection{Restoring on Microsoft Server 2007}
924 Apparently the {\bf Exmerge} program no longer exists in Microsoft Server
925 2007, and henc you use a new proceedure for recovering a single mail box.
926 This procedure is ducomented by Microsoft at:
927 \elink{http://technet.microsoft.com/en-us/library/aa997694.aspx}{http://technet.microsoft.com/en-us/library/aa997694.aspx},
928 and involves using the {\bf Restore-Mailbox} and {\bf
929 Get-MailboxStatistics} shell commands.
930
931 \subsection{Caveats}
932 This plugin is still being developed, so you should consider it
933 currently in BETA test, and thus use in a production environment
934 should be done only after very careful testing.
935
936 When doing a full backup, the Exchange database logs are truncated by
937 Exchange as soon as the plugin has completed the backup. If the data
938 never makes it to the backup medium (eg because of spooling) then the
939 logs will still be truncated, but they will also not have been backed
940 up. A solution to this is being worked on. You will have to schedule a
941 new Full backup to ensure that your next backups will be usable.
942
943 The "Enable Circular Logging" option cannot be enabled or the plugin
944 will fail.
945
946 Exchange insists that a successful Full backup must have taken place if
947 an Incremental or Differential backup is desired, and the plugin will
948 fail if this is not the case. If a restore is done, Exchange will
949 require that a Full backup be done before an Incremental or Differential
950 backup is done.
951
952 The plugin will most likely not work well if another backup application
953 (eg NTBACKUP) is backing up the Exchange database, especially if the
954 other backup application is truncating the log files.
955
956 The Exchange plugin has not been tested with the {\bf Accurate} option, so
957 we recommend either carefully testing or that you avoid this option for
958 the current time.
959
960 The Exchange plugin is not called during processing the bconsole {\bf
961 estimate} command, and so anything that would be backed up by the plugin
962 will not be added to the estimate total that is displayed.
963
964
965 \section{libdbi Framework}
966 \index[general]{libdbi Framework}
967 As a general guideline, Bacula has support for a few catalog database drivers
968 (MySQL, PostgreSQL, SQLite)
969 coded natively by the Bacula team.  With the libdbi implementation, which is a
970 Bacula driver that uses libdbi to access the catalog, we have an open field to
971 use many different kinds database engines following the needs of users.
972
973 The according to libdbi (http://libdbi.sourceforge.net/) project: libdbi
974 implements a database-independent abstraction layer in C, similar to the
975 DBI/DBD layer in Perl. Writing one generic set of code, programmers can
976 leverage the power of multiple databases and multiple simultaneous database
977 connections by using this framework.
978
979 Currently the libdbi driver in Bacula project only supports the same drivers
980 natively coded in Bacula.  However the libdbi project has support for many
981 others database engines. You can view the list at
982 http://libdbi-drivers.sourceforge.net/. In the future all those drivers can be
983 supported by Bacula, however, they must be tested properly by the Bacula team.
984
985 Some of benefits of using libdbi are:
986 \begin{itemize}
987 \item The possibility to use proprietary databases engines in which your
988   proprietary licenses prevent the Bacula team from developing the driver.
989  \item The possibility to use the drivers written for the libdbi project.
990  \item The possibility to use other database engines without recompiling Bacula
991    to use them.  Just change one line in bacula-dir.conf
992  \item Abstract Database access, this is, unique point to code and profiling
993    catalog database access.
994  \end{itemize}
995  
996  The following drivers have been tested:
997  \begin{itemize}
998  \item PostgreSQL, with and without batch insert
999  \item Mysql, with and without batch insert
1000  \item SQLite
1001  \item SQLite3
1002  \end{itemize}
1003
1004  In the future, we will test and approve to use others databases engines
1005  (proprietary or not) like DB2, Oracle, Microsoft SQL.
1006
1007  To compile Bacula to support libdbi we need to configure the code with the
1008  --with-dbi and --with-dbi-driver=[database] ./configure options, where
1009  [database] is the database engine to be used with Bacula (of course we can
1010  change the driver in file bacula-dir.conf, see below).  We must configure the
1011  access port of the database engine with the option --with-db-port, because the
1012  libdbi framework doesn't know the default access port of each database.
1013
1014 The next phase is checking (or configuring) the bacula-dir.conf, example:
1015 \begin{verbatim}
1016 Catalog {
1017   Name = MyCatalog
1018   dbdriver = dbi:mysql; dbaddress = 127.0.0.1; dbport = 3306
1019   dbname = regress; user = regress; password = ""
1020 }
1021 \end{verbatim}
1022
1023 The parameter {\bf dbdriver} indicates that we will use the driver dbi with a
1024 mysql database.  Currently the drivers supported by Bacula are: postgresql,
1025 mysql, sqlite, sqlite3; these are the names that may be added to string "dbi:".
1026
1027 The following limitations apply when Bacula is set to use the libdbi framework:
1028  - Not tested on the Win32 platform
1029  - A little performance is lost if comparing with native database driver. 
1030    The reason is bound with the database driver provided by libdbi and the 
1031    simple fact that one more layer of code was added.
1032
1033 It is important to remember, when compiling Bacula with libdbi, the
1034 following packages are needed:
1035  \begin{itemize}
1036   \item libdbi version 1.0.0, http://libdbi.sourceforge.net/
1037   \item libdbi-drivers 1.0.0, http://libdbi-drivers.sourceforge.net/
1038  \end{itemize}
1039  
1040  You can download them and compile them on your system or install the packages
1041  from your OS distribution.
1042
1043 \section{Console Command Additions and Enhancements}
1044 \index[general]{Console Additions}                                 
1045
1046 \subsection{Display Autochanger Content}
1047 \index[general]{StatusSlots}
1048
1049 The {\bf status slots storage=\lt{}storage-name\gt{}} command displays
1050 autochanger content.
1051
1052 \footnotesize
1053 \begin{verbatim}
1054  Slot |  Volume Name  |  Status  |  Media Type       |   Pool     |
1055 ------+---------------+----------+-------------------+------------|
1056     1 |         00001 |   Append |  DiskChangerMedia |    Default |
1057     2 |         00002 |   Append |  DiskChangerMedia |    Default |
1058     3*|         00003 |   Append |  DiskChangerMedia |    Scratch |
1059     4 |               |          |                   |            |
1060 \end{verbatim}
1061 \normalsize
1062
1063 If you an asterisk ({\bf *}) appears after the slot number, you must run an
1064 {\bf update slots} command to synchronize autochanger content with your
1065 catalog.
1066
1067 \subsection{list joblog job=xxx or jobid=nnn}
1068 \index[general]{list joblog}
1069 A new list command has been added that allows you to list the contents
1070 of the Job Log stored in the catalog for either a Job Name (fully qualified)
1071 or for a particular JobId.  The {\bf llist} command will include a line with
1072 the time and date of the entry.
1073
1074 Note for the catalog to have Job Log entries, you must have a directive 
1075 such as:
1076
1077 \begin{verbatim}
1078   catalog = all
1079 \end{verbatim}
1080
1081 In your Director's {\bf Messages} resource.
1082
1083 \subsection{Use separator for multiple commands}
1084 \index[general]{Command Separator}
1085   When using bconsole with readline, you can set the command separator to one
1086   of those characters to write commands who require multiple input in one line.
1087 \begin{verbatim}
1088   !$%&'()*+,-/:;<>?[]^`{|}~
1089 \end{verbatim}
1090
1091 \section{Miscellaneous}
1092 \index[general]{Misc New Features}
1093
1094 \subsection{Allow Mixed Priority = \lt{}yes|no\gt{}}
1095 \index[general]{Allow Mixed Priority}
1096    This directive is only implemented in version 2.5 and later.  When
1097    set to {\bf yes} (default {\bf no}), this job may run even if lower
1098    priority jobs are already running.  This means a high priority job
1099    will not have to wait for other jobs to finish before starting.
1100    The scheduler will only mix priorities when all running jobs have
1101    this set to true.
1102
1103    Note that only higher priority jobs will start early.  Suppose the
1104    director will allow two concurrent jobs, and that two jobs with
1105    priority 10 are running, with two more in the queue.  If a job with
1106    priority 5 is added to the queue, it will be run as soon as one of
1107    the running jobs finishes.  However, new priority 10 jobs will not
1108    be run until the priority 5 job has finished.
1109
1110 \subsection{Bootstrap File Directive -- FileRegex}
1111 \index[general]{Bootstrap File Directive}
1112   {\bf FileRegex} is a new command that can be added to the bootstrap
1113   (.bsr) file.  The value is a regular expression.  When specified, only
1114   matching filenames will be restored.
1115
1116   During a restore, if all File records are pruned from the catalog
1117   for a Job, normally Bacula can restore only all files saved. That
1118   is there is no way using the catalog to select individual files.
1119   With this new feature, Bacula will ask if you want to specify a Regex
1120   expression for extracting only a part of the full backup.
1121
1122 \begin{verbatim}
1123   Building directory tree for JobId(s) 1,3 ...
1124   There were no files inserted into the tree, so file selection
1125   is not possible.Most likely your retention policy pruned the files
1126   
1127   Do you want to restore all the files? (yes|no): no
1128   
1129   Regexp matching files to restore? (empty to abort): /tmp/regress/(bin|tests)/
1130   Bootstrap records written to /tmp/regress/working/zog4-dir.restore.1.bsr
1131 \end{verbatim}
1132
1133 \subsection{Bootstrap File Optimization Changes}
1134 In order to permit proper seeking on disk files, we have extended the bootstrap
1135 file format to include a {\bf VolStartAddr} and {\bf VolEndAddr} records. Each
1136 takes a 64 bit unsigned integer range (i.e. nnn-mmm) which defines the start
1137 address range and end address range respectively.  These two directives replace
1138 the {\bf VolStartFile}, {\bf VolEndFile}, {\bf VolStartBlock} and {\bf
1139   VolEndBlock} directives.  Bootstrap files containing the old directives will
1140 still work, but will not properly take advantage of proper disk seeking, and
1141 may read completely to the end of a disk volume during a restore.  With the new
1142 format (automatically generated by the new Director), restores will seek
1143 properly and stop reading the volume when all the files have been restored.
1144
1145 \subsection{Solaris ZFS/NFSv4 ACLs}
1146 This is an upgrade of the previous Solaris ACL backup code
1147 to the new library format, which will backup both the old
1148 POSIX(UFS) ACLs as well as the ZFS ACLs.
1149
1150 The new code can also restore POSIX(UFS) ACLs to a ZFS filesystem
1151 (it will translate the POSIX(UFS)) ACL into a ZFS/NFSv4 one) it can also
1152 be used to transfer from UFS to ZFS filesystems.
1153
1154
1155 \subsection{Virtual Tape Emulation}
1156 \index[general]{Virtual Tape Emulation}
1157 We now have a Virtual Tape emulator that allows us to run though 99.9\% of
1158 the tape code but actually reading and writing to a disk file. Used with the
1159 \textbf{disk-changer} script, you can now emulate an autochanger with 10 drives
1160 and 700 slots. This feature is most useful in testing.  It is enabled
1161 by using {\bf Device Type = vtape} in the Storage daemon's Device
1162 directive. This feature is only implemented on Linux machines.
1163
1164 \subsection{Bat Enhancements}
1165 \index[general]{Bat Enhancements}
1166 Bat (the Bacula Administration Tool) GUI program has been significantly
1167 enhanced and stabilized. In particular, there are new table based status 
1168 commands; it can now be easily localized using Qt4 Linguist.
1169
1170 The Bat communications protocol has been significantly enhanced to improve
1171 GUI handling. Note, you {\bf must} use a the bat that is distributed with
1172 the Director you are using otherwise the communications protocol will not
1173 work.
1174
1175 \subsection{RunScript Enhancements}
1176 \index[general]{RunScript Enhancements}
1177 The {\bf RunScript} resource has been enhanced to permit multiple
1178 commands per RunScript.  Simply specify multiple {\bf Command} directives
1179 in your RunScript.
1180
1181 \begin{verbatim}
1182 Job {
1183   Name = aJob
1184   RunScript {
1185     Command = "/bin/echo test"
1186     Command = "/bin/echo an other test"
1187     Command = "/bin/echo 3 commands in the same runscript"
1188     RunsWhen = Before
1189   }
1190  ...
1191 }
1192 \end{verbatim}
1193
1194 A new Client RunScript {\bf RunsWhen} keyword of {\bf AfterVSS} has been
1195 implemented, which runs the command after the Volume Shadow Copy has been made.
1196
1197 Console commands can be specified within a RunScript by using:
1198 {\bf Console = \lt{}command\gt{}}, however, this command has not been 
1199 carefully tested and debugged and is known to easily crash the Director.
1200 We would appreciate feedback.  Due to the recursive nature of this command, we
1201 may remove it before the final release.
1202
1203 \subsection{Status Enhancements}
1204 \index[general]{Status Enhancements}
1205 The bconsole {\bf status dir} output has been enhanced to indicate
1206 Storage daemon job spooling and despooling activity.
1207
1208 \subsection{Connect Timeout}
1209 \index[general]{Connect Timeout}
1210 The default connect timeout to the File
1211 daemon has been set to 3 minutes. Previously it was 30 minutes.
1212
1213 \subsection{ftruncate for NFS Volumes}
1214 \index[general]{ftruncate for NFS Volumes}
1215 If you write to a Volume mounted by NFS (say on a local file server),
1216 in previous Bacula versions, when the Volume was recycled, it was not
1217 properly truncated because NFS does not implement ftruncate (file 
1218 truncate). This is now corrected in the new version because we have
1219 written code (actually a kind user) that deletes and recreates the Volume,
1220 thus accomplishing the same thing as a truncate.
1221
1222 \subsection{Support for Ubuntu}
1223 The new version of Bacula now recognizes the Ubuntu (and Kubuntu)
1224 version of Linux, and thus now provides correct autostart routines.
1225 Since Ubuntu officially supports Bacula, you can also obtain any
1226 recent release of Bacula from the Ubuntu repositories.
1227
1228 \subsection{Recycle Pool = \lt{}pool-name\gt{}}
1229 \index[general]{Recycle Pool}
1230 The new \textbf{RecyclePool} directive defines to which pool the Volume will
1231 be placed (moved) when it is recycled. Without this directive, a Volume will
1232 remain in the same pool when it is recycled. With this directive, it can be
1233 moved automatically to any existing pool during a recycle. This directive is
1234 probably most useful when defined in the Scratch pool, so that volumes will
1235 be recycled back into the Scratch pool.
1236
1237 \subsection{FD Version}
1238 \index[general]{FD Version}
1239 The File daemon to Director protocol now includes a version 
1240 number, which although there is no visible change for users, 
1241 will help us in future versions automatically determine
1242 if a File daemon is not compatible.
1243
1244 \subsection{Max Run Sched Time = \lt{}time-period-in-seconds\gt{}}
1245 \index[general]{Max Run Sched Time}
1246 The time specifies the maximum allowed time that a job may run, counted from
1247 when the job was scheduled. This can be useful to prevent jobs from running
1248 during working hours. We can see it like \texttt{Max Start Delay + Max Run
1249   Time}.
1250
1251 \subsection{Max Wait Time = \lt{}time-period-in-seconds\gt{}}
1252 \index[general]{Max Wait Time}
1253 Previous \textbf{MaxWaitTime} directives aren't working as expected, instead
1254 of checking the maximum allowed time that a job may block for a resource,
1255 those directives worked like \textbf{MaxRunTime}. Some users are reporting to
1256 use \textbf{Incr/Diff/Full Max Wait Time} to control the maximum run time of
1257 their job depending on the level. Now, they have to use
1258 \textbf{Incr/Diff/Full Max Run Time}.  \textbf{Incr/Diff/Full Max Wait Time}
1259 directives are now deprecated.
1260
1261 \subsection{Incremental|Differential Max Wait Time = \lt{}time-period-in-seconds\gt{}} 
1262 \index[general]{Incremental Max Wait Time}
1263 \index[general]{Differential Max Wait Time}
1264
1265 These directives have been deprecated in favor of
1266 \texttt{Incremental|Differential Max Run Time}.
1267
1268 \subsection{Max Run Time directives}
1269 \index[general]{Max Run Time directives}
1270 Using \textbf{Full/Diff/Incr Max Run Time}, it's now possible to specify the
1271 maximum allowed time that a job can run depending on the level.
1272
1273 \addcontentsline{lof}{figure}{Job time control directives}
1274 \includegraphics{\idir different_time.eps}
1275
1276 \subsection{Statistics Enhancements}
1277 \index[general]{Statistics Enhancements}
1278 If you (or probably your boss) want to have statistics on your backups to
1279 provide some \textit{Service Level Agreement} indicators, you could use a few
1280 SQL queries on the Job table to report how many:
1281
1282 \begin{itemize}
1283 \item jobs have run
1284 \item jobs have been successful
1285 \item files have been backed up
1286 \item ...
1287 \end{itemize}
1288
1289 However, these statistics are accurate only if your job retention is greater
1290 than your statistics period. Ie, if jobs are purged from the catalog, you won't
1291 be able to use them. 
1292
1293 Now, you can use the \textbf{update stats [days=num]} console command to fill
1294 the JobHistory table with new Job records. If you want to be sure to take in
1295 account only \textbf{good jobs}, ie if one of your important job has failed but
1296 you have fixed the problem and restarted it on time, you probably want to
1297 delete the first \textit{bad} job record and keep only the successful one. For
1298 that simply let your staff do the job, and update JobHistory table after two or
1299 three days depending on your organization using the \textbf{[days=num]} option.
1300
1301 These statistics records aren't used for restoring, but mainly for
1302 capacity planning, billings, etc.
1303
1304 The Bweb interface provides a statistics module that can use this feature. You
1305 can also use tools like Talend or extract information by yourself.
1306
1307 The {\textbf Statistics Retention = \lt{}time\gt{}} director directive defines
1308 the length of time that Bacula will keep statistics job records in the Catalog
1309 database after the Job End time. (In \texttt{JobHistory} table) When this time
1310 period expires, and if user runs \texttt{prune stats} command, Bacula will
1311 prune (remove) Job records that are older than the specified period.
1312
1313 You can use the following Job resource in your nightly \textbf{BackupCatalog}
1314 job to maintain statistics.
1315 \begin{verbatim}
1316 Job {
1317   Name = BackupCatalog
1318   ...
1319   RunScript {
1320     Console = "update stats days=3"
1321     Console = "prune stats yes"
1322     RunsWhen = After
1323     RunsOnClient = no
1324   }
1325 }
1326 \end{verbatim}
1327
1328 \subsection{ScratchPool = \lt{}pool-resource-name\gt{}}
1329 \index[general]{ScratchPool}
1330 This directive permits to specify a specific \textsl{Scratch} pool for the
1331 current pool. This is useful when using multiple storage sharing the same
1332 mediatype or when you want to dedicate volumes to a particular set of pool.
1333
1334 \subsection{Enhanced Attribute Despooling}
1335 \index[general]{Attribute Despooling}
1336 If the storage daemon and the Director are on the same machine, the spool file
1337 that contains attributes is read directly by the Director instead of being
1338 transmitted across the network. That should reduce load and speedup insertion.
1339
1340 \subsection{SpoolSize = \lt{}size-specification-in-bytes\gt{}}
1341 \index[general]{SpoolSize}
1342 A new Job directive permits to specify the spool size per job. This is used
1343 in advanced job tunning. {\bf SpoolSize={\it bytes}}
1344
1345 \subsection{MaxConsoleConnections = \lt{}number\gt{}}
1346 \index[general]{MaxConsoleConnections}
1347 A new director directive permits to specify the maximum number of Console
1348 Connections that could run concurrently. The default is set to 20, but you may
1349 set it to a larger number.
1350
1351 \subsection{dbcheck enhancements}
1352 \index[general]{dbcheck enhancements}
1353 If you are using Mysql, dbcheck will now ask you if you want to create
1354 temporary indexes to speed up orphaned Path and Filename elimination. 
1355
1356 A new \texttt{-B} option allows you to print catalog information in a simple
1357 text based format. This is useful to backup it in a secure way.
1358
1359 \begin{verbatim}
1360  $ dbcheck -B 
1361  catalog=MyCatalog
1362  db_type=SQLite
1363  db_name=regress
1364  db_driver=
1365  db_user=regress
1366  db_password=
1367  db_address=
1368  db_port=0
1369  db_socket=
1370 \end{verbatim} %$
1371
1372 You can now specify the database connection port in the command line.
1373
1374 \subsection{{-}{-}docdir configure option}
1375 You can use {-}{-}docdir= on the ./configure command to
1376 specify the directory where you want Bacula release documentation 
1377 placed.  This document consists of a number of small files such as
1378 LICENSE, ReleaseNotes, ChangeLog, ...   The default is 
1379 {\bf /usr/share/doc/bacula}.
1380       
1381 \subsection{{-}{-}htmlir configure option}
1382 You can use {-}{-}htmldir= on the ./configure command to
1383 specify the directory where you want Bacula bat html help files
1384 placed.  The default is {\bf /usr/share/doc/bacula/html}
1385