]> git.sur5r.net Git - bacula/docs/blob - docs/manuals/en/main/newfeatures.tex
More updates to newfeatures
[bacula/docs] / docs / manuals / en / main / newfeatures.tex
1 \chapter{New Features in 7.0.0}
2 This chapter presents the new features that have been added to the next
3 Community version of Bacula that is not yet released.
4
5 \section{New Features in 7.0.0}
6
7 \subsection{Storage daemon to Storage daemon}
8 Bacula version 7.0 permits SD to SD transfer of Copy and Migration
9 Jobs. This permits what is commonly referred to as replication or
10 off-site transfer of Bacula backups.  It occurs automatically, if
11 the source SD and destination SD of a Copy or Migration job are
12 different. The following picture shows how this works.
13
14 \includegraphics[width=0.8\linewidth]{sd-to-sd}
15
16 \subsection{SD Calls Client}
17 If the {\bf SD Calls Client} directive is set to true in a Client resource
18 any Backup, Restore, Verify, Copy, or Migration Job where the client
19 is involved, the client will wait for the Storage daemon to contact it.
20 By default this directive is set to false, and the Client will call
21 the Storage daemon.  This directive can be useful if your Storage daemon
22 is behind a firewall that permits outgoing connections but not incoming
23 one. The following picture shows the communications connection paths in
24 both cases.
25
26 \includegraphics[width=0.8\linewidth]{sd-calls-client}
27
28 \subsection{Data Encryption Cipher Configuration}
29 Bacula version 7.0 and later now allows to configure the data
30 encryption cipher and the digest algorithm. The cipher was forced to AES
31 128,
32 and it is now possible to choose between the following ciphers:
33
34 \begin{itemize}
35 \item AES128 (default)
36 \item AES192
37 \item AES256
38 \item blowfish
39 \end{itemize}
40
41 The digest algorithm was set to SHA1 or SHA256 depending on the local
42 OpenSSL
43 options. We advise you to not modify the PkiDigest default setting. Please,
44 refer to OpenSSL documentation to know about pro and cons on these options.
45
46 \begin{verbatim}
47   FileDaemon {
48     ...
49     PkiCipher = AES256
50   }
51 \end{verbatim}
52
53 \subsection{New Truncate Command}
54 We have added a new truncate command to bconsole, which
55 will truncate a Volume if the Volume is purged and if
56 the Volume is also marked {\bf Action On Purge = Truncate}.
57 This feature was originally added in Bacula version 5.0.1,
58 but the mechanism for actually doing the truncate required
59 the user to enter a command such as:
60
61 \begin{verbatim}
62 purge volume action=truncate storage=File pool=Default
63 \end{verbatim}
64
65 The above command is now simplified to be:
66
67 \begin{verbatim}
68 truncate storage=File pool=Default
69 \end{verbatim}
70
71 \subsection{New Resume Command}
72 This command does exactly the same thing as a 
73 {\bf restart} command but for some users the
74 name may be more logical since in general the 
75 {\bf restart} command is used to resume running
76 a Job that was incompleted.
77
78 \subsection{Migration/Copy/VirtualFull Performance Enhancements}
79 The Bacula Storage daemon now permits multiple jobs to simultaneously read
80 the same disk Volume, which gives substantial performance enhancements when
81 running Migration, Copy, or VirtualFull jobs that read disk Volumes.  Our
82 testing shows that when running multiple simultaneous jobs, the jobs can
83 finish up to ten times faster with this version of Bacula.  This is
84 built-in to the Storage daemon, so it happens automatically and
85 transparently.
86
87 \subsection{FD Storage Address}
88
89 When the Director is behind a NAT, in a WAN area, to connect to
90 % the FileDaemon or
91 the StorageDaemon, the Director uses an ``external'' ip address,
92 and the FileDaemon should use an ``internal'' IP address to contact the
93 StorageDaemon.
94
95 The normal way to handle this situation is to use a canonical name such as
96 ``storage-server'' that will be resolved on the Director side as the WAN
97 address and on the Client side as the LAN address. This is now possible to
98 configure this parameter using the new directive \texttt{FDStorageAddress} in
99 the Storage or Client resource.
100
101
102 \includegraphics[width=0.8\linewidth]{BackupOverWan1}
103 \label{fig:fdstorageaddress}
104
105 \begin{verbatim}
106 Storage {
107      Name = storage1
108      Address = 65.1.1.1
109      FD Storage Address = 10.0.0.1
110      SD Port = 9103
111      ...
112 }
113 \end{verbatim}
114
115 % # or in the Client resouce
116 %
117
118 \begin{verbatim}
119  Client {
120       Name = client1
121       Address = 65.1.1.2
122       FD Storage Address = 10.0.0.1
123       FD Port = 9102
124       ...
125  }
126 \end{verbatim}
127
128 Note that using the Client \texttt{FDStorageAddress} directive will not allow
129 to use multiple Storage Daemon, all Backup or Restore requests will be sent to
130 the specified \texttt{FDStorageAddress}.
131
132 \subsection{Job Bandwidth Limitation}
133
134 The new {\bf Job Bandwidth Limitation} directive may be added to the File
135 daemon's and/or Director's configuration to limit the bandwidth used by a
136 Job on a Client.  It can be set in the File daemon's conf file for all Jobs
137 run in that File daemon, or it can be set for each Job in the Director's
138 conf file. The speed is always specified in bytes per second.
139
140 For example:
141 \begin{verbatim}
142 FileDaemon {
143   Name = localhost-fd
144   Working Directory = /some/path
145   Pid Directory = /some/path
146   ...
147   Maximum Bandwidth Per Job = 5Mb/s
148 }
149 \end{verbatim}
150
151 The above example would cause any jobs running with the FileDaemon to not
152 exceed 5 megabytes per second of throughput when sending data to the
153 Storage Daemon. Note, the speed is always specified in bytes per second
154 (not in bits per second), and the case (upper/lower) of the specification
155 characters is ignored (i.e. 1MB/s = 1Mb/s).
156
157 You may specify the following speed parameter modifiers:
158    k/s (1,000 bytes per second), kb/s (1,024 bytes per second),
159    m/s (1,000,000 bytes per second), or mb/s (1,048,576 bytes per second).
160
161 For example:
162 \begin{verbatim}
163 Job {
164   Name = locahost-data
165   FileSet = FS_localhost
166   Accurate = yes
167   ...
168   Maximum Bandwidth = 5Mb/s
169   ...
170 }
171 \end{verbatim}
172
173 The above example would cause Job \texttt{localhost-data} to not exceed 5MB/s
174 of throughput when sending data from the File daemon to the Storage daemon.
175
176 A new console command \texttt{setbandwidth} permits to set dynamically the
177 maximum throughput of a running Job or for future jobs of a Client.
178
179 \begin{verbatim}
180 * setbandwidth limit=1000 jobid=10
181 \end{verbatim}
182
183 Please note that the value specified for the \texttt{limit} command
184 line parameter is always in units of 1024 bytes (i.e. the number
185 is multiplied by 1024 to give the number of bytes per second).  As 
186 a consequence, the above limit of 1000 will be interpreted as a
187 limit of 1000 * 1024 = 1,024,000 bytes per second.
188
189 \medskip
190 This project was funded by Bacula Systems.
191
192
193 \subsection{Maximum Concurrent Read Jobs}
194 This is a new directive that can be used in the {\bf bacula-dir.conf} file
195 in the Storage resource.  The main purpose is to limit the number
196 of concurrent Copy, Migration, and VirtualFull jobs so that
197 they don't monopolize all the Storage drives causing a deadlock situation
198 where all the drives are allocated for reading but none remain for
199 writing.  This deadlock situation can occur when running multiple
200 simultaneous Copy, Migration, and VirtualFull jobs.
201
202 \smallskip
203 The default value is set to 0 (zero), which means there is no
204 limit on the number of read jobs.  Note, limiting the read jobs
205 does not apply to Restore jobs, which are normally started by
206 hand.  A reasonable value for this directive is one half the number
207 of drives that the Storage resource has rounded down.  Doing so,
208 will leave the same number of drives for writing and will generally
209 avoid over committing drives and a deadlock.
210
211
212 \subsection{Director job Codes in Message Resource Commands}
213 Before submitting the specified mail command to the operating system, Bacula
214 performs character substitution like in Runscript commands. Bacula will now
215 perform also specific Director character substitution.
216
217 \smallskip{}
218 The code for this feature was contributed by Bastian Friedrich.
219
220 \subsection{Additions to RunScript variables}
221 The following variables are now available in runscripts:
222 \begin{itemize}
223 \item current PID using \%P
224 \item if the job is a clone job using \%C
225 \end{itemize}
226
227 \begin{verbatim}
228 RunAfterJob = "/bin/echo Pid=%P isCloned=%C" 
229
230 \end{verbatim}
231
232 \subsection{Read Only Storage Devices}
233 This version of Bacula permits defining a Storage deamon device
234 to be read-only. That is if the {\bf ReadOnly} directive is specified and
235 enabled, the drive can only be used for read operations.
236 The the {\bf ReadOnly} directive can be defined in any bacula-sd.conf
237 Device resource, and is most useful to reserve one or more 
238 drives for restores. An example is:
239
240 \begin{verbatim}
241 Read Only = yes
242 \end{verbatim}
243
244 \subsection{New Prune ``Expired'' Volume Command}
245 It is now possible to prune all volumes
246 (from a pool, or globally) that are ``expired''.  This option can be
247 scheduled after or before the backup of the Catalog and can be
248 combined with the Truncate On Purge option.  The Expired Prune option can
249 be used instead of the \texttt{manual\_prune.pl} script.
250
251 \begin{verbatim}
252 * prune expired volumes
253
254 * prune expired volumes pool=FullPool
255 \end{verbatim}
256
257 To schedule this option automatically, it can be added to the BackupCatalog job
258 definition.
259
260 \begin{verbatim}
261  Job {
262    Name = CatalogBackup
263    ...
264    RunScript {
265      Console = "prune expired volume yes"
266      RunsWhen = Before
267    }
268  }
269 \end{verbatim}
270
271
272 \subsection*{New Debug Options}
273
274 In Bacula Enterprise version 8.0 and later, we introduced new options to
275 the \texttt{setdebug} command.
276
277 \smallskip{}
278
279 If the \texttt{options} parameter is set, the following arguments can be
280 used to control debug functions.
281
282 \begin{itemize}
283 \item [0] clear debug flags
284 \item [i] Turn off, ignore bwrite() errors on restore on File Daemon
285 \item [d] Turn off decomp of BackupRead() streams on File Daemon
286 \item [t] Turn on timestamp in traces
287 \item [T] Turn off timestamp in traces
288 \item [c] Truncate trace file if trace file is activated
289 \item [l] Turn on recoding events on P() and V()
290 \item [p] Turn on the display of the event ring when doing a bactrace
291 \end{itemize}
292
293 \smallskip{}
294
295 The following command will truncate the trace file and will turn on timestamps
296 in the trace file.
297
298 \begin{verbatim}
299 * setdebug level=10 trace=1 options=ct fd
300 \end{verbatim}
301
302 \smallskip{}
303
304 It is now possible to use \textsl{class} of debug messages called \texttt{tags}
305 to control the debug output of Bacula daemons.
306
307 \begin{itemize}
308 \item [all] Display all debug messages
309 \item [bvfs] Display BVFS debug messages
310 \item [sql] Display SQL related debug messages
311 \item [memory] Display memory and poolmem allocation messages
312 \item [scheduler] Display scheduler related debug messages
313 \end{itemize}
314
315 \begin{verbatim}
316 * setdebug level=10 tags=bvfs,sql,memory
317 * setdebug level=10 tags=!bvfs
318
319 # bacula-dir -t -d 200,bvfs,sql
320 \end{verbatim}
321
322 The \texttt{tags} option is composed of a list of tags, tags are separated by
323 ``,'' or ``+'' or ``-'' or ``!''. To disable a specific tag, use ``-'' or ``!''
324 in front of the tag. Note that more tags will come in future versions.
325
326 %\LTXtable{\linewidth}{table_debugtags}
327
328
329 \chapter{New Features in 5.2.13}
330 This chapter presents the new features that have been added to the current
331 Community version of Bacula that is now released.
332
333 \subsection{Additions to RunScript variables}
334 You can have access to Director name using \%D in your runscript
335 command.
336
337 \begin{verbatim}
338 RunAfterJob = "/bin/echo Director=%D 
339 \end{verbatim}
340
341 \section{New Features in 5.2.1}
342 This chapter presents the new features were added in the
343 Community release version 5.2.1.
344
345 There are additional features (plugins) available in the Enterprise version
346 that are described in another chapter. A subscription to Bacula Systems
347 is required for the Enterprise version.
348
349 \subsection{LZO Compression}
350
351 LZO compression has been to the File daemon. From the user's point of view,
352 it works like the GZIP compression (just replace {\bf compression=GZIP} with
353 {\bf compression=LZO}).
354
355 For example:
356 \begin{verbatim}
357 Include {
358    Options {compression=LZO }
359    File = /home
360    File = /data
361 }
362 \end{verbatim}
363
364 LZO provides a much faster compression and decompression speed but lower
365 compression ratio than GZIP. It is a good option when you backup to disk. For
366 tape, the hardware compression is almost always a better option.
367
368 LZO is a good alternative for GZIP1 when you don't want to slow down your
369 backup. With a modern CPU it should be able to run almost as fast as:
370
371 \begin{itemize}
372 \item your client can read data from disk. Unless you have very fast disks like
373   SSD or large/fast RAID array.
374 \item the data transfers between the file daemon and the storage daemon even on
375   a 1Gb/s link.
376 \end{itemize}
377
378 Note, Bacula uses compression level LZO1X-1.
379
380 \medskip
381 The code for this feature was contributed by Laurent Papier.
382
383 \subsection{New Tray Monitor}
384
385 Since the old integrated Windows tray monitor doesn't work with
386 recent Windows versions, we have written a new Qt Tray Monitor that is available
387 for both Linux and Windows.  In addition to all the previous features,
388 this new version allows you to run Backups from 
389 the tray monitor menu.
390
391 \begin{figure}[htbp]
392   \centering
393   \includegraphics[width=0.8\linewidth]{tray-monitor}
394   \label{fig:traymonitor}
395   \caption{New tray monitor}
396 \end{figure}
397
398 \begin{figure}[htbp]
399   \centering
400   \includegraphics[width=0.8\linewidth]{tray-monitor1}
401   \label{fig:traymonitor1}
402   \caption{Run a Job through the new tray monitor}
403 \end{figure}
404
405
406 To be able to run a job from the tray monitor, you need to
407 allow specific commands in the Director monitor console:
408 \begin{verbatim}
409 Console {
410     Name = win2003-mon
411     Password = "xxx"
412     CommandACL = status, .clients, .jobs, .pools, .storage, .filesets, .messages, run
413     ClientACL = *all*               # you can restrict to a specific host
414     CatalogACL = *all*
415     JobACL = *all*
416     StorageACL = *all*
417     ScheduleACL = *all*
418     PoolACL = *all*
419     FileSetACL = *all*
420     WhereACL = *all*
421 }
422 \end{verbatim}
423
424 \medskip
425 This project was funded by Bacula Systems and is available with Bacula
426 the Enterprise Edition and the Community Edition.
427
428 \subsection{Purge Migration Job}
429
430 The new {\bf Purge Migration Job} directive may be added to the Migration
431 Job definition in the Director's configuration file. When it is enabled 
432 the Job that was migrated during a migration will be purged at
433 the end of the migration job.
434
435 For example:
436 \begin{verbatim}
437 Job {
438   Name = "migrate-job"
439   Type = Migrate
440   Level = Full
441   Client = localhost-fd
442   FileSet = "Full Set"
443   Messages = Standard
444   Storage = DiskChanger
445   Pool = Default
446   Selection Type = Job
447   Selection Pattern = ".*Save"
448 ...
449   Purge Migration Job = yes
450 }
451 \end{verbatim}
452
453 \medskip
454
455 This project was submitted by Dunlap Blake; testing and documentation was funded
456 by Bacula Systems.
457
458 \subsection{Changes in Bvfs (Bacula Virtual FileSystem)}
459
460 Bat has now a bRestore panel that uses Bvfs to display files and
461 directories.
462
463 \begin{figure}[htbp]
464   \centering
465   \includegraphics[width=0.8\linewidth]{bat-brestore}
466   \label{fig:batbrestore}
467   \caption{Bat Brestore Panel}
468 \end{figure}
469
470 the Bvfs module works correctly with BaseJobs, Copy and Migration jobs.
471
472 \medskip
473 This project was funded by Bacula Systems.
474
475 \subsubsection*{General notes}
476
477 \begin{itemize}
478 \item All fields are separated by a tab
479 \item You can specify \texttt{limit=} and \texttt{offset=} to list smoothly
480   records in very big directories
481 \item All operations (except cache creation) are designed to run instantly
482 \item At this time, Bvfs works faster on PostgreSQL than MySQL catalog. If you
483   can contribute new faster SQL queries we will be happy, else don't complain
484   about speed.
485 \item The cache creation is dependent of the number of directories. As Bvfs
486   shares information across jobs, the first creation can be slow
487 \item All fields are separated by a tab
488 \item Due to potential encoding problem, it's advised to always use pathid in
489   queries.
490 \end{itemize}
491
492 \subsubsection*{Get dependent jobs from a given JobId}
493
494 Bvfs allows you to query the catalog against any combination of jobs. You
495 can combine all Jobs and all FileSet for a Client in a single session.
496
497 To get all JobId needed to restore a particular job, you can use the
498 \texttt{.bvfs\_get\_jobids} command.
499
500 \begin{verbatim}
501 .bvfs_get_jobids jobid=num [all]
502 \end{verbatim}
503
504 \begin{verbatim}
505 .bvfs_get_jobids jobid=10
506 1,2,5,10
507 .bvfs_get_jobids jobid=10 all
508 1,2,3,5,10
509 \end{verbatim}
510
511 In this example, a normal restore will need to use JobIds 1,2,5,10 to
512 compute a complete restore of the system.
513
514 With the \texttt{all} option, the Director will use all defined FileSet for
515 this client.
516
517 \subsubsection*{Generating Bvfs cache}
518
519 The \texttt{.bvfs\_update} command computes the directory cache for jobs
520 specified in argument, or for all jobs if unspecified.
521
522 \begin{verbatim}
523 .bvfs_update [jobid=numlist]
524 \end{verbatim}
525
526 Example:
527 \begin{verbatim}
528 .bvfs_update jobid=1,2,3
529 \end{verbatim}
530
531 You can run the cache update process in a RunScript after the catalog backup.
532
533 \subsubsection*{Get all versions of a specific file}
534
535 Bvfs allows you to find all versions of a specific file for a given Client with
536 the \texttt{.bvfs\_version} command. To avoid problems with encoding, this
537 function uses only PathId and FilenameId. The jobid argument is mandatory but
538 unused.
539
540 \begin{verbatim}
541 .bvfs_versions client=filedaemon pathid=num filenameid=num jobid=1
542 PathId FilenameId FileId JobId LStat Md5 VolName Inchanger
543 PathId FilenameId FileId JobId LStat Md5 VolName Inchanger
544 ...
545 \end{verbatim}
546
547 Example:
548
549 \begin{verbatim}
550 .bvfs_versions client=localhost-fd pathid=1 fnid=47 jobid=1
551 1  47  52  12  gD HRid IGk D Po Po A P BAA I A   /uPgWaxMgKZlnMti7LChyA  Vol1  1
552 \end{verbatim}
553
554 \subsubsection*{List directories}
555
556 Bvfs allows you to list directories in a specific path.
557 \begin{verbatim}
558 .bvfs_lsdirs pathid=num path=/apath jobid=numlist limit=num offset=num
559 PathId  FilenameId  FileId  JobId  LStat  Path
560 PathId  FilenameId  FileId  JobId  LStat  Path
561 PathId  FilenameId  FileId  JobId  LStat  Path
562 ...
563 \end{verbatim}
564
565 You need to \texttt{pathid} or \texttt{path}. Using \texttt{path=""} will list
566 ``/'' on Unix and all drives on Windows.  If FilenameId is 0, the record
567 listed is a directory.
568
569 \begin{verbatim}
570 .bvfs_lsdirs pathid=4 jobid=1,11,12
571 4       0       0       0       A A A A A A A A A A A A A A     .
572 5       0       0       0       A A A A A A A A A A A A A A     ..
573 3       0       0       0       A A A A A A A A A A A A A A     regress/
574 \end{verbatim}
575
576 In this example, to list directories present in \texttt{regress/}, you can use
577 \begin{verbatim}
578 .bvfs_lsdirs pathid=3 jobid=1,11,12
579 3       0       0       0       A A A A A A A A A A A A A A     .
580 4       0       0       0       A A A A A A A A A A A A A A     ..
581 2       0       0       0       A A A A A A A A A A A A A A     tmp/
582 \end{verbatim}
583
584 \subsubsection*{List files}
585
586 Bvfs allows you to list files in a specific path.
587 \begin{verbatim}
588 .bvfs_lsfiles pathid=num path=/apath jobid=numlist limit=num offset=num
589 PathId  FilenameId  FileId  JobId  LStat  Path
590 PathId  FilenameId  FileId  JobId  LStat  Path
591 PathId  FilenameId  FileId  JobId  LStat  Path
592 ...
593 \end{verbatim}
594
595 You need to \texttt{pathid} or \texttt{path}. Using \texttt{path=""} will list
596 ``/'' on Unix and all drives on Windows. If FilenameId is 0, the record listed
597 is a directory.
598
599 \begin{verbatim}
600 .bvfs_lsfiles pathid=4 jobid=1,11,12
601 4       0       0       0       A A A A A A A A A A A A A A     .
602 5       0       0       0       A A A A A A A A A A A A A A     ..
603 1       0       0       0       A A A A A A A A A A A A A A     regress/
604 \end{verbatim}
605
606 In this example, to list files present in \texttt{regress/}, you can use
607 \begin{verbatim}
608 .bvfs_lsfiles pathid=1 jobid=1,11,12
609 1   47   52   12    gD HRid IGk BAA I BMqcPH BMqcPE BMqe+t A     titi
610 1   49   53   12    gD HRid IGk BAA I BMqe/K BMqcPE BMqe+t B     toto
611 1   48   54   12    gD HRie IGk BAA I BMqcPH BMqcPE BMqe+3 A     tutu
612 1   45   55   12    gD HRid IGk BAA I BMqe/K BMqcPE BMqe+t B     ficheriro1.txt
613 1   46   56   12    gD HRie IGk BAA I BMqe/K BMqcPE BMqe+3 D     ficheriro2.txt
614 \end{verbatim}
615
616 \subsubsection*{Restore set of files}
617
618 Bvfs allows you to create a SQL table that contains files that you want to
619 restore. This table can be provided to a restore command with the file option.
620
621 \begin{verbatim}
622 .bvfs_restore fileid=numlist dirid=numlist hardlink=numlist path=b2num
623 OK
624 restore file=?b2num ...
625 \end{verbatim}
626
627 To include a directory (with \texttt{dirid}), Bvfs needs to run a query to
628 select all files. This query could be time consuming.
629
630 \texttt{hardlink} list is always composed of a series of two numbers (jobid,
631 fileindex). This information can be found in the LinkFI field of the LStat
632 packet.
633
634 The \texttt{path} argument represents the name of the table that Bvfs will
635 store results. The format of this table is \texttt{b2[0-9]+}. (Should start by
636 b2 and followed by digits).
637
638 Example:
639
640 \begin{verbatim}
641 .bvfs_restore fileid=1,2,3,4 hardlink=10,15,10,20 jobid=10 path=b20001
642 OK
643 \end{verbatim}
644
645 \subsubsection*{Cleanup after Restore}
646
647 To drop the table used by the restore command, you can use the
648 \texttt{.bvfs\_cleanup} command.
649
650 \begin{verbatim}
651 .bvfs_cleanup path=b20001
652 \end{verbatim}
653
654 \subsubsection*{Clearing the BVFS Cache}
655
656 To clear the BVFS cache, you can use the \texttt{.bvfs\_clear\_cache} command.
657
658 \begin{verbatim}
659 .bvfs_clear_cache yes
660 OK
661 \end{verbatim}
662
663 \subsection{Changes in the Pruning Algorithm}
664
665 We rewrote the job pruning algorithm in this version. Previously, in some users
666 reported that the pruning process at the end of jobs was very long. It should
667 not be longer the case. Now, Bacula won't prune automatically a Job if this
668 particular Job is needed to restore data. Example:
669
670 \begin{verbatim}
671 JobId: 1  Level: Full
672 JobId: 2  Level: Incremental
673 JobId: 3  Level: Incremental
674 JobId: 4  Level: Differential
675 .. Other incrementals up to now
676 \end{verbatim}
677
678 In this example, if the Job Retention defined in the Pool or in the Client
679 resource causes that Jobs with Jobid in 1,2,3,4 can be pruned, Bacula will
680 detect that JobId 1 and 4 are essential to restore data at the current state
681 and will prune only JobId 2 and 3.
682
683 \texttt{Important}, this change affect only the automatic pruning step after a
684 Job and the \texttt{prune jobs} Bconsole command. If a volume expires after the
685 \texttt{VolumeRetention} period, important jobs can be pruned.
686
687 \subsection{Ability to Verify any specified Job}
688 You now have the ability to tell Bacula which Job should verify instead of
689 automatically verify just the last one.
690
691 This feature can be used with VolumeToCatalog, DiskToCatalog and Catalog level.
692
693 To verify a given job, just specify the Job jobid in argument when starting the
694 job.
695 \begin{verbatim}
696 *run job=VerifyVolume jobid=1 level=VolumeToCatalog
697 Run Verify job
698 JobName:     VerifyVolume
699 Level:       VolumeToCatalog
700 Client:      127.0.0.1-fd
701 FileSet:     Full Set
702 Pool:        Default (From Job resource)
703 Storage:     File (From Job resource)
704 Verify Job:  VerifyVol.2010-09-08_14.17.17_03
705 Verify List: /tmp/regress/working/VerifyVol.bsr
706 When:        2010-09-08 14:17:31
707 Priority:    10
708 OK to run? (yes/mod/no):
709 \end{verbatim}
710
711 \medskip
712 This project was funded by Bacula Systems and is available with Bacula
713 Enterprise Edition and Community Edition.
714
715 \subsection{Additions to RunScript variables}
716 You can have access to JobBytes and JobFiles using \%b and \%F in your runscript
717 command. The Client address is now available through \%h.
718
719 \begin{verbatim}
720 RunAfterJob = "/bin/echo Job=%j JobBytes=%b JobFiles=%F ClientAddress=%h"
721 \end{verbatim}
722
723 %\subsection{Changes in drivetype.exe}
724 %
725 %Now the \texttt{drivetype.exe} program allows you to list all local hard
726 %drives. It can help to build dynamic FileSet on Windows.
727 %
728 %\begin{verbatim}
729 %File = "\\|\"c:/program files/bacula/bin32/drivetype\" -l -a"
730 %\end{verbatim}
731 %
732
733 \subsection{Additions to the Plugin API}
734 The bfuncs structure has been extended to include a number of
735 new entrypoints.
736
737 \subsubsection{bfuncs}
738 The bFuncs structure defines the callback entry points within Bacula
739 that the plugin can use register events, get Bacula values, set
740 Bacula values, and send messages to the Job output or debug output.
741
742 The exact definition as of this writing is:
743 \begin{verbatim}
744 typedef struct s_baculaFuncs {
745    uint32_t size;
746    uint32_t version;
747    bRC (*registerBaculaEvents)(bpContext *ctx, ...);
748    bRC (*getBaculaValue)(bpContext *ctx, bVariable var, void *value);
749    bRC (*setBaculaValue)(bpContext *ctx, bVariable var, void *value);
750    bRC (*JobMessage)(bpContext *ctx, const char *file, int line,
751        int type, utime_t mtime, const char *fmt, ...);
752    bRC (*DebugMessage)(bpContext *ctx, const char *file, int line,
753        int level, const char *fmt, ...);
754    void *(*baculaMalloc)(bpContext *ctx, const char *file, int line,
755        size_t size);
756    void (*baculaFree)(bpContext *ctx, const char *file, int line, void *mem);
757    
758    /* New functions follow */
759    bRC (*AddExclude)(bpContext *ctx, const char *file);
760    bRC (*AddInclude)(bpContext *ctx, const char *file);
761    bRC (*AddIncludeOptions)(bpContext *ctx, const char *opts);
762    bRC (*AddRegex)(bpContext *ctx, const char *item, int type);
763    bRC (*AddWild)(bpContext *ctx, const char *item, int type);
764    bRC (*checkChanges)(bpContext *ctx, struct save_pkt *sp);
765
766 } bFuncs;
767 \end{verbatim}
768
769 \begin{description}
770 \item [AddExclude] can be called to exclude a file. The file
771   string passed may include wildcards that will be interpreted by
772   the {\bf fnmatch} subroutine. This function can be called 
773   multiple times, and each time the file specified will be added
774   to the list of files to be excluded. Note, this function only
775   permits adding excludes of specific file or directory names,
776   or files matched by the rather simple fnmatch mechanism.
777   See below for information on doing wild-card and regex excludes.
778
779 \item [NewPreInclude] can be called to create a new Include block. This
780   block will be added after the current defined Include block. This
781   function can be called multiple times, but each time, it will create
782   a new Include section (not normally needed). This function should
783   be called only if you want to add an entirely new Include block.
784
785 \item [NewInclude] can be called to create a new Include block. This
786   block will be added before any user defined Include blocks. This
787   function can be called multiple times, but each time, it will create
788   a new Include section (not normally needed). This function should
789   be called only if you want to add an entirely new Include block.
790
791 \item [AddInclude] can be called to add new files/directories to
792   be included.  They are added to the current Include block. If
793   NewInclude has not been included, the current Include block is
794   the last one that the user created. This function
795   should be used only if you want to add totally new files/directories
796   to be included in the backup. 
797
798 \item [NewOptions] adds a new Options block to the current Include
799   in front of any other Options blocks. This permits the plugin to
800   add exclude directives (wild-cards and regexes) in front of the
801   user Options, and thus prevent certain files from being backed up.
802   This can be useful if the plugin backs up files, and they should
803   not be also backed up by the main Bacula code.  This function
804   may be called multiple times, and each time, it creates a new
805   prepended Options block. Note: normally you want to call this 
806   entry point prior to calling AddOptions, AddRegex, or AddWild.
807   
808 \item [AddOptions] allows the plugin it set options in
809   the current Options block, which is normally created with the
810   NewOptions call just prior to adding Include Options.
811   The permitted options are passed as a character string, where
812   each character has a specific meaning as defined below:
813
814   \begin{description}
815   \item [a] always replace files (default).
816   \item [e] exclude rather than include.
817   \item [h] no recursion into subdirectories.
818   \item [H] do not handle hard links.
819   \item [i] ignore case in wildcard and regex matches.
820   \item [M] compute an MD5 sum.
821   \item [p] use a portable data format on Windows (not recommended).
822   \item [R] backup resource forks and Findr Info.
823   \item [r] read from a fifo
824   \item [S1] compute an SHA1 sum.
825   \item [S2] compute an SHA256 sum.
826   \item [S3] comput an SHA512 sum.
827   \item [s] handle sparse files.
828   \item [m] use st\_mtime only for file differences.
829   \item [k] restore the st\_atime after accessing a file.
830   \item [A] enable ACL backup.
831   \item [Vxxx:] specify verify options. Must terminate with :
832   \item [Cxxx:] specify accurate options. Must terminate with :
833   \item [Jxxx:] specify base job Options. Must terminate with :
834   \item [Pnnn:] specify integer nnn paths to strip. Must terminate with :
835   \item [w] if newer
836   \item [Zn] specify gzip compression level n.
837   \item [K] do not use st\_atime in backup decision.
838   \item [c] check if file changed during backup.
839   \item [N] honor no dump flag.
840   \item [X] enable backup of extended attributes.
841   \end{description}
842
843 \item [AddRegex] adds a regex expression to the current Options block.
844   The following options are permitted:
845   \begin{description}
846   \item [ ] (a blank) regex applies to whole path and filename.
847   \item [F] regex applies only to the filename (directory or path stripped).
848   \item [D] regex applies only to the directory (path) part of the name.
849   \end{description}
850
851 \item [AddWild] adds a wildcard expression to the current Options block.
852   The following options are permitted:
853   \begin{description}
854   \item [ ] (a blank) regex applies to whole path and filename.
855   \item [F] regex applies only to the filename (directory or path stripped).
856   \item [D] regex applies only to the directory (path) part of the name.
857   \end{description}
858
859 \item [checkChanges] call the \texttt{check\_changes()} function in Bacula code
860   that can use Accurate code to compare the file information in argument with
861   the previous file information. The \texttt{delta\_seq} attribute of the
862   \texttt{save\_pkt} will be updated, and the call will return
863   \texttt{bRC\_Seen} if the core code wouldn't decide to backup it.
864   
865 \end{description}
866   
867
868 \subsubsection{Bacula events}
869 The list of events has been extended to include:
870
871 \begin{verbatim}
872 typedef enum {
873   bEventJobStart        = 1,
874   bEventJobEnd          = 2,
875   bEventStartBackupJob  = 3,
876   bEventEndBackupJob    = 4,
877   bEventStartRestoreJob = 5,
878   bEventEndRestoreJob   = 6,
879   bEventStartVerifyJob  = 7,
880   bEventEndVerifyJob    = 8,
881   bEventBackupCommand   = 9,
882   bEventRestoreCommand  = 10,
883   bEventLevel           = 11,
884   bEventSince           = 12,
885    
886   /* New events */
887   bEventCancelCommand                   = 13,
888   bEventVssBackupAddComponents          = 14,
889   bEventVssRestoreLoadComponentMetadata = 15,
890   bEventVssRestoreSetComponentsSelected = 16,
891   bEventRestoreObject                   = 17,
892   bEventEndFileSet                      = 18,
893   bEventPluginCommand                   = 19,
894   bEventVssBeforeCloseRestore           = 20,
895   bEventVssPrepareSnapshot              = 21
896
897 } bEventType;
898 \end{verbatim}
899
900 \begin{description}
901 \item [bEventCancelCommand] is called whenever the currently
902   running Job is canceled */
903
904 \item [bEventVssBackupAddComponents] 
905
906 \item [bEventVssPrepareSnapshot] is called before creating VSS snapshots, it
907   provides a char[27] table where the plugin can add Windows drives that will
908   be used during the Job. You need to add them without duplicates, and you can
909   use in \texttt{fd\_common.h} \texttt{add\_drive()} and \texttt{copy\_drives()}
910   for this purpose.
911 \end{description}
912
913 \subsection{ACL enhancements}
914
915 The following enhancements are made to the Bacula Filed with regards to
916 Access Control Lists (ACLs)
917
918 \begin{itemize}
919 \item Added support for AIX 5.3 and later new aclx\_get interface which supports
920   POSIX and NFSv4 ACLs.
921 \item Added support for new acl types on FreeBSD 8.1 and later which supports
922   POSIX and NFSv4 ACLs.
923 \item Some generic cleanups for internal ACL handling.
924 \item Fix for acl storage on OSX
925 \item Cleanup of configure checks for ACL detection, now configure only
926   tests for a certain interface type based on the operating system
927   this should give less false positives on detection. Also when ACLs
928   are detected no other acl checks are performed anymore.
929 \end{itemize}
930
931 \medskip
932 This project was funded by Planets Communications B.V. and ELM Consultancy B.V.
933 and is available with Bacula Enterprise Edition and Community Edition.
934
935 \subsection{XATTR enhancements}
936
937 The following enhancements are made to the Bacula Filed with regards to
938 Extended Attributes (XATTRs)
939
940 \begin{itemize}
941 \item Added support for IRIX extended attributes using the attr\_get interface.
942 \item Added support for Tru64 (OSF1) extended attributes using the
943   getproplist interface.
944 \item Added support for AIX extended attributes available in AIX 6.x
945   and higher using the listea/getea/setea interface.
946 \item Added some debugging to generic xattr code so it easier to
947   debug.
948 \item Cleanup of configure checks for XATTR detection, now configure only
949   tests for a certain interface type based on the operating system
950   this should give less false positives on detection. Also when xattrs
951   are detected no other xattr checks are performed anymore.
952 \end{itemize}
953
954 \medskip
955 This project was funded by Planets Communications B.V. and ELM Consultancy B.V.
956 and is available with Bacula Enterprise Edition and Community Edition.
957
958 \subsection{Class Based Database Backend Drivers}
959
960 The main Bacula Director code is independent of the SQL backend
961 in version 5.2.0 and greater.  This means that the Bacula Director can be
962 packaged by itself, then each of the different SQL backends supported can
963 be packaged separately.  It is possible to build all the DB backends at the
964 same time by including multiple database options at the same time.
965
966 ./configure can be run with multiple database configure options.
967 \begin{verbatim}
968    --with-sqlite3
969    --with-mysql
970    --with-postgresql
971 \end{verbatim}
972
973 Order of testing for databases is:
974 \begin{itemize}
975 \item postgresql
976 \item mysql
977 \item sqlite3
978 \end{itemize}
979
980 Each configured backend generates a file named:
981 \verb+libbaccats-<sql_backend_name>-<version>.so+
982 A dummy catalog library is created named libbaccats-version.so
983
984 At configure time the first detected backend is used as the so called
985 default backend and at install time the dummy
986 \verb+libbaccats-<version>.so+ is replaced with the default backend type.
987
988 If you configure all three backends you get three backend libraries and the
989 postgresql gets installed as the default.
990
991 When you want to switch to another database, first save any old catalog you
992 may have then you can copy one of the three backend libraries over the
993 \verb+libbaccats-<version>.so+ e.g.
994
995 An actual command, depending on your Bacula version might be:
996 \begin{verbatim}
997    cp libbaccats-postgresql-5.2.2.so libbaccats-5.2.2.so
998 \end{verbatim}
999
1000 where the \verb+5.2.2+ must be replaced by the Bacula release
1001 version number.
1002
1003 Then you must update the default backend in the following files:
1004
1005 \begin{verbatim}
1006   create_bacula_database
1007   drop_bacula_database
1008   drop_bacula_tables
1009   grant_bacula_privileges
1010   make_bacula_tables
1011   make_catalog_backup
1012   update_bacula_tables
1013 \end{verbatim}
1014
1015 And re-run all the above scripts.  Please note, this means
1016 you will have a new empty database and if you had a previous
1017 one it will be lost.
1018
1019 All current database backend drivers for catalog information are rewritten
1020 to use a set of multi inherited C++ classes which abstract the specific
1021 database specific internals and make sure we have a more stable generic
1022 interface with the rest of SQL code.  From now on there is a strict
1023 boundary between the SQL code and the low-level database functions.  This
1024 new interface should also make it easier to add a new backend for a
1025 currently unsupported database.  As part of the rewrite the SQLite 2 code
1026 was removed (e.g.  only SQLite 3 is now supported).  An extra bonus of the
1027 new code is that you can configure multiple backends in the configure and
1028 build all backends in one compile session and select the correct database
1029 backend at install time.  This should make it a lot easier for packages
1030 maintainers.
1031
1032
1033
1034 \medskip
1035 We also added cursor support for PostgreSQL backend, this improves memory
1036 usage for large installation.
1037
1038 \medskip
1039 This project was implemented by Planets Communications B.V. and ELM
1040 Consultancy B.V. and Bacula Systems and is available with both the Bacula
1041 Enterprise Edition and the Community Edition.
1042
1043 \subsection{Hash List Enhancements}
1044
1045 The htable hash table class has been extended with extra hash functions for
1046 handling next to char pointer hashes also 32 bits and 64 bits hash keys.
1047 Also the hash table initialization routines have been enhanced with
1048 support for passing a hint as to the number of initial pages to use
1049 for the size of the hash table. Until now the hash table always used
1050 a fixed value of 10 Mb. The private hash functions of the mountpoint entry
1051 cache have been rewritten to use the new htable class with a small memory
1052 footprint.
1053
1054 \medskip
1055 This project was funded by Planets Communications B.V. and ELM Consultancy B.V.
1056 and Bacula Systems and is available with Bacula Enterprise Edition and
1057 Community Edition.
1058
1059 %%
1060 %%
1061 %%% =====================================================================
1062 %%
1063 %%
1064
1065
1066 \section{Release Version 5.0.3}
1067
1068 There are no new features in version 5.0.2.  This version simply fixes a
1069 number of bugs found in version 5.0.1 during the ongoing development
1070 process.
1071
1072 \section{Release Version 5.0.2}
1073
1074 There are no new features in version 5.0.2.  This version simply fixes a
1075 number of bugs found in version 5.0.1 during the ongoing development
1076 process.
1077
1078 %%
1079 %%
1080
1081 \section{New Features in 5.0.1}
1082
1083 This chapter presents the new features that are in the released Bacula version
1084 5.0.1. This version mainly fixes a number of bugs found in version 5.0.0 during
1085 the ongoing development process.
1086
1087 \subsection{Truncate Volume after Purge}
1088 \label{sec:actiononpurge}
1089
1090 The Pool directive \textbf{ActionOnPurge=Truncate} instructs Bacula to truncate
1091 the volume when it is purged with the new command \texttt{purge volume
1092   action}. It is useful to prevent disk based volumes from consuming too much
1093 space.
1094
1095 \begin{verbatim}
1096 Pool {
1097   Name = Default
1098   Action On Purge = Truncate
1099   ...
1100 }
1101 \end{verbatim}
1102
1103 As usual you can also set this property with the \texttt{update volume} command
1104 \begin{verbatim}
1105 *update volume=xxx ActionOnPurge=Truncate
1106 *update volume=xxx actiononpurge=None
1107 \end{verbatim}
1108
1109 To ask Bacula to truncate your \texttt{Purged} volumes, you need to use the
1110 following command in interactive mode or in a RunScript as shown after:
1111 \begin{verbatim}
1112 *purge volume action=truncate storage=File allpools
1113 # or by default, action=all
1114 *purge volume action storage=File pool=Default
1115 \end{verbatim}
1116
1117 This is possible to specify the volume name, the media type, the pool, the
1118 storage, etc\dots (see \texttt{help purge}) Be sure that your storage device is
1119 idle when you decide to run this command.
1120
1121 \begin{verbatim}
1122 Job {
1123  Name = CatalogBackup
1124  ...
1125  RunScript {
1126    RunsWhen=After
1127    RunsOnClient=No
1128    Console = "purge volume action=all allpools storage=File"
1129  }
1130 }
1131 \end{verbatim}
1132
1133 \textbf{Important note}: This feature doesn't work as
1134 expected in version 5.0.0. Please do not use it before version 5.0.1.
1135
1136 \subsection{Allow Higher Duplicates}
1137 This directive did not work correctly and has been depreciated
1138 (disabled) in version 5.0.1. Please remove it from your bacula-dir.conf
1139 file as it will be removed in a future release.
1140
1141 \subsection{Cancel Lower Level Duplicates}
1142 This directive was added in Bacula version 5.0.1.  It compares the
1143 level of a new backup job to old jobs of the same name, if any,
1144 and will kill the job which has a lower level than the other one.
1145 If the levels are the same (i.e. both are Full backups), then 
1146 nothing is done and the other Cancel XXX Duplicate directives
1147 will be examined.
1148
1149 \section{New Features in 5.0.0}
1150
1151 \subsection{Maximum Concurrent Jobs for Devices}
1152 \label{sec:maximumconcurrentjobdevice}
1153
1154 {\bf Maximum Concurrent Jobs} is a new Device directive in the Storage
1155 Daemon configuration permits setting the maximum number of Jobs that can
1156 run concurrently on a specified Device.  Using this directive, it is
1157 possible to have different Jobs using multiple drives, because when the
1158 Maximum Concurrent Jobs limit is reached, the Storage Daemon will start new
1159 Jobs on any other available compatible drive.  This facilitates writing to
1160 multiple drives with multiple Jobs that all use the same Pool.
1161
1162 This project was funded by Bacula Systems.
1163
1164 \subsection{Restore from Multiple Storage Daemons}
1165 \index[general]{Restore}
1166
1167 Previously, you were able to restore from multiple devices in a single Storage
1168 Daemon. Now, Bacula is able to restore from multiple Storage Daemons. For
1169 example, if your full backup runs on a Storage Daemon with an autochanger, and
1170 your incremental jobs use another Storage Daemon with lots of disks, Bacula
1171 will switch automatically from one Storage Daemon to an other within the same
1172 Restore job.
1173
1174 You must upgrade your File Daemon to version 3.1.3 or greater to use this
1175 feature.
1176
1177 This project was funded by Bacula Systems with the help of Equiinet.
1178
1179 \subsection{File Deduplication using Base Jobs}
1180 A base job is sort of like a Full save except that you will want the FileSet to
1181 contain only files that are unlikely to change in the future (i.e.  a snapshot
1182 of most of your system after installing it).  After the base job has been run,
1183 when you are doing a Full save, you specify one or more Base jobs to be used.
1184 All files that have been backed up in the Base job/jobs but not modified will
1185 then be excluded from the backup.  During a restore, the Base jobs will be
1186 automatically pulled in where necessary.
1187
1188 This is something none of the competition does, as far as we know (except
1189 perhaps BackupPC, which is a Perl program that saves to disk only).  It is big
1190 win for the user, it makes Bacula stand out as offering a unique optimization
1191 that immediately saves time and money.  Basically, imagine that you have 100
1192 nearly identical Windows or Linux machine containing the OS and user files.
1193 Now for the OS part, a Base job will be backed up once, and rather than making
1194 100 copies of the OS, there will be only one.  If one or more of the systems
1195 have some files updated, no problem, they will be automatically restored.
1196
1197 See the \ilink{Base Job Chapter}{basejobs} for more information.
1198
1199 This project was funded by Bacula Systems.
1200
1201 \subsection{AllowCompression = \lt{}yes\vb{}no\gt{}}
1202 \index[dir]{AllowCompression}
1203
1204 This new directive may be added to Storage resource within the Director's
1205 configuration to allow users to selectively disable the client compression for
1206 any job which writes to this storage resource.
1207
1208 For example:
1209 \begin{verbatim}
1210 Storage {
1211   Name = UltriumTape
1212   Address = ultrium-tape
1213   Password = storage_password # Password for Storage Daemon
1214   Device = Ultrium
1215   Media Type = LTO 3
1216   AllowCompression = No # Tape drive has hardware compression
1217 }
1218 \end{verbatim}
1219 The above example would cause any jobs running with the UltriumTape storage
1220 resource to run without compression from the client file daemons.  This
1221 effectively overrides any compression settings defined at the FileSet level.
1222
1223 This feature is probably most useful if you have a tape drive which supports
1224 hardware compression.  By setting the \texttt{AllowCompression = No} directive
1225 for your tape drive storage resource, you can avoid additional load on the file
1226 daemon and possibly speed up tape backups.
1227
1228 This project was funded by Collaborative Fusion, Inc.
1229
1230 \subsection{Accurate Fileset Options}
1231 \label{sec:accuratefileset}
1232
1233 In previous versions, the accurate code used the file creation and modification
1234 times to determine if a file was modified or not. Now you can specify which
1235 attributes to use (time, size, checksum, permission, owner, group, \dots),
1236 similar to the Verify options.
1237
1238 \begin{verbatim}
1239 FileSet {
1240   Name = Full
1241   Include = {
1242     Options {
1243        Accurate = mcs
1244        Verify   = pin5
1245     }
1246     File = /
1247   }
1248 }
1249 \end{verbatim}
1250
1251 \begin{description}  
1252 \item {\bf i}  compare the inodes  
1253 \item {\bf p}  compare the permission bits  
1254 \item {\bf n}  compare the number of links  
1255 \item {\bf u}  compare the user id  
1256 \item {\bf g}  compare the group id  
1257 \item {\bf s}  compare the size  
1258 \item {\bf a}  compare the access time  
1259 \item {\bf m}  compare the modification time (st\_mtime)  
1260 \item {\bf c}  compare the change time (st\_ctime)  
1261 \item {\bf d}  report file size decreases  
1262 \item {\bf 5}  compare the MD5 signature  
1263 \item {\bf 1}  compare the SHA1 signature  
1264 \end{description}
1265
1266 \textbf{Important note:} If you decide to use checksum in Accurate jobs,
1267 the File Daemon will have to read all files even if they normally would not
1268 be saved.  This increases the I/O load, but also the accuracy of the
1269 deduplication.  By default, Bacula will check modification/creation time
1270 and size.
1271
1272 This project was funded by Bacula Systems.
1273
1274 \subsection{Tab-completion for Bconsole}
1275 \label{sec:tabcompletion}
1276
1277 If you build \texttt{bconsole} with readline support, you will be able to use
1278 the new auto-completion mode. This mode supports all commands, gives help
1279 inside command, and lists resources when required. It works also in the restore
1280 mode.
1281
1282 To use this feature, you should have readline development package loaded on
1283 your system, and use the following option in configure.
1284 \begin{verbatim}
1285 ./configure --with-readline=/usr/include/readline --disable-conio ...
1286 \end{verbatim}
1287
1288 The new bconsole won't be able to tab-complete with older directors.
1289
1290 This project was funded by Bacula Systems.
1291
1292 \subsection{Pool File and Job Retention}
1293 \label{sec:poolfilejobretention}
1294
1295 We added two new Pool directives, \texttt{FileRetention} and
1296 \texttt{JobRetention}, that take precedence over Client directives of the same
1297 name. It allows you to control the Catalog pruning algorithm Pool by Pool. For
1298 example, you can decide to increase Retention times for Archive or OffSite Pool.
1299
1300 It seems obvious to us, but apparently not to some users, that given the
1301 definition above that the Pool File and Job Retention periods is a global
1302 override for the normal Client based pruning, which means that when the
1303 Job is pruned, the pruning will apply globally to that particular Job.
1304
1305 Currently, there is a bug in the implementation that causes any Pool 
1306 retention periods specified to apply to {\bf all} Pools for that
1307 particular Client.  Thus we suggest that you avoid using these two
1308 directives until this implementation problem is corrected.
1309
1310 \subsection{Read-only File Daemon using capabilities}
1311 \label{sec:fdreadonly}
1312 This feature implements support of keeping \textbf{ReadAll} capabilities after
1313 UID/GID switch, this allows FD to keep root read but drop write permission.
1314
1315 It introduces new \texttt{bacula-fd} option (\texttt{-k}) specifying that
1316 \textbf{ReadAll} capabilities should be kept after UID/GID switch.
1317
1318 \begin{verbatim}
1319 root@localhost:~# bacula-fd -k -u nobody -g nobody
1320 \end{verbatim}
1321
1322 The code for this feature was contributed by our friends at AltLinux.
1323
1324 \subsection{Bvfs API}
1325 \label{sec:bvfs}
1326
1327 To help developers of restore GUI interfaces, we have added new \textsl{dot
1328   commands} that permit browsing the catalog in a very simple way.
1329
1330 \begin{itemize}
1331 \item \texttt{.bvfs\_update [jobid=x,y,z]} This command is required to update
1332   the Bvfs cache in the catalog. You need to run it before any access to the
1333   Bvfs layer.
1334
1335 \item \texttt{.bvfs\_lsdirs jobid=x,y,z path=/path | pathid=101} This command
1336   will list all directories in the specified \texttt{path} or
1337   \texttt{pathid}. Using \texttt{pathid} avoids problems with character
1338   encoding of path/filenames.
1339
1340 \item \texttt{.bvfs\_lsfiles jobid=x,y,z path=/path | pathid=101} This command
1341   will list all files in the specified \texttt{path} or \texttt{pathid}. Using
1342   \texttt{pathid} avoids problems with character encoding.
1343 \end{itemize}
1344
1345 You can use \texttt{limit=xxx} and \texttt{offset=yyy} to limit the amount of
1346 data that will be displayed.
1347
1348 \begin{verbatim}
1349 * .bvfs_update jobid=1,2
1350 * .bvfs_update
1351 * .bvfs_lsdir path=/ jobid=1,2
1352 \end{verbatim}
1353
1354 This project was funded by Bacula Systems.
1355
1356 \subsection{Testing your Tape Drive}
1357 \label{sec:btapespeed}
1358
1359 To determine the best configuration of your tape drive, you can run the new
1360 \texttt{speed} command available in the \texttt{btape} program.
1361
1362 This command can have the following arguments:
1363 \begin{itemize}
1364 \item[\texttt{file\_size=n}] Specify the Maximum File Size for this test
1365   (between 1 and 5GB). This counter is in GB.
1366 \item[\texttt{nb\_file=n}] Specify the number of file to be written. The amount
1367   of data should be greater than your memory ($file\_size*nb\_file$).
1368 \item[\texttt{skip\_zero}] This flag permits to skip tests with constant
1369   data.
1370 \item[\texttt{skip\_random}] This flag permits to skip tests with random
1371   data.
1372 \item[\texttt{skip\_raw}] This flag permits to skip tests with raw access.
1373 \item[\texttt{skip\_block}] This flag permits to skip tests with Bacula block
1374   access.
1375 \end{itemize}
1376
1377 \begin{verbatim}
1378 *speed file_size=3 skip_raw
1379 btape.c:1078 Test with zero data and bacula block structure.
1380 btape.c:956 Begin writing 3 files of 3.221 GB with blocks of 129024 bytes.
1381 ++++++++++++++++++++++++++++++++++++++++++
1382 btape.c:604 Wrote 1 EOF to "Drive-0" (/dev/nst0)
1383 btape.c:406 Volume bytes=3.221 GB. Write rate = 44.128 MB/s
1384 ...
1385 btape.c:383 Total Volume bytes=9.664 GB. Total Write rate = 43.531 MB/s
1386
1387 btape.c:1090 Test with random data, should give the minimum throughput.
1388 btape.c:956 Begin writing 3 files of 3.221 GB with blocks of 129024 bytes.
1389 +++++++++++++++++++++++++++++++++++++++++++
1390 btape.c:604 Wrote 1 EOF to "Drive-0" (/dev/nst0)
1391 btape.c:406 Volume bytes=3.221 GB. Write rate = 7.271 MB/s
1392 +++++++++++++++++++++++++++++++++++++++++++
1393 ...
1394 btape.c:383 Total Volume bytes=9.664 GB. Total Write rate = 7.365 MB/s
1395
1396 \end{verbatim}
1397
1398 When using compression, the random test will give your the minimum throughput
1399 of your drive . The test using constant string will give you the maximum speed
1400 of your hardware chain. (CPU, memory, SCSI card, cable, drive, tape).
1401
1402 You can change the block size in the Storage Daemon configuration file.
1403
1404 \subsection{New {\bf Block Checksum} Device Directive}
1405 You may now turn off the Block Checksum (CRC32) code
1406 that Bacula uses when writing blocks to a Volume.  This is
1407 done by adding:
1408
1409 \begin{verbatim}
1410 Block Checksum = no
1411 \end{verbatim}
1412
1413 doing so can reduce the Storage daemon CPU usage slightly.  It
1414 will also permit Bacula to read a Volume that has corrupted data.
1415
1416 The default is {\bf yes} -- i.e. the checksum is computed on write
1417 and checked on read. 
1418
1419 We do not recommend to turn this off particularly on older tape
1420 drives or for disk Volumes where doing so may allow corrupted data
1421 to go undetected.
1422
1423 \subsection{New Bat Features}
1424
1425 Those new features were funded by Bacula Systems.
1426
1427 \subsubsection{Media List View}
1428
1429 By clicking on ``Media'', you can see the list of all your volumes. You will be
1430 able to filter by Pool, Media Type, Location,\dots And sort the result directly
1431 in the table. The old ``Media'' view is now known as ``Pool''.
1432 \begin{figure}[htbp]
1433   \centering
1434   \includegraphics[width=0.8\linewidth]{bat-mediaview}
1435   \label{fig:mediaview}
1436 \end{figure}
1437
1438
1439 \subsubsection{Media Information View}
1440
1441 By double-clicking on a volume (on the Media list, in the Autochanger content
1442 or in the Job information panel), you can access a detailed overview of your
1443 Volume. (cf figure \vref{fig:mediainfo}.)
1444 \begin{figure}[htbp]
1445   \centering
1446   \includegraphics[width=0.8\linewidth]{bat11}  
1447   \caption{Media information}
1448   \label{fig:mediainfo}
1449 \end{figure}
1450
1451 \subsubsection{Job Information View}
1452
1453 By double-clicking on a Job record (on the Job run list or in the Media
1454 information panel), you can access a detailed overview of your Job. (cf
1455 figure \vref{fig:jobinfo}.)
1456 \begin{figure}[htbp]
1457   \centering
1458   \includegraphics[width=0.8\linewidth]{bat12}  
1459   \caption{Job information}
1460   \label{fig:jobinfo}
1461 \end{figure}
1462
1463 \subsubsection{Autochanger Content View}
1464
1465 By double-clicking on a Storage record (on the Storage list panel), you can
1466 access a detailed overview of your Autochanger. (cf figure \vref{fig:jobinfo}.)
1467 \begin{figure}[htbp]
1468   \centering
1469   \includegraphics[width=0.8\linewidth]{bat13}  
1470   \caption{Autochanger content}
1471   \label{fig:achcontent}
1472 \end{figure}
1473
1474 To use this feature, you need to use the latest mtx-changer script
1475 version. (With new \texttt{listall} and \texttt{transfer} commands)
1476
1477 \subsection{Bat on Windows}
1478 We have ported {\bf bat} to Windows and it is now installed 
1479 by default when the installer is run.  It works quite well 
1480 on Win32, but has not had a lot of testing there, so your
1481 feedback would be welcome.  Unfortunately, even though it is
1482 installed by default, it does not yet work on 64 bit Windows
1483 operating systems.
1484
1485 \subsection{New Win32 Installer}
1486 The Win32 installer has been modified in several very important
1487 ways.  
1488 \begin{itemize}
1489 \item You must deinstall any current version of the
1490 Win32 File daemon before upgrading to the new one. 
1491 If you forget to do so, the new installation will fail.
1492 To correct this failure, you must manually shutdown 
1493 and deinstall the old File daemon. 
1494 \item All files (other than menu links) are installed
1495 in {\bf c:/Program Files/Bacula}.  
1496 \item The installer no longer sets this
1497 file to require administrator privileges by default. If you want
1498 to do so, please do it manually using the {\bf cacls} program.
1499 For example:
1500 \begin{verbatim}
1501 cacls "C:\Program Files\Bacula" /T /G SYSTEM:F Administrators:F
1502 \end{verbatim}
1503 \item The server daemons (Director and Storage daemon) are
1504 no longer included in the Windows installer.  If you want the
1505 Windows servers, you will either need to build them yourself (note
1506 they have not been ported to 64 bits), or you can contact 
1507 Bacula Systems about this.
1508 \end{itemize}
1509
1510 \subsection{Win64 Installer}
1511 We have corrected a number of problems that required manual
1512 editing of the conf files.  In most cases, it should now
1513 install and work.  {\bf bat} is by default installed in
1514 {\bf c:/Program Files/Bacula/bin32} rather than
1515 {\bf c:/Program Files/Bacula} as is the case with the 32
1516 bit Windows installer.
1517
1518 \subsection{Linux Bare Metal Recovery USB Key}
1519 We have made a number of significant improvements in the
1520 Bare Metal Recovery USB key.  Please see the README files
1521 it the {\bf rescue} release for more details.  
1522
1523 We are working on an equivalent USB key for Windows bare
1524 metal recovery, but it will take some time to develop it (best
1525 estimate 3Q2010 or 4Q2010)
1526
1527
1528 \subsection{bconsole Timeout Option}
1529 You can now use the -u option of {\bf bconsole} to set a timeout in seconds
1530 for commands. This is useful with GUI programs that use {\bf bconsole}
1531 to interface to the Director.
1532
1533 \subsection{Important Changes}
1534 \label{sec:importantchanges}
1535
1536 \begin{itemize}
1537 \item You are now allowed to Migrate, Copy, and Virtual Full to read and write
1538   to the same Pool. The Storage daemon ensures that you do not read and
1539   write to the same Volume.
1540 \item The \texttt{Device Poll Interval} is now 5 minutes. (previously did not
1541   poll by default).
1542 \item Virtually all the features of {\bf mtx-changer} have
1543   now been parametrized, which allows you to configure
1544   mtx-changer without changing it. There is a new configuration file {\bf mtx-changer.conf} 
1545   that contains variables that you can set to configure mtx-changer.
1546   This configuration file will not be overwritten during upgrades.
1547   We encourage you to submit any changes
1548   that are made to mtx-changer and to parametrize it all in
1549   mtx-changer.conf so that all configuration will be done by
1550   changing only mtx-changer.conf.
1551 \item The new \texttt{mtx-changer} script has two new options, \texttt{listall}
1552   and \texttt{transfer}. Please configure them as appropriate
1553   in mtx-changer.conf.
1554 \item To enhance security of the \texttt{BackupCatalog} job, we provide a new
1555   script (\texttt{make\_catalog\_backup.pl}) that does not expose your catalog
1556   password. If you want to use the new script, you will need to 
1557   manually change the \texttt{BackupCatalog} Job definition.
1558 \item The \texttt{bconsole} \texttt{help} command now accepts
1559   an argument, which if provided produces information on that
1560   command (ex: \texttt{help run}).
1561 \end{itemize}
1562
1563
1564 \subsubsection*{Truncate volume after purge}
1565
1566 Note that the Truncate Volume after purge feature doesn't work as expected
1567 in 5.0.0 version. Please, don't use it before version 5.0.1.
1568
1569 \subsubsection{Custom Catalog queries}
1570
1571 If you wish to add specialized commands that list the contents of the catalog,
1572 you can do so by adding them to the \texttt{query.sql} file. This
1573 \texttt{query.sql} file is now empty by default.  The file
1574 \texttt{examples/sample-query.sql} has an a number of sample commands
1575 you might find useful.
1576
1577 \subsubsection{Deprecated parts}
1578
1579 The following items have been \textbf{deprecated} for a long time, and are now
1580 removed from the code.
1581 \begin{itemize}
1582 \item Gnome console
1583 \item Support for SQLite 2
1584 \end{itemize}
1585
1586 \subsection{Misc Changes}
1587 \label{sec:miscchanges}
1588
1589 \begin{itemize}
1590 \item Updated Nagios check\_bacula
1591 \item Updated man files
1592 \item Added OSX package generation script in platforms/darwin
1593 \item Added Spanish and Ukrainian Bacula translations
1594 \item Enable/disable command shows only Jobs that can change
1595 \item Added \texttt{show disabled} command to show disabled Jobs
1596 \item Many ACL improvements
1597 \item Added Level to FD status Job output
1598 \item Begin Ingres DB driver (not yet working)
1599 \item Split RedHat spec files into bacula, bat, mtx, and docs
1600 \item Reorganized the manuals (fewer separate manuals)
1601 \item Added lock/unlock order protection in lock manager
1602 \item Allow 64 bit sizes for a number of variables
1603 \item Fixed several deadlocks or potential race conditions in the SD
1604 \end{itemize}
1605
1606 \chapter{Released Version 3.0.3 and 3.0.3a}
1607
1608 There are no new features in version 3.0.3.  This version simply fixes a
1609 number of bugs found in version 3.0.2 during the ongoing development
1610 process.
1611
1612 \section{New Features in Released Version 3.0.2}
1613
1614 This chapter presents the new features added to the
1615 Released Bacula Version 3.0.2.
1616
1617 \subsection{Full Restore from a Given JobId}
1618 \index[general]{Restore menu}
1619
1620 This feature allows selecting a single JobId and having Bacula
1621 automatically select all the other jobs that comprise a full backup up to
1622 and including the selected date (through JobId).
1623
1624 Assume we start with the following jobs:
1625 \begin{verbatim}
1626 +-------+--------------+---------------------+-------+----------+------------+
1627 | jobid | client       | starttime           | level | jobfiles | jobbytes   |
1628 +-------+--------------+---------------------+-------+----------+------------
1629 | 6     | localhost-fd | 2009-07-15 11:45:49 | I     | 2        | 0          |
1630 | 5     | localhost-fd | 2009-07-15 11:45:45 | I     | 15       | 44143      |
1631 | 3     | localhost-fd | 2009-07-15 11:45:38 | I     | 1        | 10         |
1632 | 1     | localhost-fd | 2009-07-15 11:45:30 | F     | 1527     | 44143073   |
1633 +-------+--------------+---------------------+-------+----------+------------+
1634 \end{verbatim}
1635
1636 Below is an example of this new feature (which is number 12 in the
1637 menu).
1638
1639 \begin{verbatim}
1640 * restore
1641 To select the JobIds, you have the following choices:
1642      1: List last 20 Jobs run
1643      2: List Jobs where a given File is saved
1644 ...
1645     12: Select full restore to a specified Job date
1646     13: Cancel
1647
1648 Select item:  (1-13): 12
1649 Enter JobId to get the state to restore: 5
1650 Selecting jobs to build the Full state at 2009-07-15 11:45:45
1651 You have selected the following JobIds: 1,3,5
1652
1653 Building directory tree for JobId(s) 1,3,5 ...  +++++++++++++++++++
1654 1,444 files inserted into the tree.
1655 \end{verbatim}
1656
1657 This project was funded by Bacula Systems.
1658
1659 \subsection{Source Address}
1660 \index[general]{Source Address}
1661
1662 A feature has been added which allows the administrator to specify the address
1663 from which the Director and File daemons will establish connections.  This
1664 may be used to simplify system configuration overhead when working in complex
1665 networks utilizing multi-homing and policy-routing.
1666
1667 To accomplish this, two new configuration directives have been implemented:
1668 \begin{verbatim}
1669 FileDaemon {
1670   FDSourceAddress=10.0.1.20    # Always initiate connections from this address
1671 }
1672
1673 Director {
1674   DirSourceAddress=10.0.1.10   # Always initiate connections from this address
1675 }
1676 \end{verbatim}
1677
1678 Simply adding specific host routes on the OS
1679 would have an undesirable side-effect: any
1680 application trying to contact the destination host would be forced to use the
1681 more specific route possibly diverting management traffic onto a backup VLAN.
1682 Instead of adding host routes for each client connected to a multi-homed backup
1683 server (for example where there are management and backup VLANs), one can
1684 use the new directives to specify a specific source address at the application
1685 level.
1686
1687 Additionally, this allows the simplification and abstraction of firewall rules
1688 when dealing with a Hot-Standby director or storage daemon configuration.  The
1689 Hot-standby pair may share a CARP address, which connections must be sourced
1690 from, while system services listen and act from the unique interface addresses.
1691
1692 This project was funded by Collaborative Fusion, Inc.
1693
1694 \subsection{Show volume availability when doing restore}
1695
1696 When doing a restore the selection dialog ends by displaying this
1697 screen:
1698
1699 \begin{verbatim}
1700   The job will require the following
1701    Volume(s)                 Storage(s)                SD Device(s)
1702    ===========================================================================
1703    *000741L3                  LTO-4                     LTO3 
1704    *000866L3                  LTO-4                     LTO3 
1705    *000765L3                  LTO-4                     LTO3 
1706    *000764L3                  LTO-4                     LTO3 
1707    *000756L3                  LTO-4                     LTO3 
1708    *001759L3                  LTO-4                     LTO3 
1709    *001763L3                  LTO-4                     LTO3 
1710     001762L3                  LTO-4                     LTO3 
1711     001767L3                  LTO-4                     LTO3 
1712
1713 Volumes marked with ``*'' are online (in the autochanger).
1714 \end{verbatim}
1715
1716 This should help speed up large restores by minimizing the time spent
1717 waiting for the operator to discover that he must change tapes in the library.
1718
1719 This project was funded by Bacula Systems.
1720
1721 \subsection{Accurate estimate command}
1722
1723 The \texttt{estimate} command can now use the accurate code to detect changes
1724 and give a better estimation.
1725
1726 You can set the accurate behavior on the command line by using
1727 \texttt{accurate=yes\vb{}no} or use the Job setting as default value.
1728
1729 \begin{verbatim}
1730 * estimate listing accurate=yes level=incremental job=BackupJob
1731 \end{verbatim}
1732
1733 This project was funded by Bacula Systems.
1734
1735 \section{New Features in 3.0.0}
1736 \label{NewFeaturesChapter}
1737 \index[general]{New Features}
1738
1739 This chapter presents the new features added to the development 2.5.x
1740 versions to be released as Bacula version 3.0.0 sometime in April 2009.
1741
1742 \subsection{Accurate Backup}
1743 \index[general]{Accurate Backup}
1744
1745 As with most other backup programs, by default Bacula decides what files to
1746 backup for Incremental and Differential backup by comparing the change
1747 (st\_ctime) and modification (st\_mtime) times of the file to the time the last
1748 backup completed.  If one of those two times is later than the last backup
1749 time, then the file will be backed up.  This does not, however, permit tracking
1750 what files have been deleted and will miss any file with an old time that may
1751 have been restored to or moved onto the client filesystem.
1752
1753 \subsubsection{Accurate = \lt{}yes\vb{}no\gt{}}
1754 If the {\bf Accurate = \lt{}yes\vb{}no\gt{}} directive is enabled (default no) in
1755 the Job resource, the job will be run as an Accurate Job. For a {\bf Full}
1756 backup, there is no difference, but for {\bf Differential} and {\bf
1757   Incremental} backups, the Director will send a list of all previous files
1758 backed up, and the File daemon will use that list to determine if any new files
1759 have been added or or moved and if any files have been deleted. This allows
1760 Bacula to make an accurate backup of your system to that point in time so that
1761 if you do a restore, it will restore your system exactly.  
1762
1763 One note of caution
1764 about using Accurate backup is that it requires more resources (CPU and memory)
1765 on both the Director and the Client machines to create the list of previous
1766 files backed up, to send that list to the File daemon, for the File daemon to
1767 keep the list (possibly very big) in memory, and for the File daemon to do
1768 comparisons between every file in the FileSet and the list.  In particular,
1769 if your client has lots of files (more than a few million), you will need
1770 lots of memory on the client machine.
1771
1772 Accurate must not be enabled when backing up with a plugin that is not
1773 specially designed to work with Accurate. If you enable it, your restores
1774 will probably not work correctly.
1775
1776 This project was funded by Bacula Systems.
1777                                        
1778
1779
1780 \subsection{Copy Jobs}
1781 \index[general]{Copy Jobs}
1782
1783 A new {\bf Copy} job type 'C' has been implemented. It is similar to the
1784 existing Migration feature with the exception that the Job that is copied is
1785 left unchanged.  This essentially creates two identical copies of the same
1786 backup. However, the copy is treated as a copy rather than a backup job, and
1787 hence is not directly available for restore.  The {\bf restore} command lists
1788 copy jobs and allows selection of copies by using \texttt{jobid=}
1789 option. If the keyword {\bf copies} is present on the command line, Bacula will
1790 display the list of all copies for selected jobs.
1791
1792 \begin{verbatim}
1793 * restore copies
1794 [...]
1795 These JobIds have copies as follows:
1796 +-------+------------------------------------+-----------+------------------+
1797 | JobId | Job                                | CopyJobId | MediaType        |
1798 +-------+------------------------------------+-----------+------------------+
1799 | 2     | CopyJobSave.2009-02-17_16.31.00.11 | 7         | DiskChangerMedia |
1800 +-------+------------------------------------+-----------+------------------+
1801 +-------+-------+----------+----------+---------------------+------------------+
1802 | JobId | Level | JobFiles | JobBytes | StartTime           | VolumeName       |
1803 +-------+-------+----------+----------+---------------------+------------------+
1804 | 19    | F     | 6274     | 76565018 | 2009-02-17 16:30:45 | ChangerVolume002 |
1805 | 2     | I     | 1        | 5        | 2009-02-17 16:30:51 | FileVolume001    |
1806 +-------+-------+----------+----------+---------------------+------------------+
1807 You have selected the following JobIds: 19,2
1808
1809 Building directory tree for JobId(s) 19,2 ...  ++++++++++++++++++++++++++++++++++++++++++++
1810 5,611 files inserted into the tree.
1811 ...
1812 \end{verbatim}
1813
1814
1815 The Copy Job runs without using the File daemon by copying the data from the
1816 old backup Volume to a different Volume in a different Pool. See the Migration
1817 documentation for additional details. For copy Jobs there is a new selection
1818 directive named {\bf PoolUncopiedJobs} which selects all Jobs that were
1819 not already copied to another Pool. 
1820
1821 As with Migration, the Client, Volume, Job, or SQL query, are
1822 other possible ways of selecting the Jobs to be copied. Selection
1823 types like SmallestVolume, OldestVolume, PoolOccupancy and PoolTime also
1824 work, but are probably more suited for Migration Jobs. 
1825
1826 If Bacula finds a Copy of a job record that is purged (deleted) from the catalog,
1827 it will promote the Copy to a \textsl{real} backup job and will make it available for
1828 automatic restore. If more than one Copy is available, it will promote the copy
1829 with the smallest JobId.
1830
1831 A nice solution which can be built with the new Copy feature is often
1832 called disk-to-disk-to-tape backup (DTDTT). A sample config could
1833 look something like the one below:
1834
1835 \begin{verbatim}
1836 Pool {
1837   Name = FullBackupsVirtualPool
1838   Pool Type = Backup
1839   Purge Oldest Volume = Yes
1840   Storage = vtl
1841   NextPool = FullBackupsTapePool
1842 }
1843
1844 Pool {
1845   Name = FullBackupsTapePool
1846   Pool Type = Backup
1847   Recycle = Yes
1848   AutoPrune = Yes
1849   Volume Retention = 365 days
1850   Storage = superloader
1851 }
1852
1853 #
1854 # Fake fileset for copy jobs
1855 #
1856 Fileset {
1857   Name = None
1858   Include {
1859     Options {
1860       signature = MD5
1861     }
1862   }
1863 }
1864
1865 #
1866 # Fake client for copy jobs
1867 #
1868 Client {
1869   Name = None
1870   Address = localhost
1871   Password = "NoNe"
1872   Catalog = MyCatalog
1873 }
1874
1875 #
1876 # Default template for a CopyDiskToTape Job
1877 #
1878 JobDefs {
1879   Name = CopyDiskToTape
1880   Type = Copy
1881   Messages = StandardCopy
1882   Client = None
1883   FileSet = None
1884   Selection Type = PoolUncopiedJobs
1885   Maximum Concurrent Jobs = 10
1886   SpoolData = No
1887   Allow Duplicate Jobs = Yes
1888   Cancel Queued Duplicates = No
1889   Cancel Running Duplicates = No
1890   Priority = 13
1891 }
1892
1893 Schedule {
1894    Name = DaySchedule7:00
1895    Run = Level=Full daily at 7:00
1896 }
1897
1898 Job {
1899   Name = CopyDiskToTapeFullBackups
1900   Enabled = Yes
1901   Schedule = DaySchedule7:00
1902   Pool = FullBackupsVirtualPool
1903   JobDefs = CopyDiskToTape
1904 }
1905 \end{verbatim}
1906
1907 The example above had 2 pool which are copied using the PoolUncopiedJobs
1908 selection criteria. Normal Full backups go to the Virtual pool and are copied
1909 to the Tape pool the next morning.
1910
1911 The command \texttt{list copies [jobid=x,y,z]} lists copies for a given
1912 \textbf{jobid}.
1913
1914 \begin{verbatim}
1915 *list copies
1916 +-------+------------------------------------+-----------+------------------+
1917 | JobId | Job                                | CopyJobId | MediaType        |
1918 +-------+------------------------------------+-----------+------------------+
1919 |     9 | CopyJobSave.2008-12-20_22.26.49.05 |        11 | DiskChangerMedia |
1920 +-------+------------------------------------+-----------+------------------+
1921 \end{verbatim}
1922
1923 \subsection{ACL Updates}
1924 \index[general]{ACL Updates}
1925 The whole ACL code had been overhauled and in this version each platforms has
1926 different streams for each type of acl available on such an platform. As ACLs
1927 between platforms tend to be not that portable (most implement POSIX acls but
1928 some use an other draft or a completely different format) we currently only
1929 allow certain platform specific ACL streams to be decoded and restored on the
1930 same platform that they were created on.  The old code allowed to restore ACL
1931 cross platform but the comments already mention that not being to wise. For
1932 backward compatibility the new code will accept the two old ACL streams and
1933 handle those with the platform specific handler. But for all new backups it
1934 will save the ACLs using the new streams.
1935
1936 Currently the following platforms support ACLs:
1937
1938 \begin{itemize}
1939  \item {\bf AIX}
1940  \item {\bf Darwin/OSX}
1941  \item {\bf FreeBSD}
1942  \item {\bf HPUX}
1943  \item {\bf IRIX}
1944  \item {\bf Linux}
1945  \item {\bf Tru64}
1946  \item {\bf Solaris}
1947 \end{itemize}
1948
1949 Currently we support the following ACL types (these ACL streams use a reserved
1950 part of the stream numbers):
1951
1952 \begin{itemize}
1953 \item {\bf STREAM\_ACL\_AIX\_TEXT} 1000 AIX specific string representation from
1954   acl\_get
1955  \item {\bf STREAM\_ACL\_DARWIN\_ACCESS\_ACL} 1001 Darwin (OSX) specific acl\_t
1956    string representation from acl\_to\_text (POSIX acl)
1957   \item {\bf STREAM\_ACL\_FREEBSD\_DEFAULT\_ACL} 1002 FreeBSD specific acl\_t
1958     string representation from acl\_to\_text (POSIX acl) for default acls.
1959   \item {\bf STREAM\_ACL\_FREEBSD\_ACCESS\_ACL} 1003 FreeBSD specific acl\_t
1960     string representation from acl\_to\_text (POSIX acl) for access acls.
1961   \item {\bf STREAM\_ACL\_HPUX\_ACL\_ENTRY} 1004 HPUX specific acl\_entry
1962     string representation from acltostr (POSIX acl)
1963   \item {\bf STREAM\_ACL\_IRIX\_DEFAULT\_ACL} 1005 IRIX specific acl\_t string
1964     representation from acl\_to\_text (POSIX acl) for default acls.
1965   \item {\bf STREAM\_ACL\_IRIX\_ACCESS\_ACL} 1006 IRIX specific acl\_t string
1966     representation from acl\_to\_text (POSIX acl) for access acls.
1967   \item {\bf STREAM\_ACL\_LINUX\_DEFAULT\_ACL} 1007 Linux specific acl\_t
1968     string representation from acl\_to\_text (POSIX acl) for default acls.
1969   \item {\bf STREAM\_ACL\_LINUX\_ACCESS\_ACL} 1008 Linux specific acl\_t string
1970     representation from acl\_to\_text (POSIX acl) for access acls.
1971   \item {\bf STREAM\_ACL\_TRU64\_DEFAULT\_ACL} 1009 Tru64 specific acl\_t
1972     string representation from acl\_to\_text (POSIX acl) for default acls.
1973   \item {\bf STREAM\_ACL\_TRU64\_DEFAULT\_DIR\_ACL} 1010 Tru64 specific acl\_t
1974     string representation from acl\_to\_text (POSIX acl) for default acls.
1975   \item {\bf STREAM\_ACL\_TRU64\_ACCESS\_ACL} 1011 Tru64 specific acl\_t string
1976     representation from acl\_to\_text (POSIX acl) for access acls.
1977   \item {\bf STREAM\_ACL\_SOLARIS\_ACLENT} 1012 Solaris specific aclent\_t
1978     string representation from acltotext or acl\_totext (POSIX acl)
1979   \item {\bf STREAM\_ACL\_SOLARIS\_ACE} 1013 Solaris specific ace\_t string
1980     representation from from acl\_totext (NFSv4 or ZFS acl)
1981 \end{itemize}
1982
1983 In future versions we might support conversion functions from one type of acl
1984 into an other for types that are either the same or easily convertible. For now
1985 the streams are separate and restoring them on a platform that doesn't
1986 recognize them will give you a warning.
1987
1988 \subsection{Extended Attributes}
1989 \index[general]{Extended Attributes}
1990 Something that was on the project list for some time is now implemented for
1991 platforms that support a similar kind of interface. Its the support for backup
1992 and restore of so called extended attributes. As extended attributes are so
1993 platform specific these attributes are saved in separate streams for each
1994 platform.  Restores of the extended attributes can only be performed on the
1995 same platform the backup was done.  There is support for all types of extended
1996 attributes, but restoring from one type of filesystem onto an other type of
1997 filesystem on the same platform may lead to surprises.  As extended attributes
1998 can contain any type of data they are stored as a series of so called
1999 value-pairs.  This data must be seen as mostly binary and is stored as such.
2000 As security labels from selinux are also extended attributes this option also
2001 stores those labels and no specific code is enabled for handling selinux
2002 security labels.
2003
2004 Currently the following platforms support extended attributes:
2005 \begin{itemize}
2006  \item {\bf Darwin/OSX}
2007  \item {\bf FreeBSD}
2008  \item {\bf Linux}
2009  \item {\bf NetBSD}
2010 \end{itemize}
2011
2012 On Linux acls are also extended attributes, as such when you enable ACLs on a
2013 Linux platform it will NOT save the same data twice e.g. it will save the ACLs
2014 and not the same extended attribute.
2015
2016 To enable the backup of extended attributes please add the following to your
2017 fileset definition.
2018 \begin{verbatim}
2019   FileSet {
2020     Name = "MyFileSet"
2021     Include {
2022       Options {
2023         signature = MD5
2024         xattrsupport = yes
2025       }
2026       File = ...
2027     }
2028   }
2029 \end{verbatim}
2030
2031 \subsection{Shared objects}
2032 \index[general]{Shared objects}
2033 A default build of Bacula will now create the libraries as shared objects
2034 (.so) rather than static libraries as was previously the case.  
2035 The shared libraries are built using {\bf libtool} so it should be quite
2036 portable.
2037
2038 An important advantage of using shared objects is that on a machine with the
2039 Directory, File daemon, the Storage daemon, and a console, you will have only
2040 one copy of the code in memory rather than four copies.  Also the total size of
2041 the binary release is smaller since the library code appears only once rather
2042 than once for every program that uses it; this results in significant reduction
2043 in the size of the binaries particularly for the utility tools.
2044  
2045 In order for the system loader to find the shared objects when loading the
2046 Bacula binaries, the Bacula shared objects must either be in a shared object
2047 directory known to the loader (typically /usr/lib) or they must be in the
2048 directory that may be specified on the {\bf ./configure} line using the {\bf
2049   {-}{-}libdir} option as:
2050
2051 \begin{verbatim}
2052   ./configure --libdir=/full-path/dir
2053 \end{verbatim}
2054
2055 the default is /usr/lib. If {-}{-}libdir is specified, there should be
2056 no need to modify your loader configuration provided that
2057 the shared objects are installed in that directory (Bacula
2058 does this with the make install command). The shared objects
2059 that Bacula references are:
2060
2061 \begin{verbatim}
2062 libbaccfg.so
2063 libbacfind.so
2064 libbacpy.so
2065 libbac.so
2066 \end{verbatim}
2067
2068 These files are symbolically linked to the real shared object file,
2069 which has a version number to permit running multiple versions of
2070 the libraries if desired (not normally the case).
2071
2072 If you have problems with libtool or you wish to use the old
2073 way of building static libraries, or you want to build a static
2074 version of Bacula you may disable
2075 libtool on the configure command line with:
2076
2077 \begin{verbatim}
2078   ./configure --disable-libtool
2079 \end{verbatim}
2080
2081
2082 \subsection{Building Static versions of Bacula}
2083 \index[general]{Static linking}
2084 In order to build static versions of Bacula, in addition
2085 to configuration options that were needed you now must
2086 also add --disable-libtool.  Example
2087
2088 \begin{verbatim}
2089   ./configure --enable-static-client-only --disable-libtool
2090 \end{verbatim}
2091
2092
2093 \subsection{Virtual Backup (Vbackup)}
2094 \index[general]{Virtual Backup}
2095 \index[general]{Vbackup}
2096
2097 Bacula's virtual backup feature is often called Synthetic Backup or
2098 Consolidation in other backup products.  It permits you to consolidate the
2099 previous Full backup plus the most recent Differential backup and any
2100 subsequent Incremental backups into a new Full backup.  This new Full
2101 backup will then be considered as the most recent Full for any future
2102 Incremental or Differential backups.  The VirtualFull backup is
2103 accomplished without contacting the client by reading the previous backup
2104 data and writing it to a volume in a different pool.
2105
2106 In some respects the Vbackup feature works similar to a Migration job, in
2107 that Bacula normally reads the data from the pool specified in the 
2108 Job resource, and writes it to the {\bf Next Pool} specified in the 
2109 Job resource. Note, this means that usually the output from the Virtual
2110 Backup is written into a different pool from where your prior backups
2111 are saved. Doing it this way guarantees that you will not get a deadlock
2112 situation attempting to read and write to the same volume in the Storage
2113 daemon. If you then want to do subsequent backups, you may need to
2114 move the Virtual Full Volume back to your normal backup pool.
2115 Alternatively, you can set your {\bf Next Pool} to point to the current
2116 pool.  This will cause Bacula to read and write to Volumes in the
2117 current pool. In general, this will work, because Bacula will
2118 not allow reading and writing on the same Volume. In any case, once
2119 a VirtualFull has been created, and a restore is done involving the
2120 most current Full, it will read the Volume or Volumes by the VirtualFull 
2121 regardless of in which Pool the Volume is found.
2122
2123 The Vbackup is enabled on a Job by Job in the Job resource by specifying
2124 a level of {\bf VirtualFull}.
2125
2126 A typical Job resource definition might look like the following:
2127
2128 \begin{verbatim}
2129 Job {
2130   Name = "MyBackup"
2131   Type = Backup
2132   Client=localhost-fd
2133   FileSet = "Full Set"
2134   Storage = File
2135   Messages = Standard
2136   Pool = Default
2137   SpoolData = yes
2138 }
2139
2140 # Default pool definition
2141 Pool {
2142   Name = Default
2143   Pool Type = Backup
2144   Recycle = yes            # Automatically recycle Volumes
2145   AutoPrune = yes          # Prune expired volumes
2146   Volume Retention = 365d  # one year
2147   NextPool = Full
2148   Storage = File
2149 }
2150
2151 Pool {
2152   Name = Full
2153   Pool Type = Backup
2154   Recycle = yes            # Automatically recycle Volumes
2155   AutoPrune = yes          # Prune expired volumes
2156   Volume Retention = 365d  # one year
2157   Storage = DiskChanger
2158 }
2159
2160 # Definition of file storage device
2161 Storage {
2162   Name = File
2163   Address = localhost
2164   Password = "xxx"
2165   Device = FileStorage
2166   Media Type = File
2167   Maximum Concurrent Jobs = 5
2168 }
2169
2170 # Definition of DDS Virtual tape disk storage device
2171 Storage {
2172   Name = DiskChanger
2173   Address = localhost  # N.B. Use a fully qualified name here
2174   Password = "yyy"
2175   Device = DiskChanger
2176   Media Type = DiskChangerMedia
2177   Maximum Concurrent Jobs = 4
2178   Autochanger = yes
2179 }
2180 \end{verbatim}
2181
2182 Then in bconsole or via a Run schedule, you would run the job as:
2183
2184 \begin{verbatim}
2185 run job=MyBackup level=Full
2186 run job=MyBackup level=Incremental
2187 run job=MyBackup level=Differential
2188 run job=MyBackup level=Incremental
2189 run job=MyBackup level=Incremental
2190 \end{verbatim}
2191
2192 So providing there were changes between each of those jobs, you would end up
2193 with a Full backup, a Differential, which includes the first Incremental
2194 backup, then two Incremental backups.  All the above jobs would be written to
2195 the {\bf Default} pool.
2196
2197 To consolidate those backups into a new Full backup, you would run the
2198 following:
2199
2200 \begin{verbatim}
2201 run job=MyBackup level=VirtualFull
2202 \end{verbatim}
2203
2204 And it would produce a new Full backup without using the client, and the output
2205 would be written to the {\bf Full} Pool which uses the Diskchanger Storage.
2206
2207 If the Virtual Full is run, and there are no prior Jobs, the Virtual Full will
2208 fail with an error.
2209
2210 Note, the Start and End time of the Virtual Full backup is set to the
2211 values for the last job included in the Virtual Full (in the above example,
2212 it is an Increment). This is so that if another incremental is done, which
2213 will be based on the Virtual Full, it will backup all files from the
2214 last Job included in the Virtual Full rather than from the time the Virtual
2215 Full was actually run.
2216
2217
2218
2219 \subsection{Catalog Format}
2220 \index[general]{Catalog Format}
2221 Bacula 3.0 comes with some changes to the catalog format.  The upgrade
2222 operation will convert the FileId field of the File table from 32 bits (max 4
2223 billion table entries) to 64 bits (very large number of items).  The
2224 conversion process can take a bit of time and will likely DOUBLE THE SIZE of
2225 your catalog during the conversion.  Also you won't be able to run jobs during
2226 this conversion period.  For example, a 3 million file catalog will take 2
2227 minutes to upgrade on a normal machine.  Please don't forget to make a valid
2228 backup of your database before executing the upgrade script. See the 
2229 ReleaseNotes for additional details.
2230
2231 \subsection{64 bit Windows Client}
2232 \index[general]{Win64 Client}
2233 Unfortunately, Microsoft's implementation of Volume Shadown Copy (VSS) on
2234 their 64 bit OS versions is not compatible with a 32 bit Bacula Client.
2235 As a consequence, we are also releasing a 64 bit version of the Bacula 
2236 Windows Client (win64bacula-3.0.0.exe) that does work with VSS. 
2237 These binaries should only be installed on 64 bit Windows operating systems.
2238 What is important is not your hardware but whether or not you have
2239 a 64 bit version of the Windows OS.  
2240
2241 Compared to the Win32 Bacula Client, the 64 bit release contains a few differences:
2242 \begin{enumerate}
2243 \item Before installing the Win64 Bacula Client, you must totally
2244       deinstall any prior 2.4.x Client installation using the 
2245       Bacula deinstallation (see the menu item). You may want
2246       to save your .conf files first.
2247 \item Only the Client (File daemon) is ported to Win64, the Director
2248       and the Storage daemon are not in the 64 bit Windows installer.
2249 \item bwx-console is not yet ported.
2250 \item bconsole is ported but it has not been tested.
2251 \item The documentation is not included in the installer.
2252 \item Due to Vista security restrictions imposed on a default installation
2253       of Vista, before upgrading the Client, you must manually stop
2254       any prior version of Bacula from running, otherwise the install
2255       will fail.
2256 \item Due to Vista security restrictions imposed on a default installation
2257       of Vista, attempting to edit the conf files via the menu items
2258       will fail. You must directly edit the files with appropriate 
2259       permissions.  Generally double clicking on the appropriate .conf
2260       file will work providing you have sufficient permissions.
2261 \item All Bacula files are now installed in 
2262       {\bf C:/Program Files/Bacula} except the main menu items,
2263       which are installed as before. This vastly simplifies the installation.
2264 \item If you are running on a foreign language version of Windows, most
2265       likely {\bf C:/Program Files} does not exist, so you should use the
2266       Custom installation and enter an appropriate location to install
2267       the files.
2268 \item The 3.0.0 Win32 Client continues to install files in the locations used
2269       by prior versions. For the next version we will convert it to use
2270       the same installation conventions as the Win64 version.
2271 \end{enumerate}
2272
2273 This project was funded by Bacula Systems.
2274
2275
2276 \subsection{Duplicate Job Control}
2277 \index[general]{Duplicate Jobs}
2278 The new version of Bacula provides four new directives that
2279 give additional control over what Bacula does if duplicate jobs 
2280 are started.  A duplicate job in the sense we use it here means
2281 a second or subsequent job with the same name starts.  This
2282 happens most frequently when the first job runs longer than expected because no 
2283 tapes are available.
2284
2285 The four directives each take as an argument a {\bf yes} or {\bf no} value and
2286 are specified in the Job resource.
2287
2288 They are:
2289
2290 \subsubsection{Allow Duplicate Jobs = \lt{}yes\vb{}no\gt{}}
2291 \index[general]{Allow Duplicate Jobs}
2292   If this directive is set to {\bf yes}, duplicate jobs will be run.  If
2293   the directive is set to {\bf no} (default) then only one job of a given name
2294   may run at one time, and the action that Bacula takes to ensure only
2295   one job runs is determined by the other directives (see below).
2296  
2297   If {\bf Allow Duplicate Jobs} is set to {\bf no} and two jobs
2298   are present and none of the three directives given below permit
2299   Canceling a job, then the current job (the second one started)
2300   will be canceled.
2301
2302 \subsubsection{Allow Higher Duplicates = \lt{}yes\vb{}no\gt{}}
2303 \index[general]{Allow Higher Duplicates}
2304   This directive was in version 5.0.0, but does not work as
2305   expected. If used, it should always be set to no.  In later versions
2306   of Bacula the directive is disabled (disregarded).
2307
2308 \subsubsection{Cancel Running Duplicates = \lt{}yes\vb{}no\gt{}}
2309 \index[general]{Cancel Running Duplicates}
2310   If {\bf Allow Duplicate Jobs} is set to {\bf no} and
2311   if this directive is set to {\bf yes} any job that is already running
2312   will be canceled.  The default is {\bf no}.
2313
2314 \subsubsection{Cancel Queued Duplicates = \lt{}yes\vb{}no\gt{}}
2315 \index[general]{Cancel Queued Duplicates}
2316   If {\bf Allow Duplicate Jobs} is set to {\bf no} and
2317   if this directive is set to {\bf yes} any job that is
2318   already queued to run but not yet running will be canceled.
2319   The default is {\bf no}. 
2320
2321
2322 \subsection{TLS Authentication}
2323 \index[general]{TLS Authentication}
2324 In Bacula version 2.5.x and later, in addition to the normal Bacula
2325 CRAM-MD5 authentication that is used to authenticate each Bacula
2326 connection, you can specify that you want TLS Authentication as well,
2327 which will provide more secure authentication.
2328
2329 This new feature uses Bacula's existing TLS code (normally used for
2330 communications encryption) to do authentication.  To use it, you must
2331 specify all the TLS directives normally used to enable communications
2332 encryption (TLS Enable, TLS Verify Peer, TLS Certificate, ...) and
2333 a new directive:
2334
2335 \subsubsection{TLS Authenticate = yes}
2336 \begin{verbatim}
2337 TLS Authenticate = yes
2338 \end{verbatim}
2339
2340 in the main daemon configuration resource (Director for the Director,
2341 Client for the File daemon, and Storage for the Storage daemon).
2342
2343 When {\bf TLS Authenticate} is enabled, after doing the CRAM-MD5
2344 authentication, Bacula will also do TLS authentication, then TLS 
2345 encryption will be turned off, and the rest of the communication between
2346 the two Bacula daemons will be done without encryption.
2347
2348 If you want to encrypt communications data, use the normal TLS directives
2349 but do not turn on {\bf TLS Authenticate}.
2350
2351 \subsection{bextract non-portable Win32 data}
2352 \index[general]{bextract handles Win32 non-portable data}
2353 {\bf bextract} has been enhanced to be able to restore
2354 non-portable Win32 data to any OS.  Previous versions were 
2355 unable to restore non-portable Win32 data to machines that
2356 did not have the Win32 BackupRead and BackupWrite API calls.
2357
2358 \subsection{State File updated at Job Termination}
2359 \index[general]{State File}
2360 In previous versions of Bacula, the state file, which provides a
2361 summary of previous jobs run in the {\bf status} command output was
2362 updated only when Bacula terminated, thus if the daemon crashed, the
2363 state file might not contain all the run data.  This version of
2364 the Bacula daemons updates the state file on each job termination.
2365
2366 \subsection{MaxFullInterval = \lt{}time-interval\gt{}}
2367 \index[general]{MaxFullInterval}
2368 The new Job resource directive {\bf Max Full Interval = \lt{}time-interval\gt{}}
2369 can be used to specify the maximum time interval between {\bf Full} backup
2370 jobs. When a job starts, if the time since the last Full backup is
2371 greater than the specified interval, and the job would normally be an
2372 {\bf Incremental} or {\bf Differential}, it will be automatically
2373 upgraded to a {\bf Full} backup.
2374
2375 \subsection{MaxDiffInterval = \lt{}time-interval\gt{}}
2376 \index[general]{MaxDiffInterval}
2377 The new Job resource directive {\bf Max Diff Interval = \lt{}time-interval\gt{}}
2378 can be used to specify the maximum time interval between {\bf Differential} backup
2379 jobs. When a job starts, if the time since the last Differential backup is
2380 greater than the specified interval, and the job would normally be an
2381 {\bf Incremental}, it will be automatically
2382 upgraded to a {\bf Differential} backup.
2383
2384 \subsection{Honor No Dump Flag = \lt{}yes\vb{}no\gt{}}
2385 \index[general]{MaxDiffInterval}
2386 On FreeBSD systems, each file has a {\bf no dump flag} that can be set
2387 by the user, and when it is set it is an indication to backup programs
2388 to not backup that particular file.  This version of Bacula contains a
2389 new Options directive within a FileSet resource, which instructs Bacula to
2390 obey this flag.  The new directive is:
2391
2392 \begin{verbatim}
2393   Honor No Dump Flag = yes\vb{}no
2394 \end{verbatim}
2395
2396 The default value is {\bf no}.
2397
2398
2399 \subsection{Exclude Dir Containing = \lt{}filename-string\gt{}}
2400 \index[general]{IgnoreDir}
2401 The {\bf ExcludeDirContaining = \lt{}filename\gt{}} is a new directive that
2402 can be added to the Include section of the FileSet resource.  If the specified
2403 filename ({\bf filename-string}) is found on the Client in any directory to be
2404 backed up, the whole directory will be ignored (not backed up).  For example:
2405
2406 \begin{verbatim}
2407   # List of files to be backed up
2408   FileSet {
2409     Name = "MyFileSet"
2410     Include {
2411       Options {
2412         signature = MD5
2413       }
2414       File = /home
2415       Exclude Dir Containing = .excludeme
2416     }
2417   }
2418 \end{verbatim}
2419
2420 But in /home, there may be hundreds of directories of users and some
2421 people want to indicate that they don't want to have certain
2422 directories backed up. For example, with the above FileSet, if
2423 the user or sysadmin creates a file named {\bf .excludeme} in 
2424 specific directories, such as
2425
2426 \begin{verbatim}
2427    /home/user/www/cache/.excludeme
2428    /home/user/temp/.excludeme
2429 \end{verbatim}
2430
2431 then Bacula will not backup the two directories named:
2432
2433 \begin{verbatim}
2434    /home/user/www/cache
2435    /home/user/temp
2436 \end{verbatim}
2437
2438 NOTE: subdirectories will not be backed up.  That is, the directive
2439 applies to the two directories in question and any children (be they
2440 files, directories, etc).
2441
2442
2443 \subsection{Bacula Plugins}
2444 \index[general]{Plugin}
2445 Support for shared object plugins has been implemented in the Linux, Unix
2446 and Win32 File daemons. The API will be documented separately in
2447 the Developer's Guide or in a new document.  For the moment, there is
2448 a single plugin named {\bf bpipe} that allows an external program to
2449 get control to backup and restore a file.
2450
2451 Plugins are also planned (partially implemented) in the Director and the
2452 Storage daemon.  
2453
2454 \subsubsection{Plugin Directory}
2455 \index[general]{Plugin Directory}
2456 Each daemon (DIR, FD, SD) has a new {\bf Plugin Directory} directive that may
2457 be added to the daemon definition resource. The directory takes a quoted 
2458 string argument, which is the name of the directory in which the daemon can
2459 find the Bacula plugins. If this directive is not specified, Bacula will not
2460 load any plugins. Since each plugin has a distinctive name, all the daemons
2461 can share the same plugin directory. 
2462
2463 \subsubsection{Plugin Options}
2464 \index[general]{Plugin Options}
2465 The {\bf Plugin Options} directive takes a quoted string
2466 argument (after the equal sign) and may be specified in the
2467 Job resource.  The options specified will be passed to all plugins
2468 when they are run.  This each plugin must know what it is looking
2469 for. The value defined in the Job resource can be modified
2470 by the user when he runs a Job via the {\bf bconsole} command line 
2471 prompts.
2472
2473 Note: this directive may be specified, and there is code to modify
2474 the string in the run command, but the plugin options are not yet passed to
2475 the plugin (i.e. not fully implemented).
2476
2477 \subsubsection{Plugin Options ACL}
2478 \index[general]{Plugin Options ACL}
2479 The {\bf Plugin Options ACL} directive may be specified in the
2480 Director's Console resource. It functions as all the other ACL commands
2481 do by permitting users running restricted consoles to specify a 
2482 {\bf Plugin Options} that overrides the one specified in the Job
2483 definition. Without this directive restricted consoles may not modify
2484 the Plugin Options.
2485
2486 \subsubsection{Plugin = \lt{}plugin-command-string\gt{}}
2487 \index[general]{Plugin}
2488 The {\bf Plugin} directive is specified in the Include section of
2489 a FileSet resource where you put your {\bf File = xxx} directives.
2490 For example:
2491
2492 \begin{verbatim}
2493   FileSet {
2494     Name = "MyFileSet"
2495     Include {
2496       Options {
2497         signature = MD5
2498       }
2499       File = /home
2500       Plugin = "bpipe:..."
2501     }
2502   }
2503 \end{verbatim}
2504
2505 In the above example, when the File daemon is processing the directives
2506 in the Include section, it will first backup all the files in {\bf /home}
2507 then it will load the plugin named {\bf bpipe} (actually bpipe-dir.so) from
2508 the Plugin Directory.  The syntax and semantics of the Plugin directive
2509 require the first part of the string up to the colon (:) to be the name
2510 of the plugin. Everything after the first colon is ignored by the File daemon but
2511 is passed to the plugin. Thus the plugin writer may define the meaning of the
2512 rest of the string as he wishes.
2513
2514 Please see the next section for information about the {\bf bpipe} Bacula
2515 plugin.
2516
2517 \subsection{The bpipe Plugin}
2518 \index[general]{The bpipe Plugin}
2519 The {\bf bpipe} plugin is provided in the directory src/plugins/fd/bpipe-fd.c of
2520 the Bacula source distribution. When the plugin is compiled and linking into
2521 the resulting dynamic shared object (DSO), it will have the name {\bf bpipe-fd.so}.
2522 Please note that this is a very simple plugin that was written for
2523 demonstration and test purposes. It is and can be used in production, but
2524 that was never really intended.
2525
2526 The purpose of the plugin is to provide an interface to any system program for
2527 backup and restore. As specified above the {\bf bpipe} plugin is specified in
2528 the Include section of your Job's FileSet resource.  The full syntax of the
2529 plugin directive as interpreted by the {\bf bpipe} plugin (each plugin is free
2530 to specify the sytax as it wishes) is:
2531
2532 \begin{verbatim}
2533   Plugin = "<field1>:<field2>:<field3>:<field4>"
2534 \end{verbatim}
2535
2536 where
2537 \begin{description}
2538 \item {\bf field1} is the name of the plugin with the trailing {\bf -fd.so}
2539 stripped off, so in this case, we would put {\bf bpipe} in this field.
2540
2541 \item {\bf field2} specifies the namespace, which for {\bf bpipe} is the
2542 pseudo path and filename under which the backup will be saved. This pseudo
2543 path and filename will be seen by the user in the restore file tree.
2544 For example, if the value is {\bf /MYSQL/regress.sql}, the data
2545 backed up by the plugin will be put under that "pseudo" path and filename.
2546 You must be careful to choose a naming convention that is unique to avoid
2547 a conflict with a path and filename that actually exists on your system.
2548
2549 \item {\bf field3} for the {\bf bpipe} plugin 
2550 specifies the "reader" program that is called by the plugin during
2551 backup to read the data. {\bf bpipe} will call this program by doing a
2552 {\bf popen} on it. 
2553
2554 \item {\bf field4} for the {\bf bpipe} plugin
2555 specifies the "writer" program that is called by the plugin during
2556 restore to write the data back to the filesystem.  
2557 \end{description}
2558
2559 Please note that for two items above describing the "reader" and "writer"
2560 fields, these programs are "executed" by Bacula, which
2561 means there is no shell interpretation of any command line arguments
2562 you might use.  If you want to use shell characters (redirection of input
2563 or output, ...), then we recommend that you put your command or commands
2564 in a shell script and execute the script. In addition if you backup a
2565 file with the reader program, when running the writer program during
2566 the restore, Bacula will not automatically create the path to the file.
2567 Either the path must exist, or you must explicitly do so with your command
2568 or in a shell script.
2569
2570 Putting it all together, the full plugin directive line might look
2571 like the following:
2572
2573 \begin{verbatim}
2574 Plugin = "bpipe:/MYSQL/regress.sql:mysqldump -f 
2575           --opt --databases bacula:mysql"
2576 \end{verbatim}
2577
2578 The directive has been split into two lines, but within the {\bf bacula-dir.conf} file
2579 would be written on a single line.
2580
2581 This causes the File daemon to call the {\bf bpipe} plugin, which will write
2582 its data into the "pseudo" file {\bf /MYSQL/regress.sql} by calling the 
2583 program {\bf mysqldump -f --opt --database bacula} to read the data during
2584 backup. The mysqldump command outputs all the data for the database named
2585 {\bf bacula}, which will be read by the plugin and stored in the backup.
2586 During restore, the data that was backed up will be sent to the program
2587 specified in the last field, which in this case is {\bf mysql}.  When
2588 {\bf mysql} is called, it will read the data sent to it by the plugn
2589 then write it back to the same database from which it came ({\bf bacula}
2590 in this case).
2591
2592 The {\bf bpipe} plugin is a generic pipe program, that simply transmits 
2593 the data from a specified program to Bacula for backup, and then from Bacula to 
2594 a specified program for restore.
2595
2596 By using different command lines to {\bf bpipe},
2597 you can backup any kind of data (ASCII or binary) depending
2598 on the program called.
2599
2600 \subsection{Microsoft Exchange Server 2003/2007 Plugin}
2601 \index[general]{Microsoft Exchange Server 2003/2007 Plugin}
2602 \subsubsection{Background}
2603 The Exchange plugin was made possible by a funded development project
2604 between Equiinet Ltd -- www.equiinet.com (many thanks) and Bacula Systems.
2605 The code for the plugin was written by James Harper, and the Bacula core
2606 code by Kern Sibbald.  All the code for this funded development has become
2607 part of the Bacula project.  Thanks to everyone who made it happen.
2608
2609 \subsubsection{Concepts}
2610 Although it is possible to backup Exchange using Bacula VSS the Exchange 
2611 plugin adds a good deal of functionality, because while Bacula VSS
2612 completes a full backup (snapshot) of Exchange, it does
2613 not support Incremental or Differential backups, restoring is more
2614 complicated, and a single database restore is not possible.
2615
2616 Microsoft Exchange organises its storage into Storage Groups with
2617 Databases inside them. A default installation of Exchange will have a
2618 single Storage Group called 'First Storage Group', with two Databases
2619 inside it, "Mailbox Store (SERVER NAME)" and 
2620 "Public Folder Store (SERVER NAME)", 
2621 which hold user email and public folders respectively.
2622
2623 In the default configuration, Exchange logs everything that happens to
2624 log files, such that if you have a backup, and all the log files since,
2625 you can restore to the present time. Each Storage Group has its own set
2626 of log files and operates independently of any other Storage Groups. At
2627 the Storage Group level, the logging can be turned off by enabling a
2628 function called "Enable circular logging". At this time the Exchange
2629 plugin will not function if this option is enabled.
2630
2631 The plugin allows backing up of entire storage groups, and the restoring
2632 of entire storage groups or individual databases. Backing up and
2633 restoring at the individual mailbox or email item is not supported but
2634 can be simulated by use of the "Recovery" Storage Group (see below).
2635
2636 \subsubsection{Installing}
2637 The Exchange plugin requires a DLL that is shipped with Microsoft
2638 Exchanger Server called {\bf esebcli2.dll}. Assuming Exchange is installed
2639 correctly the Exchange plugin should find this automatically and run
2640 without any additional installation.
2641
2642 If the DLL can not be found automatically it will need to be copied into
2643 the Bacula installation
2644 directory (eg C:\verb+\+Program Files\verb+\+Bacula\verb+\+bin). The Exchange API DLL is
2645 named esebcli2.dll and is found in C:\verb+\+Program Files\verb+\+Exchsrvr\verb+\+bin on a
2646 default Exchange installation.
2647
2648 \subsubsection{Backing Up}
2649 To back up an Exchange server the Fileset definition must contain at
2650 least {\bf Plugin = "exchange:/@EXCHANGE/Microsoft Information Store"} for
2651 the backup to work correctly. The 'exchange:' bit tells Bacula to look
2652 for the exchange plugin, the '@EXCHANGE' bit makes sure all the backed
2653 up files are prefixed with something that isn't going to share a name
2654 with something outside the plugin, and the 'Microsoft Information Store'
2655 bit is required also. It is also possible to add the name of a storage
2656 group to the "Plugin =" line, eg \\
2657 {\bf Plugin = "exchange:/@EXCHANGE/Microsoft Information Store/First Storage Group"} \\
2658 if you want only a single storage group backed up.
2659
2660 Additionally, you can suffix the 'Plugin =' directive with
2661 ":notrunconfull" which will tell the plugin not to truncate the Exchange
2662 database at the end of a full backup.
2663
2664 An Incremental or Differential backup will backup only the database logs
2665 for each Storage Group by inspecting the "modified date" on each
2666 physical log file. Because of the way the Exchange API works, the last
2667 logfile backed up on each backup will always be backed up by the next
2668 Incremental or Differential backup too. This adds 5MB to each
2669 Incremental or Differential backup size but otherwise does not cause any
2670 problems.
2671
2672 By default, a normal VSS fileset containing all the drive letters will
2673 also back up the Exchange databases using VSS. This will interfere with
2674 the plugin and Exchange's shared ideas of when the last full backup was
2675 done, and may also truncate log files incorrectly. It is important,
2676 therefore, that the Exchange database files be excluded from the backup,
2677 although the folders the files are in should be included, or they will
2678 have to be recreated manually if a bare metal restore is done.
2679
2680 \begin{verbatim}
2681 FileSet {
2682    Include {
2683       File = C:/Program Files/Exchsrvr/mdbdata
2684       Plugin = "exchange:..."
2685    }
2686    Exclude {
2687       File = C:/Program Files/Exchsrvr/mdbdata/E00.chk
2688       File = C:/Program Files/Exchsrvr/mdbdata/E00.log
2689       File = C:/Program Files/Exchsrvr/mdbdata/E000000F.log
2690       File = C:/Program Files/Exchsrvr/mdbdata/E0000010.log
2691       File = C:/Program Files/Exchsrvr/mdbdata/E0000011.log
2692       File = C:/Program Files/Exchsrvr/mdbdata/E00tmp.log
2693       File = C:/Program Files/Exchsrvr/mdbdata/priv1.edb
2694    }
2695 }
2696 \end{verbatim}
2697
2698 The advantage of excluding the above files is that you can significantly
2699 reduce the size of your backup since all the important Exchange files
2700 will be properly saved by the Plugin.
2701
2702
2703 \subsubsection{Restoring}
2704 The restore operation is much the same as a normal Bacula restore, with
2705 the following provisos:
2706
2707 \begin{itemize}
2708 \item  The {\bf Where} restore option must not be specified
2709 \item Each Database directory must be marked as a whole. You cannot just
2710      select (say) the .edb file and not the others.
2711 \item If a Storage Group is restored, the directory of the Storage Group
2712      must be marked too.
2713 \item  It is possible to restore only a subset of the available log files,
2714      but they {\bf must} be contiguous. Exchange will fail to restore correctly
2715      if a log file is missing from the sequence of log files
2716 \item Each database to be restored must be dismounted and marked as "Can be
2717     overwritten by restore"
2718 \item If an entire Storage Group is to be restored (eg all databases and
2719    logs in the Storage Group), then it is best to manually delete the
2720    database files from the server (eg C:\verb+\+Program Files\verb+\+Exchsrvr\verb+\+mdbdata\verb+\+*)
2721    as Exchange can get confused by stray log files lying around.
2722 \end{itemize}
2723
2724 \subsubsection{Restoring to the Recovery Storage Group}
2725 The concept of the Recovery Storage Group is well documented by
2726 Microsoft 
2727 \elink{http://support.microsoft.com/kb/824126}{http://support.microsoft.com/kb/824126}, 
2728 but to briefly summarize...
2729
2730 Microsoft Exchange allows the creation of an additional Storage Group
2731 called the Recovery Storage Group, which is used to restore an older
2732 copy of a database (e.g. before a mailbox was deleted) into without
2733 messing with the current live data. This is required as the Standard and
2734 Small Business Server versions of Exchange can not ordinarily have more
2735 than one Storage Group.
2736
2737 To create the Recovery Storage Group, drill down to the Server in Exchange
2738 System Manager, right click, and select
2739 {\bf "New -> Recovery Storage Group..."}.  Accept or change the file
2740 locations and click OK. On the Recovery Storage Group, right click and
2741 select {\bf "Add Database to Recover..."} and select the database you will
2742 be restoring.
2743
2744 Restore only the single database nominated as the database in the
2745 Recovery Storage Group. Exchange will redirect the restore to the
2746 Recovery Storage Group automatically.
2747 Then run the restore.
2748
2749 \subsubsection{Restoring on Microsoft Server 2007}
2750 Apparently the {\bf Exmerge} program no longer exists in Microsoft Server
2751 2007, and hence you use a new procedure for recovering a single mail box.
2752 This procedure is documented by Microsoft at:
2753 \elink{http://technet.microsoft.com/en-us/library/aa997694.aspx}{http://technet.microsoft.com/en-us/library/aa997694.aspx},
2754 and involves using the {\bf Restore-Mailbox} and {\bf
2755 Get-Mailbox Statistics} shell commands.
2756
2757 \subsubsection{Caveats}
2758 This plugin is still being developed, so you should consider it
2759 currently in BETA test, and thus use in a production environment
2760 should be done only after very careful testing.
2761
2762 When doing a full backup, the Exchange database logs are truncated by
2763 Exchange as soon as the plugin has completed the backup. If the data
2764 never makes it to the backup medium (eg because of spooling) then the
2765 logs will still be truncated, but they will also not have been backed
2766 up. A solution to this is being worked on. You will have to schedule a
2767 new Full backup to ensure that your next backups will be usable.
2768
2769 The "Enable Circular Logging" option cannot be enabled or the plugin
2770 will fail.
2771
2772 Exchange insists that a successful Full backup must have taken place if
2773 an Incremental or Differential backup is desired, and the plugin will
2774 fail if this is not the case. If a restore is done, Exchange will
2775 require that a Full backup be done before an Incremental or Differential
2776 backup is done.
2777
2778 The plugin will most likely not work well if another backup application
2779 (eg NTBACKUP) is backing up the Exchange database, especially if the
2780 other backup application is truncating the log files.
2781
2782 The Exchange plugin has not been tested with the {\bf Accurate} option, so
2783 we recommend either carefully testing or that you avoid this option for
2784 the current time.
2785
2786 The Exchange plugin is not called during processing the bconsole {\bf
2787 estimate} command, and so anything that would be backed up by the plugin
2788 will not be added to the estimate total that is displayed.
2789
2790
2791 \subsection{libdbi Framework}
2792 \index[general]{libdbi Framework}
2793 As a general guideline, Bacula has support for a few catalog database drivers
2794 (MySQL, PostgreSQL, SQLite)
2795 coded natively by the Bacula team.  With the libdbi implementation, which is a
2796 Bacula driver that uses libdbi to access the catalog, we have an open field to
2797 use many different kinds database engines following the needs of users.
2798
2799 The according to libdbi (http://libdbi.sourceforge.net/) project: libdbi
2800 implements a database-independent abstraction layer in C, similar to the
2801 DBI/DBD layer in Perl. Writing one generic set of code, programmers can
2802 leverage the power of multiple databases and multiple simultaneous database
2803 connections by using this framework.
2804
2805 Currently the libdbi driver in Bacula project only supports the same drivers
2806 natively coded in Bacula.  However the libdbi project has support for many
2807 others database engines. You can view the list at
2808 http://libdbi-drivers.sourceforge.net/. In the future all those drivers can be
2809 supported by Bacula, however, they must be tested properly by the Bacula team.
2810
2811 Some of benefits of using libdbi are:
2812 \begin{itemize}
2813 \item The possibility to use proprietary databases engines in which your
2814   proprietary licenses prevent the Bacula team from developing the driver.
2815  \item The possibility to use the drivers written for the libdbi project.
2816  \item The possibility to use other database engines without recompiling Bacula
2817    to use them.  Just change one line in bacula-dir.conf
2818  \item Abstract Database access, this is, unique point to code and profiling
2819    catalog database access.
2820  \end{itemize}
2821  
2822  The following drivers have been tested:
2823  \begin{itemize}
2824  \item PostgreSQL, with and without batch insert
2825  \item Mysql, with and without batch insert
2826  \item SQLite
2827  \item SQLite3
2828  \end{itemize}
2829
2830  In the future, we will test and approve to use others databases engines
2831  (proprietary or not) like DB2, Oracle, Microsoft SQL.
2832
2833  To compile Bacula to support libdbi we need to configure the code with the
2834  --with-dbi and --with-dbi-driver=[database] ./configure options, where
2835  [database] is the database engine to be used with Bacula (of course we can
2836  change the driver in file bacula-dir.conf, see below).  We must configure the
2837  access port of the database engine with the option --with-db-port, because the
2838  libdbi framework doesn't know the default access port of each database.
2839
2840 The next phase is checking (or configuring) the bacula-dir.conf, example:
2841 \begin{verbatim}
2842 Catalog {
2843   Name = MyCatalog
2844   dbdriver = dbi:mysql; dbaddress = 127.0.0.1; dbport = 3306
2845   dbname = regress; user = regress; password = ""
2846 }
2847 \end{verbatim}
2848
2849 The parameter {\bf dbdriver} indicates that we will use the driver dbi with a
2850 mysql database.  Currently the drivers supported by Bacula are: postgresql,
2851 mysql, sqlite, sqlite3; these are the names that may be added to string "dbi:".
2852
2853 The following limitations apply when Bacula is set to use the libdbi framework:
2854  - Not tested on the Win32 platform
2855  - A little performance is lost if comparing with native database driver. 
2856    The reason is bound with the database driver provided by libdbi and the 
2857    simple fact that one more layer of code was added.
2858
2859 It is important to remember, when compiling Bacula with libdbi, the
2860 following packages are needed:
2861  \begin{itemize}
2862   \item libdbi version 1.0.0, http://libdbi.sourceforge.net/
2863   \item libdbi-drivers 1.0.0, http://libdbi-drivers.sourceforge.net/
2864  \end{itemize}
2865  
2866  You can download them and compile them on your system or install the packages
2867  from your OS distribution.
2868
2869 \subsection{Console Command Additions and Enhancements}
2870 \index[general]{Console Additions}                                 
2871
2872 \subsubsection{Display Autochanger Content}
2873 \index[general]{StatusSlots}
2874
2875 The {\bf status slots storage=\lt{}storage-name\gt{}} command displays
2876 autochanger content.
2877
2878 \footnotesize
2879 \begin{verbatim}
2880  Slot |  Volume Name  |  Status  |  Media Type       |   Pool     |
2881 ------+---------------+----------+-------------------+------------|
2882     1 |         00001 |   Append |  DiskChangerMedia |    Default |
2883     2 |         00002 |   Append |  DiskChangerMedia |    Default |
2884     3*|         00003 |   Append |  DiskChangerMedia |    Scratch |
2885     4 |               |          |                   |            |
2886 \end{verbatim}
2887 \normalsize
2888
2889 If you an asterisk ({\bf *}) appears after the slot number, you must run an
2890 {\bf update slots} command to synchronize autochanger content with your
2891 catalog.
2892
2893 \subsubsection{list joblog job=xxx or jobid=nnn}
2894 \index[general]{list joblog}
2895 A new list command has been added that allows you to list the contents
2896 of the Job Log stored in the catalog for either a Job Name (fully qualified)
2897 or for a particular JobId.  The {\bf llist} command will include a line with
2898 the time and date of the entry.
2899
2900 Note for the catalog to have Job Log entries, you must have a directive 
2901 such as:
2902
2903 \begin{verbatim}
2904   catalog = all
2905 \end{verbatim}
2906
2907 In your Director's {\bf Messages} resource.
2908
2909 \subsubsection{Use separator for multiple commands}
2910 \index[general]{Command Separator}
2911   When using bconsole with readline, you can set the command separator with 
2912   \textbf{@separator} command to one
2913   of those characters to write commands who require multiple input in one line.
2914 \begin{verbatim}
2915   !$%&'()*+,-/:;<>?[]^`{|}~
2916 \end{verbatim}
2917
2918 \subsubsection{Deleting Volumes}
2919 The delete volume bconsole command has been modified to
2920 require an asterisk (*) in front of a MediaId otherwise the
2921 value you enter is a taken to be a Volume name. This is so that
2922 users may delete numeric Volume names. The previous Bacula versions
2923 assumed that all input that started with a number was a MediaId.
2924
2925 This new behavior is indicated in the prompt if you read it
2926 carefully.
2927
2928 \subsection{Bare Metal Recovery}
2929 The old bare metal recovery project is essentially dead. One
2930 of the main features of it was that it would build a recovery
2931 CD based on the kernel on your system. The problem was that
2932 every distribution has a different boot procedure and different 
2933 scripts, and worse yet, the boot procedures and scripts change
2934 from one distribution to another.  This meant that maintaining
2935 (keeping up with the changes) the rescue CD was too much work.
2936
2937 To replace it, a new bare metal recovery USB boot stick has been developed
2938 by Bacula Systems.  This technology involves remastering a Ubuntu LiveCD to
2939 boot from a USB key.  
2940
2941 Advantages: 
2942 \begin{enumerate} 
2943 \item Recovery can be done from within graphical environment.  
2944 \item Recovery can be done in a shell.  
2945 \item Ubuntu boots on a large number of Linux systems.  
2946 \item The process of updating the system and adding new
2947    packages is not too difficult. 
2948 \item The USB key can easily be upgraded to newer Ubuntu versions.
2949 \item The USB key has writable partitions for modifications to
2950    the OS and for modification to your home directory.
2951 \item You can add new files/directories to the USB key very easily.
2952 \item You can save the environment from multiple machines on
2953    one USB key.
2954 \item Bacula Systems is funding its ongoing development.
2955 \end{enumerate}
2956
2957 The disadvantages are:
2958 \begin{enumerate}
2959 \item The USB key is usable but currently under development.
2960 \item Not everyone may be familiar with Ubuntu (no worse
2961   than using Knoppix)
2962 \item Some older OSes cannot be booted from USB. This can
2963    be resolved by first booting a Ubuntu LiveCD then plugging
2964    in the USB key.
2965 \item Currently the documentation is sketchy and not yet added
2966    to the main manual. See below ...
2967 \end{enumerate}
2968
2969 The documentation and the code can be found in the {\bf rescue} package
2970 in the directory {\bf linux/usb}.
2971
2972 \subsection{Miscellaneous}
2973 \index[general]{Misc New Features}
2974
2975 \subsubsection{Allow Mixed Priority = \lt{}yes\vb{}no\gt{}}
2976 \index[general]{Allow Mixed Priority}
2977    This directive is only implemented in version 2.5 and later.  When
2978    set to {\bf yes} (default {\bf no}), this job may run even if lower
2979    priority jobs are already running.  This means a high priority job
2980    will not have to wait for other jobs to finish before starting.
2981    The scheduler will only mix priorities when all running jobs have
2982    this set to true.
2983
2984    Note that only higher priority jobs will start early.  Suppose the
2985    director will allow two concurrent jobs, and that two jobs with
2986    priority 10 are running, with two more in the queue.  If a job with
2987    priority 5 is added to the queue, it will be run as soon as one of
2988    the running jobs finishes.  However, new priority 10 jobs will not
2989    be run until the priority 5 job has finished.
2990
2991 \subsubsection{Bootstrap File Directive -- FileRegex}
2992 \index[general]{Bootstrap File Directive}
2993   {\bf FileRegex} is a new command that can be added to the bootstrap
2994   (.bsr) file.  The value is a regular expression.  When specified, only
2995   matching filenames will be restored.
2996
2997   During a restore, if all File records are pruned from the catalog
2998   for a Job, normally Bacula can restore only all files saved. That
2999   is there is no way using the catalog to select individual files.
3000   With this new feature, Bacula will ask if you want to specify a Regex
3001   expression for extracting only a part of the full backup.
3002
3003 \begin{verbatim}
3004   Building directory tree for JobId(s) 1,3 ...
3005   There were no files inserted into the tree, so file selection
3006   is not possible.Most likely your retention policy pruned the files
3007   
3008   Do you want to restore all the files? (yes\vb{}no): no
3009   
3010   Regexp matching files to restore? (empty to abort): /tmp/regress/(bin|tests)/
3011   Bootstrap records written to /tmp/regress/working/zog4-dir.restore.1.bsr
3012 \end{verbatim}
3013
3014 \subsubsection{Bootstrap File Optimization Changes}
3015 In order to permit proper seeking on disk files, we have extended the bootstrap
3016 file format to include a {\bf VolStartAddr} and {\bf VolEndAddr} records. Each
3017 takes a 64 bit unsigned integer range (i.e. nnn-mmm) which defines the start
3018 address range and end address range respectively.  These two directives replace
3019 the {\bf VolStartFile}, {\bf VolEndFile}, {\bf VolStartBlock} and {\bf
3020   VolEndBlock} directives.  Bootstrap files containing the old directives will
3021 still work, but will not properly take advantage of proper disk seeking, and
3022 may read completely to the end of a disk volume during a restore.  With the new
3023 format (automatically generated by the new Director), restores will seek
3024 properly and stop reading the volume when all the files have been restored.
3025
3026 \subsubsection{Solaris ZFS/NFSv4 ACLs}
3027 This is an upgrade of the previous Solaris ACL backup code
3028 to the new library format, which will backup both the old
3029 POSIX(UFS) ACLs as well as the ZFS ACLs.
3030
3031 The new code can also restore POSIX(UFS) ACLs to a ZFS filesystem
3032 (it will translate the POSIX(UFS)) ACL into a ZFS/NFSv4 one) it can also
3033 be used to transfer from UFS to ZFS filesystems.
3034
3035
3036 \subsubsection{Virtual Tape Emulation}
3037 \index[general]{Virtual Tape Emulation}
3038 We now have a Virtual Tape emulator that allows us to run though 99.9\% of
3039 the tape code but actually reading and writing to a disk file. Used with the
3040 \textbf{disk-changer} script, you can now emulate an autochanger with 10 drives
3041 and 700 slots. This feature is most useful in testing.  It is enabled
3042 by using {\bf Device Type = vtape} in the Storage daemon's Device
3043 directive. This feature is only implemented on Linux machines and should not be
3044 used for production.
3045
3046 \subsubsection{Bat Enhancements}
3047 \index[general]{Bat Enhancements}
3048 Bat (the Bacula Administration Tool) GUI program has been significantly
3049 enhanced and stabilized. In particular, there are new table based status 
3050 commands; it can now be easily localized using Qt4 Linguist.
3051
3052 The Bat communications protocol has been significantly enhanced to improve
3053 GUI handling. Note, you {\bf must} use a the bat that is distributed with
3054 the Director you are using otherwise the communications protocol will not
3055 work.
3056
3057 \subsubsection{RunScript Enhancements}
3058 \index[general]{RunScript Enhancements}
3059 The {\bf RunScript} resource has been enhanced to permit multiple
3060 commands per RunScript.  Simply specify multiple {\bf Command} directives
3061 in your RunScript.
3062
3063 \begin{verbatim}
3064 Job {
3065   Name = aJob
3066   RunScript {
3067     Command = "/bin/echo test"
3068     Command = "/bin/echo an other test"
3069     Command = "/bin/echo 3 commands in the same runscript"
3070     RunsWhen = Before
3071   }
3072  ...
3073 }
3074 \end{verbatim}
3075
3076 A new Client RunScript {\bf RunsWhen} keyword of {\bf AfterVSS} has been
3077 implemented, which runs the command after the Volume Shadow Copy has been made.
3078
3079 Console commands can be specified within a RunScript by using:
3080 {\bf Console = \lt{}command\gt{}}, however, this command has not been 
3081 carefully tested and debugged and is known to easily crash the Director.
3082 We would appreciate feedback.  Due to the recursive nature of this command, we
3083 may remove it before the final release.
3084
3085 \subsubsection{Status Enhancements}
3086 \index[general]{Status Enhancements}
3087 The bconsole {\bf status dir} output has been enhanced to indicate
3088 Storage daemon job spooling and despooling activity.
3089
3090 \subsubsection{Connect Timeout}
3091 \index[general]{Connect Timeout}
3092 The default connect timeout to the File
3093 daemon has been set to 3 minutes. Previously it was 30 minutes.
3094
3095 \subsubsection{ftruncate for NFS Volumes}
3096 \index[general]{ftruncate for NFS Volumes}
3097 If you write to a Volume mounted by NFS (say on a local file server),
3098 in previous Bacula versions, when the Volume was recycled, it was not
3099 properly truncated because NFS does not implement ftruncate (file 
3100 truncate). This is now corrected in the new version because we have
3101 written code (actually a kind user) that deletes and recreates the Volume,
3102 thus accomplishing the same thing as a truncate.
3103
3104 \subsubsection{Support for Ubuntu}
3105 The new version of Bacula now recognizes the Ubuntu (and Kubuntu)
3106 version of Linux, and thus now provides correct autostart routines.
3107 Since Ubuntu officially supports Bacula, you can also obtain any
3108 recent release of Bacula from the Ubuntu repositories.
3109
3110 \subsubsection{Recycle Pool = \lt{}pool-name\gt{}}
3111 \index[general]{Recycle Pool}
3112 The new \textbf{RecyclePool} directive defines to which pool the Volume will
3113 be placed (moved) when it is recycled. Without this directive, a Volume will
3114 remain in the same pool when it is recycled. With this directive, it can be
3115 moved automatically to any existing pool during a recycle. This directive is
3116 probably most useful when defined in the Scratch pool, so that volumes will
3117 be recycled back into the Scratch pool.
3118
3119 \subsubsection{FD Version}
3120 \index[general]{FD Version}
3121 The File daemon to Director protocol now includes a version 
3122 number, which although there is no visible change for users, 
3123 will help us in future versions automatically determine
3124 if a File daemon is not compatible.
3125
3126 \subsubsection{Max Run Sched Time = \lt{}time-period-in-seconds\gt{}}
3127 \index[general]{Max Run Sched Time}
3128 The time specifies the maximum allowed time that a job may run, counted from
3129 when the job was scheduled. This can be useful to prevent jobs from running
3130 during working hours. We can see it like \texttt{Max Start Delay + Max Run
3131   Time}.
3132
3133 \subsubsection{Max Wait Time = \lt{}time-period-in-seconds\gt{}}
3134 \index[general]{Max Wait Time}
3135 Previous \textbf{MaxWaitTime} directives aren't working as expected, instead
3136 of checking the maximum allowed time that a job may block for a resource,
3137 those directives worked like \textbf{MaxRunTime}. Some users are reporting to
3138 use \textbf{Incr/Diff/Full Max Wait Time} to control the maximum run time of
3139 their job depending on the level. Now, they have to use
3140 \textbf{Incr/Diff/Full Max Run Time}.  \textbf{Incr/Diff/Full Max Wait Time}
3141 directives are now deprecated.
3142
3143 \subsubsection{Incremental|Differential Max Wait Time = \lt{}time-period-in-seconds\gt{}} 
3144 \index[general]{Incremental Max Wait Time}
3145 \index[general]{Differential Max Wait Time}
3146
3147 These directives have been deprecated in favor of
3148 \texttt{Incremental|Differential Max Run Time}.
3149
3150 \subsubsection{Max Run Time directives}
3151 \index[general]{Max Run Time directives}
3152 Using \textbf{Full/Diff/Incr Max Run Time}, it's now possible to specify the
3153 maximum allowed time that a job can run depending on the level.
3154
3155 \addcontentsline{lof}{figure}{Job time control directives}
3156 \begin{center}
3157 \includegraphics[width=\linewidth]{different_time}
3158 \end{center}
3159
3160 \subsubsection{Statistics Enhancements}
3161 \index[general]{Statistics Enhancements}
3162 If you (or probably your boss) want to have statistics on your backups to
3163 provide some \textit{Service Level Agreement} indicators, you could use a few
3164 SQL queries on the Job table to report how many:
3165
3166 \begin{itemize}
3167 \item jobs have run
3168 \item jobs have been successful
3169 \item files have been backed up
3170 \item ...
3171 \end{itemize}
3172
3173 However, these statistics are accurate only if your job retention is greater
3174 than your statistics period. Ie, if jobs are purged from the catalog, you won't
3175 be able to use them. 
3176
3177 Now, you can use the \textbf{update stats [days=num]} console command to fill
3178 the JobHistory table with new Job records. If you want to be sure to take in
3179 account only \textbf{good jobs}, ie if one of your important job has failed but
3180 you have fixed the problem and restarted it on time, you probably want to
3181 delete the first \textit{bad} job record and keep only the successful one. For
3182 that simply let your staff do the job, and update JobHistory table after two or
3183 three days depending on your organization using the \textbf{[days=num]} option.
3184
3185 These statistics records aren't used for restoring, but mainly for
3186 capacity planning, billings, etc.
3187
3188 The Bweb interface provides a statistics module that can use this feature. You
3189 can also use tools like Talend or extract information by yourself.
3190
3191 The \textbf{Statistics Retention = \lt{}time\gt{}} director directive defines
3192 the length of time that Bacula will keep statistics job records in the Catalog
3193 database after the Job End time. (In \texttt{JobHistory} table) When this time
3194 period expires, and if user runs \texttt{prune stats} command, Bacula will
3195 prune (remove) Job records that are older than the specified period.
3196
3197 You can use the following Job resource in your nightly \textbf{BackupCatalog}
3198 job to maintain statistics.
3199 \begin{verbatim}
3200 Job {
3201   Name = BackupCatalog
3202   ...
3203   RunScript {
3204     Console = "update stats days=3"
3205     Console = "prune stats yes"
3206     RunsWhen = After
3207     RunsOnClient = no
3208   }
3209 }
3210 \end{verbatim}
3211
3212 \subsubsection{ScratchPool = \lt{}pool-resource-name\gt{}}
3213 \index[general]{ScratchPool}
3214 This directive permits to specify a specific \textsl{Scratch} pool for the
3215 current pool. This is useful when using multiple storage sharing the same
3216 mediatype or when you want to dedicate volumes to a particular set of pool.
3217
3218 \subsubsection{Enhanced Attribute Despooling}
3219 \index[general]{Attribute Despooling}
3220 If the storage daemon and the Director are on the same machine, the spool file
3221 that contains attributes is read directly by the Director instead of being
3222 transmitted across the network. That should reduce load and speedup insertion.
3223
3224 \subsubsection{SpoolSize = \lt{}size-specification-in-bytes\gt{}}
3225 \index[general]{SpoolSize}
3226 A new Job directive permits to specify the spool size per job. This is used
3227 in advanced job tunning. {\bf SpoolSize={\it bytes}}
3228
3229 \subsubsection{MaximumConsoleConnections = \lt{}number\gt{}}
3230 \index[general]{MaximumConsoleConnections}
3231 A new director directive permits to specify the maximum number of Console
3232 Connections that could run concurrently. The default is set to 20, but you may
3233 set it to a larger number.
3234
3235 \subsubsection{VerId = \lt{}string\gt{}}
3236 \index[general]{VerId}
3237 A new director directive permits to specify a personnal identifier that will be
3238 displayed in the \texttt{version} command.
3239
3240 \subsubsection{dbcheck enhancements}
3241 \index[general]{dbcheck enhancements}
3242 If you are using Mysql, dbcheck will now ask you if you want to create
3243 temporary indexes to speed up orphaned Path and Filename elimination. 
3244
3245 A new \texttt{-B} option allows you to print catalog information in a simple
3246 text based format. This is useful to backup it in a secure way.
3247
3248 \begin{verbatim}
3249  $ dbcheck -B 
3250  catalog=MyCatalog
3251  db_type=SQLite
3252  db_name=regress
3253  db_driver=
3254  db_user=regress
3255  db_password=
3256  db_address=
3257  db_port=0
3258  db_socket=
3259 \end{verbatim} %$
3260
3261 You can now specify the database connection port in the command line.
3262
3263 \subsubsection{{-}{-}docdir configure option}
3264 \index[general]{{-}{-}docdir configure option}
3265 You can use {-}{-}docdir= on the ./configure command to
3266 specify the directory where you want Bacula to install the
3267 LICENSE, ReleaseNotes, ChangeLog, ... files.   The default is 
3268 {\bf /usr/share/doc/bacula}.
3269       
3270 \subsubsection{{-}{-}htmldir configure option}
3271 \index[general]{{-}{-}htmldir configure option}
3272 You can use {-}{-}htmldir= on the ./configure command to
3273 specify the directory where you want Bacula to install the bat html help
3274 files. The default is {\bf /usr/share/doc/bacula/html}
3275
3276 \subsubsection{{-}{-}with-plugindir configure option}
3277 \index[general]{{-}{-}plugindir configure option}
3278 You can use {-}{-}plugindir= on the ./configure command to
3279 specify the directory where you want Bacula to install
3280 the plugins (currently only bpipe-fd). The default is
3281 /usr/lib.