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