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