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