]> git.sur5r.net Git - bacula/bacula/blob - bacula/examples/backup-to-cdwriter.txt
Tweak ChangeLog and ReleaseNotes for last backport from Enterprise
[bacula/bacula] / bacula / examples / backup-to-cdwriter.txt
1 From: "Johan Decock" <jdecock@abis.be>
2 To: bacula-users@lists.sourceforge.net
3 Subject: Re: [Bacula-users] cdwriter
4 Date: Fri, 30 Jan 2004 17:11:34 +0100
5
6 I thought it would be easy to find them in the archives.  I'll post them
7 again.  I changed some things in them anyway in the mean time.  I also
8 include the Director config.  Then you see how they are to be used in
9 Runbefore- and RunafterJobs
10
11 I'm interested in any remarks or improvements you might have.  (I'm
12 still getting started in shell scripting)
13
14
15 #
16 # Default Bacula Director Configuration file
17 #
18 #  The only thing that MUST be changed is to add one or more
19 #   file or directory names in the Include directive of the
20 #   FileSet resource.
21 #
22 #  For Bacula release 1.32b (14 Oct 2003) -- mandrake (FiveStar)
23 #
24 #  You might also want to change the default email address
25 #   from root to your address.  See the "mail" and "operator"
26 #   directives in the Messages resource.
27 #
28
29 Director {                  # define myself
30   Name = tosfeb33-dir
31   DIRport = 9101            # where we listen for UA connections
32   QueryFile = "/etc/bacula/query.sql"
33   WorkingDirectory = "/var/bacula/working"
34   PidDirectory = "/var/run"
35   Maximum Concurrent Jobs = 1
36   Password = "abis"         # Console password
37   Messages = Standard
38 }
39
40 Job {
41   Name = "Tosfeb31AllHDD"
42   Type = Backup
43   Level = Full
44   Client = tosfeb31-fd
45   FileSet = "Tosfeb31All"
46   Schedule = "Weekdays"
47   Messages = Standard
48   Pool = HDD
49   Storage = HDdrive
50   RunBeforeJob = "/etc/bacula/prepare_DVDspool /mnt/backupdaily 1700000"
51   Write Bootstrap = "/var/bacula/working/Tosfeb31All.bsr"
52   Priority = 10
53 }
54
55 Job {
56   Name = "Tosfeb31AllUSB"
57   Type = Backup
58   Level = Full
59   Client = tosfeb31-fd
60   FileSet = "Tosfeb31All"
61   Schedule = "WeeklyUSB"
62   Messages = Standard
63   Pool = USB
64   Storage = USBdrive
65   Write Bootstrap = "/var/bacula/working/Tosfeb31All.bsr"
66   Priority = 10
67 }
68
69 Job {
70   Name = "Tosfeb31EssentialDVD"
71   Type = Backup
72   Level = Full
73   Client = tosfeb31-fd
74   FileSet = "Tosfeb31Essential"
75   Schedule = "MonthlyDVD"
76   Messages = Standard
77   Pool = DVD
78   Storage = DVDdrive
79   RunBeforeJob = "/etc/bacula/prepare_DVDspool /mnt/backupdaily 4700000"
80   Write Bootstrap = "/var/bacula/working/Tosfeb31Essential.bsr"
81   RunAfterJob = "/etc/bacula/inventorize_volumes %v"
82   Priority = 10
83 }
84
85 Job {
86   Name = "Tosfeb31AllCompressedDVD"
87   Type = Backup
88   Level = Full
89   Client = tosfeb31-fd
90   FileSet = "Tosfeb31AllCompressed"
91   Messages = Standard
92   Pool = DVD
93   Storage = DVDdrive
94   RunBeforeJob = "/etc/bacula/prepare_DVDspool /mnt/backupdaily 4700000"
95   Write Bootstrap = "/var/bacula/working/Tosfeb31Essential.bsr"
96   RunAfterJob = "/etc/bacula/inventorize_volumes %v"
97   Priority = 10
98 }
99
100 Job {
101   Name = "Tosfeb32AllHDD"
102   Type = Backup
103   Level = Full
104   Client = tosfeb32-fd
105   FileSet = "Tosfeb32All"
106   Schedule = "Weekdays"
107   Messages = Standard
108   Pool = HDD
109   Storage = HDdrive
110   Write Bootstrap = "/var/bacula/working/Tosfeb32All.bsr"
111   Priority = 20
112 }
113
114 Job {
115   Name = "Tosfeb32AllUSB"
116   Type = Backup
117   Level = Full
118   Client = tosfeb32-fd
119   FileSet = "Tosfeb32All"
120   Schedule = "WeeklyUSB"
121   Messages = Standard
122   Pool = USB
123   Storage = USBdrive
124   Write Bootstrap = "/var/bacula/working/Tosfeb32All.bsr"
125   Priority = 10
126 }
127
128 Job {
129   Name = "Tosfeb32EssentialDVD"
130   Type = Backup
131   Level = Full
132   Client = tosfeb32-fd
133   FileSet = "Tosfeb32Essential"
134   Schedule = "MonthlyDVD"
135   Messages = Standard
136   Pool = DVD
137   Storage = DVDdrive
138   Write Bootstrap = "/var/bacula/working/Tosfeb32System.bsr"
139   RunAfterJob = "/etc/bacula/inventorize_volumes %v"
140   Priority = 20
141 }
142
143 #Job {
144 #  Name = "Tosfeb30System"
145 #  Type = Backup
146 #  Level = Full
147 #  Client = tosfeb30-fd
148 #  FileSet = "Tosfeb30System"
149 #  Schedule = "WeeklyUSB"
150 #  Messages = Standard
151 #  Pool = USB
152 #  Storage = USBdrive
153 #  Write Bootstrap = "/etc/bacula/working/Tosfeb32System.bsr"
154 #  Priority = 20
155 #}
156
157 Job {
158   Name = "Tosfeb33SystemHDD"
159   Type = Backup
160   Level = Full
161   Client = tosfeb33-fd
162   FileSet = "Tosfeb33System"
163   Schedule = "Weekdays"
164   Messages = Standard
165   Pool = HDD
166   Storage = HDdrive
167   Write Bootstrap = "/var/bacula/working/Tosfeb33System.bsr"
168   Priority = 30
169 }
170
171 Job {
172   Name = "Tosfeb33SystemUSB"
173   Type = Backup
174   Level = Full
175   Client = tosfeb33-fd
176   FileSet = "Tosfeb33System"
177   Schedule = "WeeklyUSB"
178   Messages = Standard
179   Pool = USB
180   Storage = USBdrive
181   Write Bootstrap = "/var/bacula/working/Tosfeb33All.bsr"
182   Priority = 30
183 }
184
185 Job {
186   Name = "Tosfeb33EssentialDVD"
187   Type = Backup
188   Level = Full
189   Client = tosfeb33-fd
190   FileSet = "Tosfeb33Essential"
191   Schedule = "MonthlyDVD"
192   Messages = Standard
193   Pool = DVD
194   Storage = DVDdrive
195   Write Bootstrap = "/var/bacula/working/Tosfeb33Essential.bsr"
196   RunAfterJob = "/etc/bacula/inventorize_volumes %v"
197   Priority = 30
198 }
199
200 Job {
201   Name = "BackupCatalogHDD"
202   Type = Backup
203   Level = Full
204   Client = tosfeb33-fd
205   FileSet="Catalog"
206   Schedule = "Weekdays"
207   Storage = HDdrive
208   Messages = Standard
209   Pool = HDD
210   # This creates an ASCII copy of the catalog
211   RunBeforeJob = "/etc/bacula/make_catalog_backup -u bacula"
212   # This deletes the copy of the catalog
213   RunAfterJob  = "/etc/bacula/delete_catalog_backup"
214   Write Bootstrap = "/var/bacula/working/BackupCatalog.bsr"
215   Priority = 90                   # run after main backup
216 }
217
218 Job {
219   Name = "BackupCatalogUSB"
220   Type = Backup
221   Level = Full
222   Client = tosfeb33-fd
223   FileSet="Catalog"
224   Schedule = "WeeklyUSB"
225   Storage = USBdrive
226   Messages = Standard
227   Pool = USB
228   # This creates an ASCII copy of the catalog
229   RunBeforeJob = "/etc/bacula/make_catalog_backup -u bacula"
230   # This writes the volume file to the proper USB device
231   RunAfterJob  = "/etc/bacula/write_to_USB %v"
232 #  RunAfterJob  = "/etc/bacula/delete_catalog_backup"
233   Write Bootstrap = "/var/bacula/working/BackupCatalog.bsr"
234   Priority = 90                   # run after main backup
235 }
236
237 Job {
238   Name = "BackupCatalogDVD"
239   Type = Backup
240   Level = Full
241   Client = tosfeb33-fd
242   FileSet="Catalog"
243   Schedule = "MonthlyDVD"
244   Storage = DVDdrive
245   Messages = Standard
246   Pool = DVD
247   # This creates an ASCII copy of the catalog
248   RunBeforeJob = "/etc/bacula/make_catalog_backup -u bacula"
249   # This writes the volume file to a DVD
250   RunAfterJob = "/etc/bacula/write_to_DVD %v"
251   Write Bootstrap = "/var/bacula/working/BackupCatalog.bsr"
252   Priority = 90                   # run after main backup
253 }
254
255 # Standard Restore template, to be changed by Console program
256 Job {
257   Name = "RestoreFiles"
258   Type = Restore
259   Client = tosfeb33-fd
260   FileSet="Full Set"
261   Storage = HDdrive
262   Messages = Standard
263   Pool = HDD
264   Where = /tmp/bacula-restores
265 }
266
267 # List of files to be backed up
268 FileSet {
269   Name = "Full Set"
270   Include = signature=MD5 portable=yes {
271 #
272 #  Put your list of files here, one per line or include an
273 #    external list with:
274 #
275 #    <file-name
276 #
277 #  Note: / backs up everything on the root partition.
278 #    if you have other partitons such as /usr or /home
279 #    you will probably want to add them too.
280 #
281 #  By default this is defined to point to the Bacula build
282 #    directory to give a reasonable FileSet to backup to
283 #    disk storage during initial testing.
284 #
285     /tmp/bacula-1.32b
286   }
287
288 #
289 # If you backup the root directory, the following two excluded
290 #   files can be useful
291 #
292   Exclude = { /proc /tmp /.journal /.fsck }
293 }
294
295 #
296 # When to do the backups, full backup on first sunday of the month,
297 FileSet {
298   Name = "Tosfeb31All"
299   Include = signature=MD5 portable=yes {
300 # System of Tosfeb31
301     "C:/"
302 # Data1
303     "E:/"
304 # Program
305     "F:/"
306 # Finance
307     "G:/"
308 # Home
309     "H:/"
310   }
311   Exclude = {pagefile.sys, *.[Dd][Mm][Pp]}
312 }
313 FileSet {
314   Name = "Tosfeb31AllCompressed"
315   Include = signature=MD5 compression=GZIP portable=yes {
316 # System of Tosfeb31
317     "C:/"
318 # Data1
319     "E:/"
320 # Program
321     "F:/"
322 # Finance
323     "G:/"
324 # Home
325     "H:/"
326   }
327   Exclude = {pagefile.sys, *.[Dd][Mm][Pp]}
328 }
329 FileSet {
330   Name = "Tosfeb31Essential"
331   Include = signature=MD5  compression=GZIP portable=yes {
332 # Data1
333     "E:/"
334 # Finance
335     "G:/"
336   }
337   Exclude = {*.[Tt][Mm][Pp], *.backup.fm, *.backup.book}
338 }
339 FileSet {
340   Name = "Tosfeb32All"
341   Include = signature=MD5 portable=yes {
342 # System of Tosfeb32
343     "C:/"
344 # NotesData
345     "E:/"
346 # Lib
347     "H:/"
348   }
349   Exclude = {pagefile.sys, *.[Dd][Mm][Pp]}
350 }
351 FileSet {
352   Name = "Tosfeb32Essential"
353   Include = signature=MD5  compression=GZIP portable=yes {
354 # NotesData
355     "E:/"
356   }
357   Exclude = {*.[Tt][Mm][Pp]}
358 }
359
360 FileSet {
361   Name = "Tosfeb33System"
362   Include = signature=MD5 portable=yes {
363     "/bin"
364     "/boot"
365     "/etc"
366     "/home"
367     "/lib"
368     "/root"
369     "/sbin"
370     "/usr"
371   }
372   Exclude = {/var, /proc}
373 }
374
375 FileSet {
376   Name = "Tosfeb33Essential"
377   Include = signature=MD5 compression=GZIP portable=yes {
378     "/etc"
379     "/root"
380   }
381 }
382
383 Schedule {
384   Name = "Weekdays"
385   Run = Full tue-fri at 01:00
386 }
387
388 Schedule {
389   Name = "WeeklyUSB"
390   Run = Full sat at 01:00
391 }
392
393 Schedule {
394   Name = "MonthlyDVD"
395   Run = Full 1st sat at 04:00 # These will remain on site
396   Run = Full 3rd sat at 04:00 # These will be carried off site
397 }
398
399 # This is the backup of the catalog
400 FileSet {
401   Name = "Catalog"
402   Include = signature=MD5 {
403      /var/bacula/working/bacula.sql
404   }
405 }
406
407 # Client (File Services) to backup
408 Client {
409   Name = tosfeb33-fd
410   Address = tosfeb33.abis.be
411   FDPort = 9102
412   Catalog = MyCatalog
413   Password = "abis"          # password for FileDaemon
414   File Retention = 30 days            # 30 days
415   Job Retention = 6 months            # six months
416   AutoPrune = yes                     # Prune expired Jobs/Files
417 }
418
419 Client {
420   Name = tosfeb30-fd
421   Address = tosfeb30.abis.be
422   FDPort = 9102
423   Catalog = MyCatalog
424   Password = "abis"
425   File Retention = 30 days
426   Job Retention = 6 months
427   AutoPrune = yes
428 }
429
430 Client {
431   Name = tosfeb31-fd
432   Address = tosfeb31.abis.be
433   FDPort = 9102
434   Catalog = MyCatalog
435   Password = "abis"
436   File Retention = 30 days
437   Job Retention = 6 months
438   AutoPrune = yes
439 }
440
441 Client {
442   Name = tosfeb32-fd
443   Address = tosfeb32.abis.be
444   FDPort = 9102
445   Catalog = MyCatalog
446   Password = "abis"
447   File Retention = 30 days
448   Job Retention = 6 months
449   AutoPrune = yes
450 }
451
452 # Definiton of file storage device
453
454 Storage {
455   Name = HDdrive
456   Address = tosfeb33.abis.be
457   SDPort = 9103
458   Password = "abis"
459   Device = HDdriveStorage
460   Media Type = File
461 }
462
463 Storage {
464   Name = USBdrive
465   Address = tosfeb33.abis.be
466   SDPort = 9103
467   Password = "abis"
468   Device = USBdriveStorage
469   Media Type = File
470 }
471
472 Storage {
473   Name = DVDdrive
474   Address = tosfeb33.abis.be
475   SDPort = 9103
476   Password = "abis"
477   Device = DVDdriveStorage
478   Media Type = File
479 }
480
481 # Generic catalog service
482 Catalog {
483   Name = MyCatalog
484   dbname = bacula; user = bacula; password = ""
485 }
486
487 # Reasonable message delivery -- send most everything to email address
488 #  and to the console
489 Messages {
490   Name = Standard
491   mailcommand = "/usr/sbin/smtp -h tosfeb32.abis.be -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
492   operatorcommand = "/usr/sbin/smtp -h tosfeb32.abis.be -f \"\(Bacula\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
493   mail = jdecock@abis.be = all, !skipped
494   operator = jdecock@abis.be = mount
495   console = all, !skipped, !saved
496 #
497 # WARNING! the following will create a file that you must cycle from
498 #          time to time as it will grow indefinitely. However, it will
499 #          also keep all your messages if they scroll off the console.
500 #
501   append = "/etc/bacula/working/log" = all, !skipped
502 }
503
504 # Pool definition for daily backup on hard disk in backup server
505 Pool {
506   Name = HDD
507   Pool Type = Backup
508   Recycle = yes
509 #  Recycle Oldest Volume = yes
510   Purge Oldest Volume = yes
511   Autoprune = yes
512   Maximum Volumes = 4 # Monday through Thursday
513   Volume Retention = 2 weeks
514   Accept Any Volume = yes
515   Maximum Volume Jobs = 4 # 31, 32, 33 and Catalog
516 #  Maximum Volume Files = 2
517   Maximum Volume Bytes = 18g
518   Volume Use Duration = 1d
519   Label Format = "HDDVolume"
520 }
521
522 # Pool definition for weekly backup, first on hard disk,
523 #then to be copied on removable USB2 hard disk drives in an AfterRunJob
524 Pool {
525   Name = USB
526   Pool Type = Backup
527   Recycle = yes
528   Purge Oldest Volume = yes
529   Autoprune = yes
530   Maximum Volumes = 3 # We have 3 removable USB2 disks
531   Volume Retention = 2 months
532   Accept Any Volume = yes
533   Maximum Volume Jobs = 4 # 31, 32, 33 and Catalog
534   Maximum Volume Bytes = 18g
535   Volume Use Duration = 1d
536   Label Format = "USBVolume"
537 }
538
539 # Pool definition for monthly backups on DVDspool, to be copied to DVD+/-R media in an AfterRunJob
540 Pool {
541   Name = DVD
542   Pool Type = Backup
543   Recycle = no
544   Autoprune = no
545   Volume Retention = 2 years
546   Accept Any Volume = yes
547   Maximum Volume Bytes = 2147483500 # 2 GB is the maximum size of a file on an ISO9660 file system
548   Maximum Volume Jobs = 1 # each backup job gets its own set of volumes
549 #  Maximum Volume Bytes = 4699990000 # 4 700 000 000 # 4.38 GB is the actual size that will fit on a DVD
550   Volume Use Duration = 1d
551   Label Format = "DVD${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}-${NumVols}"
552 }
553
554
555
556 prepare_DVDspool:
557
558
559
560 #!/bin/bash
561 #
562 # shell script to initialize environment for creating a backup that will be written to DVD+/-R(W)
563
564 # it will need to check whether there is enough space on the path supplied as the first parameter
565 # and if there isn't it will need to remove some files.
566
567 # it will also remove the file where all the volume names are collected during the backup run.
568
569 path=$1 # /mnt/backupdaily
570 quota=$2 # 4700000
571
572 #Define global variable to hold return value from function
573
574 freespace=
575
576 # Define function to determine free space on a mount point
577
578 FreeSpace () {
579      freespace=`df | grep $path | awk '{print $4}'`
580      if [ 0 -ne `expr index "$freespace" %` ] ; then
581           freespace=`df | grep $path | awk '{print $3}'`
582      fi
583      }
584 #Define global variable to hold return value from function
585
586 padded=
587
588 # Define function to pad a number with spaces to the left for display
589
590 PadSpacesToLeft () {
591      stringtopad=$1
592      wantedlength=$2
593
594      while [ ${#stringtopad} -lt $wantedlength ]
595      do
596           stringtopad=" "$stringtopad
597      done
598      padded=$stringtopad
599      }
600
601 PadSpacesToLeft $quota 9
602
603 echo "How much free space is needed on $path? $padded"
604
605 # How much space is there left?
606
607 FreeSpace
608
609 PadSpacesToLeft $freespace 9
610
611 echo "Free space currently available on $path:$padded"
612
613 # As long as there isn't enough room, delete the oldest DVD volume files
614 while [ $freespace -lt $quota ]
615 do
616      # determine which is the oldest DVD volume file in /mnt/backupdaily
617      # ls puts the oldest file on top
618      # head grabs the first line
619      # and awk gets the 9th column of this line, i.e. the file name we were looking for
620      oldestfile=`ls -ralt $path/DVD* | head -n 1 | awk '{print $9}'`
621
622      echo "Deleting: $oldestfile"
623      rm  -f $oldestfile
624
625      # assess how much space there is now
626      FreeSpace
627      PadSpacesToLeft $freespace 9
628      echo "Free space currently available on $path:$padded"
629      # and then we test again.
630 done
631
632 # remove the file where all the volume names will be  collected.
633 # so we can have a clean run
634
635 rm -f /var/bacula/volumes
636
637 exit 0
638
639
640 inventorize_volumes:
641
642 #!/bin/bash
643 #
644 # shell script to inventorize volumes used during a backup
645 volumes=$1
646
647 # Replace | character with spaces (necessary for the for command)
648
649 volumes=${volumes//|/ }
650
651 # For every volume do
652
653 for i in $volumes ; do
654      echo $i >> /var/bacula/volumes
655 done
656
657 exit 0
658
659
660
661 write_to_DVD:
662
663 #!/bin/bash
664 #
665 # shell script to copy DVD volume files from /mnt/backupdaily to DVD+/-R(W)
666
667 # The last volume was not added to the inventory list yet, so we do that first
668 /etc/bacula/inventorize_volumes $1
669
670 supermount -m=/mnt/cdrom disable
671
672 umount /mnt/cdrom
673
674 # another shell script run as a RunAfterJob has been putting the volume names into a text file
675 # now we retrieve those names and write them to DVD
676
677 # this awk command produces a space delimited list of the lines of the text file and assigns it to $lines
678
679 lines=`awk '{print $1}' /var/bacula/volumes`
680
681 # now we can iterate over those volume names
682
683 let "count=1"
684 for i in $lines ; do
685      if [ $count -le 1 ] ; then
686           # When creating a DVD with growisofs one needs to use -Z the first time
687           echo "Writing first volume file" $count
688           growisofs -Z /dev/scd0 -R -J /mnt/backupdaily/$i
689      else
690           # and -M the for the next volume files
691           echo "Writing another volume file" $count
692           growisofs -M /dev/scd0 -R -J /mnt/backupdaily/$i
693      fi
694      let count="$count+1"
695 #    sleep 5
696      ls -al /mnt/cdrom
697 #    sleep 5
698 done
699
700 ls -al /mnt/backupdaily
701 mount /mnt/cdrom
702 ls -al /mnt/cdrom
703 umount /mnt/cdrom
704
705 #supermount -m=/mnt/cdrom enable
706
707 # This is run as a RunAfterJob of the catalog backup. It already had a RunAfterJob, so we execute that here
708 /etc/bacula/delete_catalog_backup
709
710 exit 0
711
712
713
714
715 This last one is to write to removable USB-storage.
716
717 write_to_USB
718
719 #!/bin/bash
720 #
721 # shell script to finalize USB backup
722
723 volumename=$1
724 echo "   Creating mount points, if they don't exist"
725 if ! [ -d /mnt/usbdrv ] ; then
726   mkdir /mnt/usbdrv
727 fi
728 if ! [ -d /mnt/usbdrv/bacula ] ; then
729   mkdir /mnt/usbdrv/bacula
730 fi
731 if ! [ -d /mnt/usbdrv/misc ] ; then
732   mkdir /mnt/usbdrv/misc
733 fi
734  #unmount all mount points related to USB
735
736 echo "   Making sure no USB devices are mounted"
737 umount /mnt/usbdrv
738 umount /mnt/usbdrv/bacula
739 umount /mnt/usbdrv/misc
740 umount /mnt/removable
741 umount /mnt/removable2
742 umount /mnt/removable3
743
744  #determine which /dev/sd? contains the right USBVolume for this backup
745
746 echo "   Determining whether the right USB device containing our USBVolume is present physically"
747
748 found=nothing
749 for i in sda sdb sdc; do
750   sd=$i"1"
751   echo "   Trying with $sd"
752   mount /dev/$sd /mnt/usbdrv/bacula -t ext2
753   ls -al /mnt/usbdrv/bacula
754
755   if [ -f /mnt/usbdrv/bacula/$volumename ] ; then
756     found=/dev/$i
757   fi
758
759   umount /mnt/usbdrv/bacula
760 done
761
762 echo
763 echo "    Found: $found containing $volumename "
764 echo
765 if [ $found != nothing ] ; then
766    # mount /mnt/usbdrv/bacula and /mnt/usbdrv/misc on /dev/sd?1 and /dev/sd?5 respectively
767   mount $found"1" /mnt/usbdrv/bacula -t ext2
768   mount $found"5" /mnt/usbdrv/misc -t vfat
769
770    # copy Ghost images of Windows system drives, the contents of /etc/bacula/*
771    # and a text file with restore instructions to /mnt/usbdrv/misc
772
773   echo "   Copying Ghost image of TOSFEB31 to /mnt/usbdrv/misc"
774   cp -v /mnt/Ghost/PROD/TOSFEB31/SYSTEMAG.GHO /mnt/usbdrv/misc
775   echo "   Copying Ghost image of TOSFEB32 to /mnt/usbdrv/misc"
776   cp -v /mnt/Ghost/PROD/TOSFEB32/COFTF32.GHO /mnt/usbdrv/misc
777   echo "   Copying /etc/bacula to /mnt/usbdrv/misc"
778   cp -Rfv /etc/bacula/ /mnt/usbdrv/misc
779   echo "   Copying Restore instructions to /mnt/usbdrv/misc"
780   cp -v /etc/bacula/How_To_Restore.txt /mnt/usbdrv/misc
781
782    # copy the current USBVolume to /mnt/usbdrv/bacula overwriting the previous volume file
783   echo
784   echo "   Copying Bacula USB-volume to /mnt/usbdrv/bacula"
785
786 #  cp -fv /mnt/spool/$volumename /mnt/usbdrv/bacula
787
788    # give some feedback about what was done
789
790   echo
791   echo "   Directory contents of /mnt/usbdrv/bacula"
792   ls -al /mnt/usbdrv/bacula
793   echo
794   echo "   Directory contents of /mnt/usbdrv/misc"
795   ls -al /mnt/usbdrv/misc
796
797    # unmount /mnt/usbdrv/bacula and /mnt/usbdrv/misc
798   echo
799   echo "   Unmounting /mnt/usbdrv/... mount points"
800   umount /mnt/usbdrv/bacula
801   umount /mnt/usbdrv/misc
802
803 else
804    # send emails if correct medium is not present
805 #  /usr/sbin/smtp
806   echo "hello"
807 fi
808
809 # This is run as a RunAfterJob of the catalog backup.  It already had a
810 # RunAfterJob, so we execute that here 
811
812 /etc/bacula/delete_catalog_backup
813