1 From bacula-users-admin@lists.sourceforge.net Sat Jan 31 05:42:42 2004
2 Return-Path: <bacula-users-admin@lists.sourceforge.net>
3 Received: from sc8-sf-list2.sourceforge.net (lists.sourceforge.net
4 [66.35.250.206]) by matou.sibbald.com (8.12.10/8.12.10) with ESMTP id
5 i0V4ggtH005859 for <kern@sibbald.com>; Sat, 31 Jan 2004 05:42:42 +0100
6 Received: from localhost ([127.0.0.1] helo=projects.sourceforge.net) by
7 sc8-sf-list2.sourceforge.net with esmtp (Exim 4.30) id 1Amms2-0004RT-4e;
8 Fri, 30 Jan 2004 20:36:38 -0800
9 Received: from sc8-sf-mx1-b.sourceforge.net ([10.3.1.11]
10 helo=sc8-sf-mx1.sourceforge.net) by sc8-sf-list2.sourceforge.net with esmtp
11 (Exim 4.30) id 1Ammo5-0002Tt-2F for bacula-users@lists.sourceforge.net;
12 Fri, 30 Jan 2004 20:32:33 -0800
13 Received: from www.abis.be ([195.0.32.120] helo=xenophon.abis.be) by
14 sc8-sf-mx1.sourceforge.net with esmtp (Exim 4.30) id 1AmbFN-0008Hu-99 for
15 bacula-users@lists.sourceforge.net; Fri, 30 Jan 2004 08:11:57 -0800
16 Received: from tosfeb32.abis.be ([194.78.5.1]) by xenophon.abis.be
17 (8.11.6/8.11.6) with SMTP id i0UGBI715849 for
18 <bacula-users@lists.sourceforge.net>; Fri, 30 Jan 2004 17:11:18 +0100
19 Received: by tosfeb32.abis.be(Lotus SMTP MTA v4.6.5 (863.2 5-20-1999)) id
20 C1256E2B.0058F4EE ; Fri, 30 Jan 2004 17:11:38 +0100
21 X-Lotus-FromDomain: ABIS
22 From: "Johan Decock" <jdecock@abis.be>
23 To: bacula-users@lists.sourceforge.net
24 Message-ID: <C1256E2B.0058F381.00@tosfeb32.abis.be>
25 Subject: Re: [Bacula-users] cdwriter
27 Content-type: multipart/mixed; Boundary="0__=dQlRuu8umGKzn67woQcbAbtp1kVJLJuYIqUZPSjcX1GgjEHuWdvHDqOX"
28 Content-Disposition: inline
30 X-Spam-Report: Spam Filtering performed by sourceforge.net. See
31 http://spamassassin.org/tag/ for more details. Report problems to
32 http://sf.net/tracker/?func=add&group_id=1&atid=200001 1.1
33 MIME_BASE64_LATIN RAW: Latin alphabet text using base64 encoding
34 Sender: bacula-users-admin@lists.sourceforge.net
35 Errors-To: bacula-users-admin@lists.sourceforge.net
36 X-BeenThere: bacula-users@lists.sourceforge.net
37 X-Mailman-Version: 2.0.9-sf.net
40 <https://lists.sourceforge.net/lists/listinfo/bacula-users>,
41 <mailto:bacula-users-request@lists.sourceforge.net?subject=unsubscribe>
42 List-Id: Bacula user's email list for support and discussions
43 <bacula-users.lists.sourceforge.net>
44 List-Post: <mailto:bacula-users@lists.sourceforge.net>
45 List-Help: <mailto:bacula-users-request@lists.sourceforge.net?subject=help>
47 <https://lists.sourceforge.net/lists/listinfo/bacula-users>,
48 <mailto:bacula-users-request@lists.sourceforge.net?subject=subscribe>
50 <http://sourceforge.net/mailarchive/forum.php?forum=bacula-users>
51 Date: Fri, 30 Jan 2004 17:11:34 +0100
54 --0__=dQlRuu8umGKzn67woQcbAbtp1kVJLJuYIqUZPSjcX1GgjEHuWdvHDqOX
55 Content-type: text/plain; charset=us-ascii
56 Content-Disposition: inline
57 Content-Transfer-Encoding: 8bit
63 I thought it would be easy to find them in the archives. I'll post them again. I changed some things in them anyway in the mean time. I also include the Director config. Then you see how they are to be used in Runbefore- and RunafterJobs
65 I'm interested in any remarks or improvements you might have. (I'm still getting started in shell scripting)
69 # Default Bacula Director Configuration file
71 # The only thing that MUST be changed is to add one or more
72 # file or directory names in the Include directive of the
75 # For Bacula release 1.32b (14 Oct 2003) -- mandrake (FiveStar)
77 # You might also want to change the default email address
78 # from root to your address. See the "mail" and "operator"
79 # directives in the Messages resource.
82 Director { # define myself
84 DIRport = 9101 # where we listen for UA connections
85 QueryFile = "/etc/bacula/query.sql"
86 WorkingDirectory = "/var/bacula/working"
87 PidDirectory = "/var/run"
88 Maximum Concurrent Jobs = 1
89 Password = "abis" # Console password
94 Name = "Tosfeb31AllHDD"
98 FileSet = "Tosfeb31All"
103 RunBeforeJob = "/etc/bacula/prepare_DVDspool /mnt/backupdaily 1700000"
104 Write Bootstrap = "/var/bacula/working/Tosfeb31All.bsr"
109 Name = "Tosfeb31AllUSB"
113 FileSet = "Tosfeb31All"
114 Schedule = "WeeklyUSB"
118 Write Bootstrap = "/var/bacula/working/Tosfeb31All.bsr"
123 Name = "Tosfeb31EssentialDVD"
127 FileSet = "Tosfeb31Essential"
128 Schedule = "MonthlyDVD"
132 RunBeforeJob = "/etc/bacula/prepare_DVDspool /mnt/backupdaily 4700000"
133 Write Bootstrap = "/var/bacula/working/Tosfeb31Essential.bsr"
134 RunAfterJob = "/etc/bacula/inventorize_volumes %v"
139 Name = "Tosfeb31AllCompressedDVD"
143 FileSet = "Tosfeb31AllCompressed"
147 RunBeforeJob = "/etc/bacula/prepare_DVDspool /mnt/backupdaily 4700000"
148 Write Bootstrap = "/var/bacula/working/Tosfeb31Essential.bsr"
149 RunAfterJob = "/etc/bacula/inventorize_volumes %v"
154 Name = "Tosfeb32AllHDD"
158 FileSet = "Tosfeb32All"
159 Schedule = "Weekdays"
163 Write Bootstrap = "/var/bacula/working/Tosfeb32All.bsr"
168 Name = "Tosfeb32AllUSB"
172 FileSet = "Tosfeb32All"
173 Schedule = "WeeklyUSB"
177 Write Bootstrap = "/var/bacula/working/Tosfeb32All.bsr"
182 Name = "Tosfeb32EssentialDVD"
186 FileSet = "Tosfeb32Essential"
187 Schedule = "MonthlyDVD"
191 Write Bootstrap = "/var/bacula/working/Tosfeb32System.bsr"
192 RunAfterJob = "/etc/bacula/inventorize_volumes %v"
197 # Name = "Tosfeb30System"
200 # Client = tosfeb30-fd
201 # FileSet = "Tosfeb30System"
202 # Schedule = "WeeklyUSB"
203 # Messages = Standard
206 # Write Bootstrap = "/etc/bacula/working/Tosfeb32System.bsr"
211 Name = "Tosfeb33SystemHDD"
215 FileSet = "Tosfeb33System"
216 Schedule = "Weekdays"
220 Write Bootstrap = "/var/bacula/working/Tosfeb33System.bsr"
225 Name = "Tosfeb33SystemUSB"
229 FileSet = "Tosfeb33System"
230 Schedule = "WeeklyUSB"
234 Write Bootstrap = "/var/bacula/working/Tosfeb33All.bsr"
239 Name = "Tosfeb33EssentialDVD"
243 FileSet = "Tosfeb33Essential"
244 Schedule = "MonthlyDVD"
248 Write Bootstrap = "/var/bacula/working/Tosfeb33Essential.bsr"
249 RunAfterJob = "/etc/bacula/inventorize_volumes %v"
254 Name = "BackupCatalogHDD"
259 Schedule = "Weekdays"
263 # This creates an ASCII copy of the catalog
264 RunBeforeJob = "/etc/bacula/make_catalog_backup -u bacula"
265 # This deletes the copy of the catalog
266 RunAfterJob = "/etc/bacula/delete_catalog_backup"
267 Write Bootstrap = "/var/bacula/working/BackupCatalog.bsr"
268 Priority = 90 # run after main backup
272 Name = "BackupCatalogUSB"
277 Schedule = "WeeklyUSB"
281 # This creates an ASCII copy of the catalog
282 RunBeforeJob = "/etc/bacula/make_catalog_backup -u bacula"
283 # This writes the volume file to the proper USB device
284 RunAfterJob = "/etc/bacula/write_to_USB %v"
285 # RunAfterJob = "/etc/bacula/delete_catalog_backup"
286 Write Bootstrap = "/var/bacula/working/BackupCatalog.bsr"
287 Priority = 90 # run after main backup
291 Name = "BackupCatalogDVD"
296 Schedule = "MonthlyDVD"
300 # This creates an ASCII copy of the catalog
301 RunBeforeJob = "/etc/bacula/make_catalog_backup -u bacula"
302 # This writes the volume file to a DVD
303 RunAfterJob = "/etc/bacula/write_to_DVD %v"
304 Write Bootstrap = "/var/bacula/working/BackupCatalog.bsr"
305 Priority = 90 # run after main backup
308 # Standard Restore template, to be changed by Console program
310 Name = "RestoreFiles"
317 Where = /tmp/bacula-restores
320 # List of files to be backed up
323 Include = signature=MD5 portable=yes {
325 # Put your list of files here, one per line or include an
326 # external list with:
330 # Note: / backs up everything on the root partition.
331 # if you have other partitons such as /usr or /home
332 # you will probably want to add them too.
334 # By default this is defined to point to the Bacula build
335 # directory to give a reasonable FileSet to backup to
336 # disk storage during initial testing.
342 # If you backup the root directory, the following two excluded
343 # files can be useful
345 Exclude = { /proc /tmp /.journal /.fsck }
349 # When to do the backups, full backup on first sunday of the month,
352 Include = signature=MD5 portable=yes {
364 Exclude = {pagefile.sys, *.[Dd][Mm][Pp]}
367 Name = "Tosfeb31AllCompressed"
368 Include = signature=MD5 compression=GZIP portable=yes {
380 Exclude = {pagefile.sys, *.[Dd][Mm][Pp]}
383 Name = "Tosfeb31Essential"
384 Include = signature=MD5 compression=GZIP portable=yes {
390 Exclude = {*.[Tt][Mm][Pp], *.backup.fm, *.backup.book}
394 Include = signature=MD5 portable=yes {
402 Exclude = {pagefile.sys, *.[Dd][Mm][Pp]}
405 Name = "Tosfeb32Essential"
406 Include = signature=MD5 compression=GZIP portable=yes {
410 Exclude = {*.[Tt][Mm][Pp]}
414 Name = "Tosfeb33System"
415 Include = signature=MD5 portable=yes {
425 Exclude = {/var, /proc}
429 Name = "Tosfeb33Essential"
430 Include = signature=MD5 compression=GZIP portable=yes {
438 Run = Full tue-fri at 01:00
443 Run = Full sat at 01:00
448 Run = Full 1st sat at 04:00 # These will remain on site
449 Run = Full 3rd sat at 04:00 # These will be carried off site
452 # This is the backup of the catalog
455 Include = signature=MD5 {
456 /var/bacula/working/bacula.sql
460 # Client (File Services) to backup
463 Address = tosfeb33.abis.be
466 Password = "abis" # password for FileDaemon
467 File Retention = 30 days # 30 days
468 Job Retention = 6 months # six months
469 AutoPrune = yes # Prune expired Jobs/Files
474 Address = tosfeb30.abis.be
478 File Retention = 30 days
479 Job Retention = 6 months
485 Address = tosfeb31.abis.be
489 File Retention = 30 days
490 Job Retention = 6 months
496 Address = tosfeb32.abis.be
500 File Retention = 30 days
501 Job Retention = 6 months
505 # Definiton of file storage device
509 Address = tosfeb33.abis.be
512 Device = HDdriveStorage
518 Address = tosfeb33.abis.be
521 Device = USBdriveStorage
527 Address = tosfeb33.abis.be
530 Device = DVDdriveStorage
534 # Generic catalog service
537 dbname = bacula; user = bacula; password = ""
540 # Reasonable message delivery -- send most everything to email address
544 mailcommand = "/usr/sbin/smtp -h tosfeb32.abis.be -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
545 operatorcommand = "/usr/sbin/smtp -h tosfeb32.abis.be -f \"\(Bacula\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
546 mail = jdecock@abis.be = all, !skipped
547 operator = jdecock@abis.be = mount
548 console = all, !skipped, !saved
550 # WARNING! the following will create a file that you must cycle from
551 # time to time as it will grow indefinitely. However, it will
552 # also keep all your messages if they scroll off the console.
554 append = "/etc/bacula/working/log" = all, !skipped
557 # Pool definition for daily backup on hard disk in backup server
562 # Recycle Oldest Volume = yes
563 Purge Oldest Volume = yes
565 Maximum Volumes = 4 # Monday through Thursday
566 Volume Retention = 2 weeks
567 Accept Any Volume = yes
568 Maximum Volume Jobs = 4 # 31, 32, 33 and Catalog
569 # Maximum Volume Files = 2
570 Maximum Volume Bytes = 18g
571 Volume Use Duration = 1d
572 Label Format = "HDDVolume"
575 # Pool definition for weekly backup, first on hard disk,
576 #then to be copied on removable USB2 hard disk drives in an AfterRunJob
581 Purge Oldest Volume = yes
583 Maximum Volumes = 3 # We have 3 removable USB2 disks
584 Volume Retention = 2 months
585 Accept Any Volume = yes
586 Maximum Volume Jobs = 4 # 31, 32, 33 and Catalog
587 Maximum Volume Bytes = 18g
588 Volume Use Duration = 1d
589 Label Format = "USBVolume"
592 # Pool definition for monthly backups on DVDspool, to be copied to DVD+/-R media in an AfterRunJob
598 Volume Retention = 2 years
599 Accept Any Volume = yes
600 Maximum Volume Bytes = 2147483500 # 2 GB is the maximum size of a file on an ISO9660 file system
601 Maximum Volume Jobs = 1 # each backup job gets its own set of volumes
602 # Maximum Volume Bytes = 4699990000 # 4 700 000 000 # 4.38 GB is the actual size that will fit on a DVD
603 Volume Use Duration = 1d
604 Label Format = "DVD${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}-${NumVols}"
615 # shell script to initialize environment for creating a backup that will be written to DVD+/-R(W)
617 # it will need to check whether there is enough space on the path supplied as the first parameter
618 # and if there isn't it will need to remove some files.
620 # it will also remove the file where all the volume names are collected during the backup run.
622 path=$1 # /mnt/backupdaily
625 #Define global variable to hold return value from function
629 # Define function to determine free space on a mount point
632 freespace=`df | grep $path | awk '{print $4}'`
633 if [ 0 -ne `expr index "$freespace" %` ] ; then
634 freespace=`df | grep $path | awk '{print $3}'`
637 #Define global variable to hold return value from function
641 # Define function to pad a number with spaces to the left for display
647 while [ ${#stringtopad} -lt $wantedlength ]
649 stringtopad=" "$stringtopad
654 PadSpacesToLeft $quota 9
656 echo "How much free space is needed on $path? $padded"
658 # How much space is there left?
662 PadSpacesToLeft $freespace 9
664 echo "Free space currently available on $path:$padded"
666 # As long as there isn't enough room, delete the oldest DVD volume files
667 while [ $freespace -lt $quota ]
669 # determine which is the oldest DVD volume file in /mnt/backupdaily
670 # ls puts the oldest file on top
671 # head grabs the first line
672 # and awk gets the 9th column of this line, i.e. the file name we were looking for
673 oldestfile=`ls -ralt $path/DVD* | head -n 1 | awk '{print $9}'`
675 echo "Deleting: $oldestfile"
678 # assess how much space there is now
680 PadSpacesToLeft $freespace 9
681 echo "Free space currently available on $path:$padded"
682 # and then we test again.
685 # remove the file where all the volume names will be collected.
686 # so we can have a clean run
688 rm -f /var/bacula/volumes
697 # shell script to inventorize volumes used during a backup
700 # Replace | character with spaces (necessary for the for command)
702 volumes=${volumes//|/ }
704 # For every volume do
706 for i in $volumes ; do
707 echo $i >> /var/bacula/volumes
718 # shell script to copy DVD volume files from /mnt/backupdaily to DVD+/-R(W)
720 # The last volume was not added to the inventory list yet, so we do that first
721 /etc/bacula/inventorize_volumes $1
723 supermount -m=/mnt/cdrom disable
727 # another shell script run as a RunAfterJob has been putting the volume names into a text file
728 # now we retrieve those names and write them to DVD
730 # this awk command produces a space delimited list of the lines of the text file and assigns it to $lines
732 lines=`awk '{print $1}' /var/bacula/volumes`
734 # now we can iterate over those volume names
738 if [ $count -le 1 ] ; then
739 # When creating a DVD with growisofs one needs to use -Z the first time
740 echo "Writing first volume file" $count
741 growisofs -Z /dev/scd0 -R -J /mnt/backupdaily/$i
743 # and -M the for the next volume files
744 echo "Writing another volume file" $count
745 growisofs -M /dev/scd0 -R -J /mnt/backupdaily/$i
753 ls -al /mnt/backupdaily
758 #supermount -m=/mnt/cdrom enable
760 # This is run as a RunAfterJob of the catalog backup. It already had a RunAfterJob, so we execute that here
761 /etc/bacula/delete_catalog_backup
768 This last one is to write to removable USB-storage.
774 # shell script to finalize USB backup
777 echo " Creating mount points, if they don't exist"
778 if ! [ -d /mnt/usbdrv ] ; then
781 if ! [ -d /mnt/usbdrv/bacula ] ; then
782 mkdir /mnt/usbdrv/bacula
784 if ! [ -d /mnt/usbdrv/misc ] ; then
785 mkdir /mnt/usbdrv/misc
787 #unmount all mount points related to USB
789 echo " Making sure no USB devices are mounted"
791 umount /mnt/usbdrv/bacula
792 umount /mnt/usbdrv/misc
793 umount /mnt/removable
794 umount /mnt/removable2
795 umount /mnt/removable3
797 #determine which /dev/sd? contains the right USBVolume for this backup
799 echo " Determining whether the right USB device containing our USBVolume is present physically"
802 for i in sda sdb sdc; do
804 echo " Trying with $sd"
805 mount /dev/$sd /mnt/usbdrv/bacula -t ext2
806 ls -al /mnt/usbdrv/bacula
808 if [ -f /mnt/usbdrv/bacula/$volumename ] ; then
812 umount /mnt/usbdrv/bacula
816 echo " Found: $found containing $volumename "
818 if [ $found != nothing ] ; then
819 # mount /mnt/usbdrv/bacula and /mnt/usbdrv/misc on /dev/sd?1 and /dev/sd?5 respectively
820 mount $found"1" /mnt/usbdrv/bacula -t ext2
821 mount $found"5" /mnt/usbdrv/misc -t vfat
823 # copy Ghost images of Windows system drives, the contents of /etc/bacula/*
824 # and a text file with restore instructions to /mnt/usbdrv/misc
826 echo " Copying Ghost image of TOSFEB31 to /mnt/usbdrv/misc"
827 cp -v /mnt/Ghost/PROD/TOSFEB31/SYSTEMAG.GHO /mnt/usbdrv/misc
828 echo " Copying Ghost image of TOSFEB32 to /mnt/usbdrv/misc"
829 cp -v /mnt/Ghost/PROD/TOSFEB32/COFTF32.GHO /mnt/usbdrv/misc
830 echo " Copying /etc/bacula to /mnt/usbdrv/misc"
831 cp -Rfv /etc/bacula/ /mnt/usbdrv/misc
832 echo " Copying Restore instructions to /mnt/usbdrv/misc"
833 cp -v /etc/bacula/How_To_Restore.txt /mnt/usbdrv/misc
835 # copy the current USBVolume to /mnt/usbdrv/bacula overwriting the previous volume file
837 echo " Copying Bacula USB-volume to /mnt/usbdrv/bacula"
839 # cp -fv /mnt/spool/$volumename /mnt/usbdrv/bacula
841 # give some feedback about what was done
844 echo " Directory contents of /mnt/usbdrv/bacula"
845 ls -al /mnt/usbdrv/bacula
847 echo " Directory contents of /mnt/usbdrv/misc"
848 ls -al /mnt/usbdrv/misc
850 # unmount /mnt/usbdrv/bacula and /mnt/usbdrv/misc
852 echo " Unmounting /mnt/usbdrv/... mount points"
853 umount /mnt/usbdrv/bacula
854 umount /mnt/usbdrv/misc
857 # send emails if correct medium is not present
862 # This is run as a RunAfterJob of the catalog backup. It already had a RunAfterJob, so we execute that here
863 /etc/bacula/delete_catalog_backup
870 From: "Alex Federau" <alex.federau@gmx.ch> on 30/01/2004 15:57 GMT
872 To: Johan Decock/Abis@Abis
874 Subject: Re: [Bacula-users] cdwriter
878 --0__=dQlRuu8umGKzn67woQcbAbtp1kVJLJuYIqUZPSjcX1GgjEHuWdvHDqOX
879 Content-type: text/plain; charset=iso-8859-1
880 Content-Disposition: inline
881 Content-Transfer-Encoding: 8bit
885 Could you send me the scripts or tell me where they are located. I am
886 browsing the mail archive,
887 and while I can find several of your mails, I am unable to find your
888 scripts. Probably they would be very useful for us.
898 > Bacula isn't able to write to CD-R or DVD+/-R directly. This isn't needed
899 > though. If you look in the mailing list archive, you will find that I have
900 > implemented a solution where the backup volume files are written to DVD+R
901 > with some bash scripts. A caveat is that files on an ISO9660 can't be
903 > than 2 GB (Not on Linux anyway). This has kept me busy for a while,
904 > looking what was going on and why I wasn't able to read back my DVD's.
906 > I hope my scripts are of help to you.
913 > From: "Alex Federau" <alex.federau@gmx.ch> on 30/01/2004 14:29 GMT
915 > To: bacula-users@lists.sourceforge.net
916 > cc: (bcc: Johan Decock/Abis)
917 > Subject: [Bacula-users] cdwriter
923 +++ Mailpower für Multimedia-Begeisterte: http://www.gmx.net/topmail +++
924 250 MB Mailbox, 1 GB Online-Festplatte, 100 FreeSMS. Jetzt kostenlos testen!
933 --------------------------------------------------------------------------
934 ABIS Training & Consulting
935 website: http://www.abis.be - e-mail: training@abis.be
936 tel: Belgium: (+32)-16-245610 - The Netherlands: (+31)-348-435570
937 fax: Belgium: (+32)-16-245691 - The Netherlands: (+31)-348-432493
938 --------------------------------------------------------------------------
939 --0__=dQlRuu8umGKzn67woQcbAbtp1kVJLJuYIqUZPSjcX1GgjEHuWdvHDqOX--
943 -------------------------------------------------------
944 The SF.Net email is sponsored by EclipseCon 2004
945 Premiere Conference on Open Tools Development and Integration
946 See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
947 http://www.eclipsecon.org/osdn
948 _______________________________________________
949 Bacula-users mailing list
950 Bacula-users@lists.sourceforge.net
951 https://lists.sourceforge.net/lists/listinfo/bacula-users