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