]> git.sur5r.net Git - bacula/docs/blob - docs/manual/disk.tex
Update copyright
[bacula/docs] / docs / manual / disk.tex
1 %%
2 %%
3
4 \section*{Basic Volume Management}
5 \label{_ChapterStart39}
6 \index[general]{Basic Volume Management}
7 \index[general]{Management!Basic Volume}
8 \index[general]{Disk Volumes}
9 \addcontentsline{toc}{section}{Basic Volume Management}
10
11 This chapter presents most all the features needed to do Volume management.
12 Most of the concepts apply equally well to both tape and disk Volumes.
13 However, the chapter was originally written to explain backing up to disk, so
14 you will see it is slanted in that direction, but all the directives
15 presented here apply equally well whether your volume is disk or tape. 
16
17 If you have a lot of hard disk storage or you absolutely must have your
18 backups run within a small time window, you may want to direct Bacula to
19 backup to disk Volumes rather than tape Volumes. This chapter is intended to
20 give you some of the options that are available to you so that you can manage
21 either disk or tape volumes. 
22
23 \label{Concepts}
24 \subsection*{Key Concepts and Resource Records}
25 \index[general]{Key Concepts and Resource Records }
26 \index[general]{Records!Key Concepts and Resource }
27 \addcontentsline{toc}{subsection}{Key Concepts and Resource Records}
28
29 Getting Bacula to write to disk rather than tape in the simplest case is
30 rather easy. In the Storage daemon's configuration file, you simply define an
31 {\bf Archive Device} to be a directory. For example, if you want your disk
32 backups to go into the directory {\bf /home/bacula/backups}, you could use the
33 following: 
34
35 \footnotesize
36 \begin{verbatim}
37 Device {
38   Name = FileBackup
39   Media Type = File
40   Archive Device = /home/bacula/backups
41   Random Access = Yes;
42   AutomaticMount = yes;
43   RemovableMedia = no;
44   AlwaysOpen = no;
45 }
46 \end{verbatim}
47 \normalsize
48
49 Assuming you have the appropriate {\bf Storage} resource in your Director's
50 configuration file that references the above Device resource, 
51
52 \footnotesize
53 \begin{verbatim}
54 Storage {
55   Name = FileStorage
56   Address = ...
57   Password = ...
58   Device = FileBackup
59   Media Type = File
60 }
61 \end{verbatim}
62 \normalsize
63
64 Bacula will then write the archive to the file {\bf
65 /home/bacula/backups/\lt{}volume-name\gt{}} where \lt{}volume-name\gt{} is the
66 volume name of a Volume defined in the Pool. For example, if you have labeled
67 a Volume named {\bf Vol001}, Bacula will write to the file {\bf
68 /home/bacula/backups/Vol001}. Although you can later move the archive file to
69 another directory, you should not rename it or it will become unreadable by
70 Bacula. This is because each archive has the filename as part of the internal
71 label, and the internal label must agree with the system filename before
72 Bacula will use it. 
73
74 Although this is quite simple, there are a number of problems. The first is
75 that unless you specify otherwise, Bacula will always write to the same volume
76 until you run out of disk space. This problem is addressed below.
77
78 In addition, if you want to use concurrent jobs that write to several
79 different volumes at the same time, you will need to understand a number
80 of other details. An example of such a configuration is given
81 at the end of this chapter under \ilink{Concurrent Disk
82 Jobs}{ConcurrentDiskJobs}.
83
84 \subsubsection*{Pool Options to Limit the Volume Usage}
85 \index[general]{Usage!Pool Options to Limit the Volume }
86 \index[general]{Pool Options to Limit the Volume Usage }
87 \addcontentsline{toc}{subsubsection}{Pool Options to Limit the Volume Usage}
88
89 Some of the options you have, all of which are specified in the Pool record,
90 are: 
91
92 \begin{itemize}
93 \item To write each Volume only once (i.e. one Job per Volume or file  in this
94    case), use:
95
96 {\bf UseVolumeOnce = yes}. 
97
98 \item To write nnn Jobs to each Volume, use:
99
100    {\bf Maximum Volume Jobs = nnn}.  
101
102 \item To limit the maximum size of each Volume, use:
103
104    {\bf Maximum Volume Bytes = mmmm}.  
105
106    Note, if you use disk volumes, with all versions up to and including
107    1.39.28, you should probably limit the Volume size to some reasonable 
108    value such as say 5GB. This is because during a restore, Bacula is
109    currently unable to seek to the proper place in a disk volume to restore
110    a file, which means that it must read all records up to where the
111    restore begins. If your Volumes are 50GB, reading half or more of the
112    volume could take quite a bit of time.  Also, if you ever have a partial
113    hard disk failure, you are more likely to be able to recover more data
114    if they are in smaller Volumes.
115
116 \item To limit the use time (i.e. write the Volume for  a maximum of 5 days),
117    use:
118
119 {\bf Volume Use Duration = ttt}. 
120 \end{itemize}
121
122 Note that although you probably would not want to limit the number of bytes on
123 a tape as you would on a disk Volume, the other options can be very useful in
124 limiting the time Bacula will use a particular Volume (be it tape or disk).
125 For example, the above directives can allow you to ensure that you rotate
126 through a set of daily Volumes if you wish. 
127
128 As mentioned above, each of those directives is specified in the Pool or
129 Pools that you use for your Volumes. In the case of {\bf Maximum Volume Job},
130 {\bf Maximum Volume Bytes}, and {\bf Volume Use Duration}, you can actually
131 specify the desired value on a Volume by Volume basis. The value specified in
132 the Pool record becomes the default when labeling new Volumes. Once a Volume
133 has been created, it gets its own copy of the Pool defaults, and subsequently
134 changing the Pool will have no effect on existing Volumes. You can either
135 manually change the Volume values, or refresh them from the Pool defaults using
136 the {\bf update volume} command in the Console. As an example
137 of the use of one of the above, suppose your Pool resource contains: 
138
139 \footnotesize
140 \begin{verbatim}
141 Pool {
142   Name = File
143   Pool Type = Backup
144   Volume Use Duration = 23h
145 }
146 \end{verbatim}
147 \normalsize
148
149 then if you run a backup once a day (every 24 hours), Bacula will use a new
150 Volume for each backup, because each Volume it writes can only be used for 23 hours
151 after the first write. Note, setting the use duration to 23 hours is not a very 
152 good solution for tapes unless you have someone on-site during the weekends,
153 because Bacula will want a new Volume and no one will be present to mount it,
154 so no weekend backups will be done until Monday morning.
155
156 \label{AutomaticLabeling}
157 \subsubsection*{Automatic Volume Labeling}
158 \index[general]{Automatic Volume Labeling }
159 \index[general]{Labeling!Automatic Volume }
160 \addcontentsline{toc}{subsubsection}{Automatic Volume Labeling}
161
162 Use of the above records brings up another problem -- that of labeling your
163 Volumes. For automated disk backup, you can either manually label each of your
164 Volumes, or you can have Bacula automatically label new Volumes when they are
165 needed. While, the automatic Volume labeling in version 1.30 and prior is a
166 bit simplistic, but it does allow for automation, the features added in
167 version 1.31 permit automatic creation of a wide variety of labels including
168 information from environment variables and special Bacula Counter variables. 
169 In version 1.37 and later, it is probably much better to use Python scripting 
170 and the NewVolume event since generating Volume labels in a Python script is
171 much easier than trying to figure out Counter variables. See the
172 \ilink{Python Scripting}{_ChapterStart60} chapter of this manual for more
173 details.
174
175 Please note that automatic Volume labeling can also be used with tapes, but
176 it is not nearly so practical since the tapes must be pre-mounted.  This
177 requires some user interaction.  Automatic labeling from templates does NOT
178 work with autochangers since Bacula will not access unknown slots.  There
179 are several methods of labeling all volumes in an autochanger magazine.
180 For more information on this, please see the \ilink{
181 Autochanger}{_ChapterStart18} chapter of this manual.
182
183 Automatic Volume labeling is enabled by making a change to both the Pool
184 resource (Director) and to the Device resource (Storage daemon) shown above.
185 In the case of the Pool resource, you must provide Bacula with a label format
186 that it will use to create new names. In the simplest form, the label format
187 is simply the Volume name, to which Bacula will append a four digit number.
188 This number starts at 0001 and is incremented for each Volume the pool
189 contains. Thus if you modify your Pool resource to be: 
190
191 \footnotesize
192 \begin{verbatim}
193 Pool {
194   Name = File
195   Pool Type = Backup
196   Volume Use Duration = 23h
197   LabelFormat = "Vol"
198 }
199 \end{verbatim}
200 \normalsize
201
202 Bacula will create Volume names Vol0001, Vol0002, and so on when new Volumes
203 are needed. Much more complex and elaborate labels can be created using
204 variable expansion defined in the 
205 \ilink{Variable Expansion}{_ChapterStart50} chapter of this manual. 
206
207 The second change that is necessary to make automatic labeling work is to give
208 the Storage daemon permission to automatically label Volumes. Do so by adding
209 {\bf LabelMedia = yes} to the Device resource as follows: 
210
211 \footnotesize
212 \begin{verbatim}
213 Device {
214   Name = File
215   Media Type = File
216   Archive Device = /home/bacula/backups
217   Random Access = Yes;
218   AutomaticMount = yes;
219   RemovableMedia = no;
220   AlwaysOpen = no;
221   LabelMedia = yes
222 }
223 \end{verbatim}
224 \normalsize
225
226 You can find more details of the {\bf Label Format} Pool record in 
227 \ilink{Label Format}{Label} description of the Pool resource
228 records. 
229
230 \label{Recycling1}
231 \subsubsection*{Restricting the Number of Volumes and Recycling}
232 \index[general]{Recycling!Restricting the Number of Volumes and }
233 \index[general]{Restricting the Number of Volumes and Recycling }
234 \addcontentsline{toc}{subsubsection}{Restricting the Number of Volumes and
235 Recycling}
236
237 Automatic labeling discussed above brings up the problem of Volume management.
238 With the above scheme, a new Volume will be created every day. If you have not
239 specified Retention periods, your Catalog will continue to fill keeping track
240 of all the files Bacula has backed up, and this procedure will create one new
241 archive file (Volume) every day. 
242
243 The tools Bacula gives you to help automatically manage these problems are the
244 following: 
245
246 \begin{enumerate}
247 \item Catalog file record retention periods, the  
248    \ilink{File Retention = ttt}{FileRetention}  record in the Client
249    resource.  
250 \item Catalog job record retention periods, the  
251    \ilink{Job Retention = ttt}{JobRetention}  record in the Client
252    resource.  
253 \item The 
254    \ilink{ AutoPrune = yes}{AutoPrune} record in the Client resource
255    to permit  application of the above two retention periods.  
256 \item The 
257    \ilink{ Volume Retention = ttt}{VolRetention} record in the Pool
258    resource.  
259 \item The 
260    \ilink{ AutoPrune = yes}{PoolAutoPrune} record in the Pool
261    resource to permit  application of the Volume retention period.  
262 \item The 
263    \ilink{ Recycle = yes}{PoolRecycle} record in the Pool resource
264    to permit  automatic recycling of Volumes whose Volume retention period has 
265    expired.  
266 \item The 
267    \ilink{ Recycle Oldest Volume = yes}{RecycleOldest} record in the
268    Pool resource tells Bacula  to Prune the oldest volume in the Pool, and if all
269    files  were pruned to recycle this volume and use it.  
270 \item The 
271    \ilink{ Recycle Current Volume = yes}{RecycleCurrent} record in
272    the Pool resource tells Bacula  to Prune the currently mounted volume in the
273    Pool, and if all files  were pruned to recycle this volume and use it.  
274 \item The 
275    \ilink{ Purge Oldest Volume = yes}{PurgeOldest} record in the
276    Pool resource  permits a forced recycling of the oldest Volume when a new one
277    is  needed.  {\bf N.B. This record ignores retention periods! We highly
278    recommend  not to use this record, but instead use Recycle Oldest Volume}  
279 \item The 
280    \ilink{ Maximum Volumes = nnn}{MaxVolumes} record in the Pool
281    resource to limit  the number of Volumes that can be created. 
282 \end{enumerate}
283
284 The first three records (File Retention, Job Retention, and AutoPrune)
285 determine the amount of time that Job and File records will remain in your
286 Catalog, and they are discussed in detail in the 
287 \ilink{Automatic Volume Recycling}{_ChapterStart22} chapter of
288 this manual. 
289
290 Volume Retention, AutoPrune, and Recycle determine how long Bacula will keep
291 your Volumes before reusing them, and they are also discussed in detail in the
292 \ilink{Automatic Volume Recycling}{_ChapterStart22} chapter of
293 this manual. 
294
295 The Maximum Volumes record can also be used in conjunction with the Volume
296 Retention period to limit the total number of archive Volumes (files) that
297 Bacula will create. By setting an appropriate Volume Retention period, a
298 Volume will be purged just before it is needed and thus Bacula can cycle
299 through a fixed set of Volumes. Cycling through a fixed set of Volumes can
300 also be done by setting {\bf Recycle Oldest Volume = yes} or {\bf Recycle
301 Current Volume = yes}. In this case, when Bacula needs a new Volume, it will
302 prune the specified volume. 
303
304 \label{ConcurrentDiskJobs}
305 \subsection*{Concurrent Disk Jobs}
306 \index[general]{Concurrent Disk Jobs}
307 \addcontentsline{toc}{subsection}{Concurrent Disk Jobs}
308 Above, we discussed how you could have a single device named {\bf
309 FileBackup} that writes to volumes in {\bf /home/bacula/backups}. 
310 You can, in fact, run multiple concurrent jobs using the 
311 Storage definition given with this example, and all the jobs will
312 simultaneously write into the Volume that is being written.
313
314 Now suppose you want to use multiple Pools, which means multiple
315 Volumes, or suppose you want each client to have its own Volume
316 and perhaps its own directory such as {\bf /home/bacula/client1}
317 and {\bf /home/bacula/client2} ... With the single Storage and Device
318 definition above, neither of these two is possible.  Why?  Because
319 Bacula disk storage follows the same rules as tape devices. Only
320 one Volume can be mounted on any Device at any time. If you want
321 to simultaneously write multiple Volumes, you will need multiple
322 Device resources in your bacula-sd.conf file, and thus multiple
323 Storage resources in your bacula-dir.conf.
324
325 OK, so now you should understand that you need multiple Device definitions
326 in the case of different directories or different Pools, but you also 
327 need to know that the catalog data that Bacula keeps contains only
328 the Media Type and not the specific storage device.  This permits a tape 
329 for example to be re-read on any compatible tape drive.  The compatibility
330 being determined by the Media Type.  The same applies to disk storage.
331 Since a volume that is written by a Device in say directory {\bf
332 /home/bacula/backups}  cannot be read by a Device with an Archive Device
333 definition of {\bf /home/bacula/client1}, you will not be able to
334 restore all your files if you give both those devices 
335 {\bf Media Type = File}. During the restore, Bacula will simply choose 
336 the first available device, which may not be the correct one.  If this
337 is confusing, just remember that the Directory has only the Media Type
338 and the Volume name.  It does not know the {\bf Archive Device} (or the
339 full path) that is specified in the Storage daemon.  Thus you must
340 explicitly tie your Volumes to the correct Device by using the Media Type.
341
342 The example shown below shows a case where there are two clients, each
343 using its own Pool and storing their Volumes in different directories.
344  
345
346 \label{Example2}
347 \subsection*{An Example}
348 \index[general]{Example }
349 \addcontentsline{toc}{subsection}{Example}
350
351 The following example is not very practical, but can be used to demonstrate
352 the proof of concept in a relatively short period of time. The example
353 consists of a two clients that are backed up to a set of 12 archive files
354 (Volumes) for each client into different directories on the Storage
355 machine.  Each Volume is used (written) only once, and there are four Full
356 saves done every hour (so the whole thing cycles around after three hours).
357
358 What is key here is that each physical device on the Storage daemon 
359 has a different Media Type. This allows the Director to choose the
360 correct device for restores ...
361
362 The Director's configuration file is as follows: 
363
364 \footnotesize
365 \begin{verbatim}
366 Director {
367   Name = my-dir
368   QueryFile = "~/bacula/bin/query.sql"
369   PidDirectory = "~/bacula/working"
370   WorkingDirectory = "~/bacula/working"
371   Password = dir_password
372 }
373 Schedule {
374   Name = "FourPerHour"
375   Run = Level=Full hourly at 0:05
376   Run = Level=Full hourly at 0:20
377   Run = Level=Full hourly at 0:35
378   Run = Level=Full hourly at 0:50
379 }
380 Job {
381   Name = "RecycleExample"
382   Type = Backup
383   Level = Full
384   Client = Rufus
385   FileSet= "Example FileSet"
386   Messages = Standard
387   Storage = FileStorage
388   Pool = Recycle
389   Schedule = FourPerHour
390 }
391
392 Job {
393   Name = "RecycleExample2"
394   Type = Backup
395   Level = Full
396   Client = Roxie
397   FileSet= "Example FileSet"
398   Messages = Standard
399   Storage = FileStorage1
400   Pool = Recycle1
401   Schedule = FourPerHour
402 }
403
404 FileSet {
405   Name = "Example FileSet"
406   Include = compression=GZIP signature=SHA1 {
407     /home/kern/bacula/bin
408   }
409 }
410 Client {
411   Name = Rufus
412   Address = rufus
413   Catalog = BackupDB
414   Password = client_password
415 }
416
417 Client {
418   Name = Roxie
419   Address = roxie
420   Catalog = BackupDB
421   Password = client1_password
422 }
423
424 Storage {
425   Name = FileStorage
426   Address = rufus
427   Password = local_storage_password
428   Device = RecycleDir
429   Media Type = File
430 }
431
432 Storage {
433   Name = FileStorage1
434   Address = rufus
435   Password = local_storage_password
436   Device = RecycleDir1
437   Media Type = File1
438 }
439
440 Catalog {
441   Name = BackupDB
442   dbname = bacula; user = bacula; password = ""
443 }
444 Messages {
445   Name = Standard
446   ...
447 }
448 Pool {
449   Name = Recycle
450   Use Volume Once = yes
451   Pool Type = Backup
452   LabelFormat = "Recycle-"
453   AutoPrune = yes
454   VolumeRetention = 2h
455   Maximum Volumes = 12
456   Recycle = yes
457 }
458
459 Pool {
460   Name = Recycle1
461   Use Volume Once = yes
462   Pool Type = Backup
463   LabelFormat = "Recycle1-"
464   AutoPrune = yes
465   VolumeRetention = 2h
466   Maximum Volumes = 12
467   Recycle = yes
468 }
469
470 \end{verbatim}
471 \normalsize
472
473 and the Storage daemon's configuration file is: 
474
475 \footnotesize
476 \begin{verbatim}
477 Storage {
478   Name = my-sd
479   WorkingDirectory = "~/bacula/working"
480   Pid Directory = "~/bacula/working"
481   MaximumConcurrentJobs = 10
482 }
483 Director {
484   Name = my-dir
485   Password = local_storage_password
486 }
487 Device {
488   Name = RecycleDir
489   Media Type = File
490   Archive Device = /home/bacula/backups
491   LabelMedia = yes;
492   Random Access = Yes;
493   AutomaticMount = yes;
494   RemovableMedia = no;
495   AlwaysOpen = no;
496 }
497
498 Device {
499   Name = RecycleDir1
500   Media Type = File1
501   Archive Device = /home/bacula/backups1
502   LabelMedia = yes;
503   Random Access = Yes;
504   AutomaticMount = yes;
505   RemovableMedia = no;
506   AlwaysOpen = no;
507 }
508
509 Messages {
510   Name = Standard
511   director = my-dir = all
512 }
513 \end{verbatim}
514 \normalsize
515
516 With a little bit of work, you can change the above example into a weekly or
517 monthly cycle (take care about the amount of archive disk space used). 
518
519 \label{MultipleDisks}
520 \subsection*{Backing up to Multiple Disks}
521 \index[general]{Disks!Backing up to Multiple }
522 \index[general]{Backing up to Multiple Disks }
523 \addcontentsline{toc}{subsection}{Backing up to Multiple Disks}
524
525 Bacula can, of course, use multiple disks, but in general, each disk must be a
526 separate Device specification in the Storage daemon's conf file, and you must
527 then select what clients to backup to each disk. You will also want to
528 give each Device specification a different Media Type so that during
529 a restore, Bacula will be able to find the appropriate drive.
530
531 The situation is a bit more complicated if you want to treat two different
532 physical disk drives (or partitions) logically as a single drive, which
533 Bacula does not directly support.  However, it is possible to back up your
534 data to multiple disks as if they were a single drive by linking the
535 Volumes from the first disk to the second disk.
536
537 For example, assume that you have two disks named {\bf /disk1} and {\bf
538 /disk2}. If you then create a standard Storage daemon Device resource for
539 backing up to the first disk, it will look like the following: 
540
541 \footnotesize
542 \begin{verbatim}
543 Device {
544   Name = client1
545   Media Type = File
546   Archive Device = /disk1
547   LabelMedia = yes;
548   Random Access = Yes;
549   AutomaticMount = yes;
550   RemovableMedia = no;
551   AlwaysOpen = no;
552 }
553 \end{verbatim}
554 \normalsize
555
556 Since there is no way to get the above Device resource to reference both {\bf
557 /disk1} and {\bf /disk2} we do it by pre-creating Volumes on /disk2 with the
558 following: 
559
560 \footnotesize
561 \begin{verbatim}
562 ln -s /disk2/Disk2-vol001 /disk1/Disk2-vol001
563 ln -s /disk2/Disk2-vol002 /disk1/Disk2-vol002
564 ln -s /disk2/Disk2-vol003 /disk1/Disk2-vol003
565 ...
566 \end{verbatim}
567 \normalsize
568
569 At this point, you can label the Volumes as Volume {\bf Disk2-vol001}, {\bf
570 Disk2-vol002}, ... and Bacula will use them as if they were on /disk1 but
571 actually write the data to /disk2. The only minor inconvenience with this
572 method is that you must explicitly name the disks and cannot use automatic
573 labeling unless you arrange to have the labels exactly match the links you
574 have created. 
575
576 An important thing to know is that Bacula treats disks like tape drives
577 as much as it can. This means that you can only have a single Volume
578 mounted at one time on a disk as defined in your Device resource in
579 the Storage daemon's conf file.  You can have multiple concurrent 
580 jobs running that all write to the one Volume that is being used, but
581 if you want to have multiple concurrent jobs that are writing to
582 separate disks drives (or partitions), you will need to define 
583 separate Device resources for each one, exactly as you would do for
584 two different tape drives.  There is one fundamental difference, however.
585 The Volumes that you create on the two drives cannot be easily exchanged
586 as they can for a tape drive, because they are physically resident (already
587 mounted in a sense) on the particular drive.  As a consequence, you will
588 probably want to give them different Media Types so that Bacula can
589 distinguish what Device resource to use during a restore.
590 An example would be the following:
591
592 \footnotesize
593 \begin{verbatim}
594 Device {
595   Name = Disk1
596   Media Type = File1
597   Archive Device = /disk1
598   LabelMedia = yes;
599   Random Access = Yes;
600   AutomaticMount = yes;
601   RemovableMedia = no;
602   AlwaysOpen = no;
603 }
604
605 Device {
606   Name = Disk2
607   Media Type = File2
608   Archive Device = /disk2
609   LabelMedia = yes;
610   Random Access = Yes;
611   AutomaticMount = yes;
612   RemovableMedia = no;
613   AlwaysOpen = no;
614 }
615 \end{verbatim}
616 \normalsize
617
618 With the above device definitions, you can run two concurrent
619 jobs each writing at the same time, one to {\bf /disk2} and the
620 other to {\bf /disk2}.  The fact that you have given them different
621 Media Types will allow Bacula to quickly choose the correct
622 Storage resource in the Director when doing a restore.
623
624 \label{MultipleClients}
625 \subsection*{Considerations for Multiple Clients}
626 \index[general]{Clients!Considerations for Multiple }
627 \index[general]{Multiple Clients}
628 \addcontentsline{toc}{subsection}{Considerations for Multiple Clients}
629
630 If we take the above example and add a second Client, here are a few
631 considerations: 
632
633 \begin{itemize}
634 \item Although the second client can write to the same set of  Volumes, you
635    will probably want to write to a different  set. 
636 \item You can write to a different set of Volumes by defining  a second Pool,
637    which has a different name and a different  {\bf LabelFormat}.  
638 \item If you wish the Volumes for the second client to go into  a different
639    directory (perhaps even on a different filesystem  to spread the load), you
640    would do so by defining a second  Device resource in the Storage daemon. The
641 {\bf Name}  must be different, and the {\bf Archive Device} could  be
642 different. To ensure that Volumes are never mixed from  one pool to another,
643 you might also define a different  MediaType (e.g. {\bf File1}). 
644 \end{itemize}
645
646 In this example, we have two clients, each with a different Pool and a
647 different number of archive files retained. They also write to different
648 directories with different Volume labeling. 
649
650 The Director's configuration file is as follows: 
651
652 \footnotesize
653 \begin{verbatim}
654 Director {
655   Name = my-dir
656   QueryFile = "~/bacula/bin/query.sql"
657   PidDirectory = "~/bacula/working"
658   WorkingDirectory = "~/bacula/working"
659   Password = dir_password
660 }
661 # Basic weekly schedule
662 Schedule {
663   Name = "WeeklySchedule"
664   Run = Level=Full fri at 1:30
665   Run = Level=Incremental sat-thu at 1:30
666 }
667 FileSet {
668   Name = "Example FileSet"
669   Include = compression=GZIP signature=SHA1 {
670     /home/kern/bacula/bin
671   }
672 }
673 Job {
674   Name = "Backup-client1"
675   Type = Backup
676   Level = Full
677   Client = client1
678   FileSet= "Example FileSet"
679   Messages = Standard
680   Storage = File1
681   Pool = client1
682   Schedule = "WeeklySchedule"
683 }
684 Job {
685   Name = "Backup-client2"
686   Type = Backup
687   Level = Full
688   Client = client2
689   FileSet= "Example FileSet"
690   Messages = Standard
691   Storage = File2
692   Pool = client2
693   Schedule = "WeeklySchedule"
694 }
695 Client {
696   Name = client1
697   Address = client1
698   Catalog = BackupDB
699   Password = client1_password
700   File Retention = 7d
701 }
702 Client {
703   Name = client2
704   Address = client2
705   Catalog = BackupDB
706   Password = client2_password
707 }
708 # Two Storage definitions with different Media Types
709 #  permits different directories
710 Storage {
711   Name = File1
712   Address = rufus
713   Password = local_storage_password
714   Device = client1
715   Media Type = File1
716 }
717 Storage {
718   Name = File2
719   Address = rufus
720   Password = local_storage_password
721   Device = client2
722   Media Type = File2
723 }
724 Catalog {
725   Name = BackupDB
726   dbname = bacula; user = bacula; password = ""
727 }
728 Messages {
729   Name = Standard
730   ...
731 }
732 # Two pools permits different cycling periods and Volume names
733 # Cycle through 15 Volumes (two weeks)
734 Pool {
735   Name = client1
736   Use Volume Once = yes
737   Pool Type = Backup
738   LabelFormat = "Client1-"
739   AutoPrune = yes
740   VolumeRetention = 13d
741   Maximum Volumes = 15
742   Recycle = yes
743 }
744 # Cycle through 8 Volumes (1 week)
745 Pool {
746   Name = client2
747   Use Volume Once = yes
748   Pool Type = Backup
749   LabelFormat = "Client2-"
750   AutoPrune = yes
751   VolumeRetention = 6d
752   Maximum Volumes = 8
753   Recycle = yes
754 }
755 \end{verbatim}
756 \normalsize
757
758 and the Storage daemon's configuration file is: 
759
760 \footnotesize
761 \begin{verbatim}
762 Storage {
763   Name = my-sd
764   WorkingDirectory = "~/bacula/working"
765   Pid Directory = "~/bacula/working"
766   MaximumConcurrentJobs = 10
767 }
768 Director {
769   Name = my-dir
770   Password = local_storage_password
771 }
772 # Archive directory for Client1
773 Device {
774   Name = client1
775   Media Type = File1
776   Archive Device = /home/bacula/client1
777   LabelMedia = yes;
778   Random Access = Yes;
779   AutomaticMount = yes;
780   RemovableMedia = no;
781   AlwaysOpen = no;
782 }
783 # Archive directory for Client2
784 Device {
785   Name = client2
786   Media Type = File2
787   Archive Device = /home/bacula/client2
788   LabelMedia = yes;
789   Random Access = Yes;
790   AutomaticMount = yes;
791   RemovableMedia = no;
792   AlwaysOpen = no;
793 }
794 Messages {
795   Name = Standard
796   director = my-dir = all
797 }
798 \end{verbatim}
799 \normalsize