From: Kern Sibbald Date: Wed, 4 Feb 2004 22:10:00 +0000 (+0000) Subject: Doc + ignore label errors option in bls X-Git-Tag: Release-1.34.0~147 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7a43d684126a6828277f3ea69b3a7b3ecfe0600a;p=bacula%2Fbacula Doc + ignore label errors option in bls git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1029 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/examples/backup-to-cdwriter.txt b/bacula/examples/backup-to-cdwriter.txt new file mode 100644 index 0000000000..5d49b1bd0d --- /dev/null +++ b/bacula/examples/backup-to-cdwriter.txt @@ -0,0 +1,951 @@ +From bacula-users-admin@lists.sourceforge.net Sat Jan 31 05:42:42 2004 +Return-Path: +Received: from sc8-sf-list2.sourceforge.net (lists.sourceforge.net + [66.35.250.206]) by matou.sibbald.com (8.12.10/8.12.10) with ESMTP id + i0V4ggtH005859 for ; Sat, 31 Jan 2004 05:42:42 +0100 +Received: from localhost ([127.0.0.1] helo=projects.sourceforge.net) by + sc8-sf-list2.sourceforge.net with esmtp (Exim 4.30) id 1Amms2-0004RT-4e; + Fri, 30 Jan 2004 20:36:38 -0800 +Received: from sc8-sf-mx1-b.sourceforge.net ([10.3.1.11] + helo=sc8-sf-mx1.sourceforge.net) by sc8-sf-list2.sourceforge.net with esmtp + (Exim 4.30) id 1Ammo5-0002Tt-2F for bacula-users@lists.sourceforge.net; + Fri, 30 Jan 2004 20:32:33 -0800 +Received: from www.abis.be ([195.0.32.120] helo=xenophon.abis.be) by + sc8-sf-mx1.sourceforge.net with esmtp (Exim 4.30) id 1AmbFN-0008Hu-99 for + bacula-users@lists.sourceforge.net; Fri, 30 Jan 2004 08:11:57 -0800 +Received: from tosfeb32.abis.be ([194.78.5.1]) by xenophon.abis.be + (8.11.6/8.11.6) with SMTP id i0UGBI715849 for + ; Fri, 30 Jan 2004 17:11:18 +0100 +Received: by tosfeb32.abis.be(Lotus SMTP MTA v4.6.5 (863.2 5-20-1999)) id + C1256E2B.0058F4EE ; Fri, 30 Jan 2004 17:11:38 +0100 +X-Lotus-FromDomain: ABIS +From: "Johan Decock" +To: bacula-users@lists.sourceforge.net +Message-ID: +Subject: Re: [Bacula-users] cdwriter +Mime-Version: 1.0 +Content-type: multipart/mixed; Boundary="0__=dQlRuu8umGKzn67woQcbAbtp1kVJLJuYIqUZPSjcX1GgjEHuWdvHDqOX" +Content-Disposition: inline +X-Spam-Score: 1.1 (+) +X-Spam-Report: Spam Filtering performed by sourceforge.net. See + http://spamassassin.org/tag/ for more details. Report problems to + http://sf.net/tracker/?func=add&group_id=1&atid=200001 1.1 + MIME_BASE64_LATIN RAW: Latin alphabet text using base64 encoding +Sender: bacula-users-admin@lists.sourceforge.net +Errors-To: bacula-users-admin@lists.sourceforge.net +X-BeenThere: bacula-users@lists.sourceforge.net +X-Mailman-Version: 2.0.9-sf.net +Precedence: bulk +List-Unsubscribe: + , + +List-Id: Bacula user's email list for support and discussions + +List-Post: +List-Help: +List-Subscribe: + , + +List-Archive: + +Date: Fri, 30 Jan 2004 17:11:34 +0100 + + +--0__=dQlRuu8umGKzn67woQcbAbtp1kVJLJuYIqUZPSjcX1GgjEHuWdvHDqOX +Content-type: text/plain; charset=us-ascii +Content-Disposition: inline +Content-Transfer-Encoding: 8bit + + + +Hi Alex, + +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 + +I'm interested in any remarks or improvements you might have. (I'm still getting started in shell scripting) + + +# +# Default Bacula Director Configuration file +# +# The only thing that MUST be changed is to add one or more +# file or directory names in the Include directive of the +# FileSet resource. +# +# For Bacula release 1.32b (14 Oct 2003) -- mandrake (FiveStar) +# +# You might also want to change the default email address +# from root to your address. See the "mail" and "operator" +# directives in the Messages resource. +# + +Director { # define myself + Name = tosfeb33-dir + DIRport = 9101 # where we listen for UA connections + QueryFile = "/etc/bacula/query.sql" + WorkingDirectory = "/var/bacula/working" + PidDirectory = "/var/run" + Maximum Concurrent Jobs = 1 + Password = "abis" # Console password + Messages = Standard +} + +Job { + Name = "Tosfeb31AllHDD" + Type = Backup + Level = Full + Client = tosfeb31-fd + FileSet = "Tosfeb31All" + Schedule = "Weekdays" + Messages = Standard + Pool = HDD + Storage = HDdrive + RunBeforeJob = "/etc/bacula/prepare_DVDspool /mnt/backupdaily 1700000" + Write Bootstrap = "/var/bacula/working/Tosfeb31All.bsr" + Priority = 10 +} + +Job { + Name = "Tosfeb31AllUSB" + Type = Backup + Level = Full + Client = tosfeb31-fd + FileSet = "Tosfeb31All" + Schedule = "WeeklyUSB" + Messages = Standard + Pool = USB + Storage = USBdrive + Write Bootstrap = "/var/bacula/working/Tosfeb31All.bsr" + Priority = 10 +} + +Job { + Name = "Tosfeb31EssentialDVD" + Type = Backup + Level = Full + Client = tosfeb31-fd + FileSet = "Tosfeb31Essential" + Schedule = "MonthlyDVD" + Messages = Standard + Pool = DVD + Storage = DVDdrive + RunBeforeJob = "/etc/bacula/prepare_DVDspool /mnt/backupdaily 4700000" + Write Bootstrap = "/var/bacula/working/Tosfeb31Essential.bsr" + RunAfterJob = "/etc/bacula/inventorize_volumes %v" + Priority = 10 +} + +Job { + Name = "Tosfeb31AllCompressedDVD" + Type = Backup + Level = Full + Client = tosfeb31-fd + FileSet = "Tosfeb31AllCompressed" + Messages = Standard + Pool = DVD + Storage = DVDdrive + RunBeforeJob = "/etc/bacula/prepare_DVDspool /mnt/backupdaily 4700000" + Write Bootstrap = "/var/bacula/working/Tosfeb31Essential.bsr" + RunAfterJob = "/etc/bacula/inventorize_volumes %v" + Priority = 10 +} + +Job { + Name = "Tosfeb32AllHDD" + Type = Backup + Level = Full + Client = tosfeb32-fd + FileSet = "Tosfeb32All" + Schedule = "Weekdays" + Messages = Standard + Pool = HDD + Storage = HDdrive + Write Bootstrap = "/var/bacula/working/Tosfeb32All.bsr" + Priority = 20 +} + +Job { + Name = "Tosfeb32AllUSB" + Type = Backup + Level = Full + Client = tosfeb32-fd + FileSet = "Tosfeb32All" + Schedule = "WeeklyUSB" + Messages = Standard + Pool = USB + Storage = USBdrive + Write Bootstrap = "/var/bacula/working/Tosfeb32All.bsr" + Priority = 10 +} + +Job { + Name = "Tosfeb32EssentialDVD" + Type = Backup + Level = Full + Client = tosfeb32-fd + FileSet = "Tosfeb32Essential" + Schedule = "MonthlyDVD" + Messages = Standard + Pool = DVD + Storage = DVDdrive + Write Bootstrap = "/var/bacula/working/Tosfeb32System.bsr" + RunAfterJob = "/etc/bacula/inventorize_volumes %v" + Priority = 20 +} + +#Job { +# Name = "Tosfeb30System" +# Type = Backup +# Level = Full +# Client = tosfeb30-fd +# FileSet = "Tosfeb30System" +# Schedule = "WeeklyUSB" +# Messages = Standard +# Pool = USB +# Storage = USBdrive +# Write Bootstrap = "/etc/bacula/working/Tosfeb32System.bsr" +# Priority = 20 +#} + +Job { + Name = "Tosfeb33SystemHDD" + Type = Backup + Level = Full + Client = tosfeb33-fd + FileSet = "Tosfeb33System" + Schedule = "Weekdays" + Messages = Standard + Pool = HDD + Storage = HDdrive + Write Bootstrap = "/var/bacula/working/Tosfeb33System.bsr" + Priority = 30 +} + +Job { + Name = "Tosfeb33SystemUSB" + Type = Backup + Level = Full + Client = tosfeb33-fd + FileSet = "Tosfeb33System" + Schedule = "WeeklyUSB" + Messages = Standard + Pool = USB + Storage = USBdrive + Write Bootstrap = "/var/bacula/working/Tosfeb33All.bsr" + Priority = 30 +} + +Job { + Name = "Tosfeb33EssentialDVD" + Type = Backup + Level = Full + Client = tosfeb33-fd + FileSet = "Tosfeb33Essential" + Schedule = "MonthlyDVD" + Messages = Standard + Pool = DVD + Storage = DVDdrive + Write Bootstrap = "/var/bacula/working/Tosfeb33Essential.bsr" + RunAfterJob = "/etc/bacula/inventorize_volumes %v" + Priority = 30 +} + +Job { + Name = "BackupCatalogHDD" + Type = Backup + Level = Full + Client = tosfeb33-fd + FileSet="Catalog" + Schedule = "Weekdays" + Storage = HDdrive + Messages = Standard + Pool = HDD + # This creates an ASCII copy of the catalog + RunBeforeJob = "/etc/bacula/make_catalog_backup -u bacula" + # This deletes the copy of the catalog + RunAfterJob = "/etc/bacula/delete_catalog_backup" + Write Bootstrap = "/var/bacula/working/BackupCatalog.bsr" + Priority = 90 # run after main backup +} + +Job { + Name = "BackupCatalogUSB" + Type = Backup + Level = Full + Client = tosfeb33-fd + FileSet="Catalog" + Schedule = "WeeklyUSB" + Storage = USBdrive + Messages = Standard + Pool = USB + # This creates an ASCII copy of the catalog + RunBeforeJob = "/etc/bacula/make_catalog_backup -u bacula" + # This writes the volume file to the proper USB device + RunAfterJob = "/etc/bacula/write_to_USB %v" +# RunAfterJob = "/etc/bacula/delete_catalog_backup" + Write Bootstrap = "/var/bacula/working/BackupCatalog.bsr" + Priority = 90 # run after main backup +} + +Job { + Name = "BackupCatalogDVD" + Type = Backup + Level = Full + Client = tosfeb33-fd + FileSet="Catalog" + Schedule = "MonthlyDVD" + Storage = DVDdrive + Messages = Standard + Pool = DVD + # This creates an ASCII copy of the catalog + RunBeforeJob = "/etc/bacula/make_catalog_backup -u bacula" + # This writes the volume file to a DVD + RunAfterJob = "/etc/bacula/write_to_DVD %v" + Write Bootstrap = "/var/bacula/working/BackupCatalog.bsr" + Priority = 90 # run after main backup +} + +# Standard Restore template, to be changed by Console program +Job { + Name = "RestoreFiles" + Type = Restore + Client = tosfeb33-fd + FileSet="Full Set" + Storage = HDdrive + Messages = Standard + Pool = HDD + Where = /tmp/bacula-restores +} + +# List of files to be backed up +FileSet { + Name = "Full Set" + Include = signature=MD5 portable=yes { +# +# Put your list of files here, one per line or include an +# external list with: +# +# > /var/bacula/volumes +done + +exit 0 + + + +write_to_DVD: + +#!/bin/bash +# +# shell script to copy DVD volume files from /mnt/backupdaily to DVD+/-R(W) + +# The last volume was not added to the inventory list yet, so we do that first +/etc/bacula/inventorize_volumes $1 + +supermount -m=/mnt/cdrom disable + +umount /mnt/cdrom + +# another shell script run as a RunAfterJob has been putting the volume names into a text file +# now we retrieve those names and write them to DVD + +# this awk command produces a space delimited list of the lines of the text file and assigns it to $lines + +lines=`awk '{print $1}' /var/bacula/volumes` + +# now we can iterate over those volume names + +let "count=1" +for i in $lines ; do + if [ $count -le 1 ] ; then + # When creating a DVD with growisofs one needs to use -Z the first time + echo "Writing first volume file" $count + growisofs -Z /dev/scd0 -R -J /mnt/backupdaily/$i + else + # and -M the for the next volume files + echo "Writing another volume file" $count + growisofs -M /dev/scd0 -R -J /mnt/backupdaily/$i + fi + let count="$count+1" +# sleep 5 + ls -al /mnt/cdrom +# sleep 5 +done + +ls -al /mnt/backupdaily +mount /mnt/cdrom +ls -al /mnt/cdrom +umount /mnt/cdrom + +#supermount -m=/mnt/cdrom enable + +# This is run as a RunAfterJob of the catalog backup. It already had a RunAfterJob, so we execute that here +/etc/bacula/delete_catalog_backup + +exit 0 + + + + +This last one is to write to removable USB-storage. + +write_to_USB + +#!/bin/bash +# +# shell script to finalize USB backup + +volumename=$1 +echo " Creating mount points, if they don't exist" +if ! [ -d /mnt/usbdrv ] ; then + mkdir /mnt/usbdrv +fi +if ! [ -d /mnt/usbdrv/bacula ] ; then + mkdir /mnt/usbdrv/bacula +fi +if ! [ -d /mnt/usbdrv/misc ] ; then + mkdir /mnt/usbdrv/misc +fi + #unmount all mount points related to USB + +echo " Making sure no USB devices are mounted" +umount /mnt/usbdrv +umount /mnt/usbdrv/bacula +umount /mnt/usbdrv/misc +umount /mnt/removable +umount /mnt/removable2 +umount /mnt/removable3 + + #determine which /dev/sd? contains the right USBVolume for this backup + +echo " Determining whether the right USB device containing our USBVolume is present physically" + +found=nothing +for i in sda sdb sdc; do + sd=$i"1" + echo " Trying with $sd" + mount /dev/$sd /mnt/usbdrv/bacula -t ext2 + ls -al /mnt/usbdrv/bacula + + if [ -f /mnt/usbdrv/bacula/$volumename ] ; then + found=/dev/$i + fi + + umount /mnt/usbdrv/bacula +done + +echo +echo " Found: $found containing $volumename " +echo +if [ $found != nothing ] ; then + # mount /mnt/usbdrv/bacula and /mnt/usbdrv/misc on /dev/sd?1 and /dev/sd?5 respectively + mount $found"1" /mnt/usbdrv/bacula -t ext2 + mount $found"5" /mnt/usbdrv/misc -t vfat + + # copy Ghost images of Windows system drives, the contents of /etc/bacula/* + # and a text file with restore instructions to /mnt/usbdrv/misc + + echo " Copying Ghost image of TOSFEB31 to /mnt/usbdrv/misc" + cp -v /mnt/Ghost/PROD/TOSFEB31/SYSTEMAG.GHO /mnt/usbdrv/misc + echo " Copying Ghost image of TOSFEB32 to /mnt/usbdrv/misc" + cp -v /mnt/Ghost/PROD/TOSFEB32/COFTF32.GHO /mnt/usbdrv/misc + echo " Copying /etc/bacula to /mnt/usbdrv/misc" + cp -Rfv /etc/bacula/ /mnt/usbdrv/misc + echo " Copying Restore instructions to /mnt/usbdrv/misc" + cp -v /etc/bacula/How_To_Restore.txt /mnt/usbdrv/misc + + # copy the current USBVolume to /mnt/usbdrv/bacula overwriting the previous volume file + echo + echo " Copying Bacula USB-volume to /mnt/usbdrv/bacula" + +# cp -fv /mnt/spool/$volumename /mnt/usbdrv/bacula + + # give some feedback about what was done + + echo + echo " Directory contents of /mnt/usbdrv/bacula" + ls -al /mnt/usbdrv/bacula + echo + echo " Directory contents of /mnt/usbdrv/misc" + ls -al /mnt/usbdrv/misc + + # unmount /mnt/usbdrv/bacula and /mnt/usbdrv/misc + echo + echo " Unmounting /mnt/usbdrv/... mount points" + umount /mnt/usbdrv/bacula + umount /mnt/usbdrv/misc + +else + # send emails if correct medium is not present +# /usr/sbin/smtp + echo "hello" +fi + +# This is run as a RunAfterJob of the catalog backup. It already had a RunAfterJob, so we execute that here +/etc/bacula/delete_catalog_backup + + + + + + +From: "Alex Federau" on 30/01/2004 15:57 GMT + +To: Johan Decock/Abis@Abis +cc: +Subject: Re: [Bacula-users] cdwriter + + + +--0__=dQlRuu8umGKzn67woQcbAbtp1kVJLJuYIqUZPSjcX1GgjEHuWdvHDqOX +Content-type: text/plain; charset=iso-8859-1 +Content-Disposition: inline +Content-Transfer-Encoding: 8bit + + +Hi Johan, +Could you send me the scripts or tell me where they are located. I am +browsing the mail archive, +and while I can find several of your mails, I am unable to find your +scripts. Probably they would be very useful for us. + +Cheers +Alex + + +> +> +> Hi Alex, +> +> Bacula isn't able to write to CD-R or DVD+/-R directly. This isn't needed +> though. If you look in the mailing list archive, you will find that I have +> implemented a solution where the backup volume files are written to DVD+R +> with some bash scripts. A caveat is that files on an ISO9660 can't be +larger +> than 2 GB (Not on Linux anyway). This has kept me busy for a while, +> looking what was going on and why I wasn't able to read back my DVD's. +> +> I hope my scripts are of help to you. +> +> Johan +> +> +> +> +> From: "Alex Federau" on 30/01/2004 14:29 GMT +> +> To: bacula-users@lists.sourceforge.net +> cc: (bcc: Johan Decock/Abis) +> Subject: [Bacula-users] cdwriter +> +> +> + +-- ++++ Mailpower für Multimedia-Begeisterte: http://www.gmx.net/topmail +++ +250 MB Mailbox, 1 GB Online-Festplatte, 100 FreeSMS. Jetzt kostenlos testen! + + + + + + + + +-------------------------------------------------------------------------- +ABIS Training & Consulting +website: http://www.abis.be - e-mail: training@abis.be +tel: Belgium: (+32)-16-245610 - The Netherlands: (+31)-348-435570 +fax: Belgium: (+32)-16-245691 - The Netherlands: (+31)-348-432493 +-------------------------------------------------------------------------- +--0__=dQlRuu8umGKzn67woQcbAbtp1kVJLJuYIqUZPSjcX1GgjEHuWdvHDqOX-- + + + +------------------------------------------------------- +The SF.Net email is sponsored by EclipseCon 2004 +Premiere Conference on Open Tools Development and Integration +See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. +http://www.eclipsecon.org/osdn +_______________________________________________ +Bacula-users mailing list +Bacula-users@lists.sourceforge.net +https://lists.sourceforge.net/lists/listinfo/bacula-users diff --git a/bacula/kernstodo b/bacula/kernstodo index e83f1d281c..063e0a9af1 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -70,13 +70,17 @@ For 1.33 Testing/Documentation: http://howtos.linux.com/guides/nag2/x-087-2-nfs.mountd.shtml For 1.33 +- Add FromClient and ToClient keywords on restore command (or + BackupClient RestoreClient). +- Automatic "update slots" on user configuration directive when a + slot error occurs. - Allow "delete job jobid=xx jobid=xxx". - Allow "delete job jobid=xxx,yyy,aaa-bbb" i.e. list + ranges. - Implement multiple Volume in "purge jobs volume=". - Implement a JobSet, which groups any number of jobs. If the JobSet is started, all the jobs are started together. Allow Pool, Level, and Schedule overrides. -- Enhance cancel to timout BSOCK packets after a specific delay. +- Enhance cancel to timeout BSOCK packets after a specific delay. - When I restore to Windows the Created, Accessed and Modifiedtimes are those of the time of the restore, not those of the originalfile. The dates you will find in your restore log seem to be the original diff --git a/bacula/src/jcr.h b/bacula/src/jcr.h index 74518b63d1..3dba8948d4 100644 --- a/bacula/src/jcr.h +++ b/bacula/src/jcr.h @@ -233,6 +233,7 @@ struct JCR { bool NewVol; /* set when new Volume mounted */ bool WroteVol; /* set when Volume written */ bool NewFile; /* set when EOF written */ + bool ignore_label_errors; /* ignore Volume label errors */ int CurVol; /* Current Volume count */ uint32_t FileId; /* Last file id inserted */ diff --git a/bacula/src/stored/bls.c b/bacula/src/stored/bls.c index 69c75b58ff..380bd598b1 100644 --- a/bacula/src/stored/bls.c +++ b/bacula/src/stored/bls.c @@ -73,7 +73,9 @@ static void usage() " -i include list\n" " -j list jobs\n" " -k list blocks\n" -" (none of above) list saved files\n" +" (no j or k option) list saved files\n" +" -L dump label\n" +" -p proceed inspite of errors\n" " -v be verbose\n" " -V specify Volume names (separated by |)\n" " -? print this message\n\n"); @@ -88,6 +90,7 @@ int main (int argc, char *argv[]) char line[1000]; char *VolumeName= NULL; char *bsrName = NULL; + bool ignore_label_errors = false; working_directory = "/tmp"; my_name_is(argc, argv, "bls"); @@ -96,7 +99,7 @@ int main (int argc, char *argv[]) memset(&ff, 0, sizeof(ff)); init_include_exclude_files(&ff); - while ((ch = getopt(argc, argv, "b:c:d:e:i:jkLtvV:?")) != -1) { + while ((ch = getopt(argc, argv, "b:c:d:e:i:jkLvV:?")) != -1) { switch (ch) { case 'b': bsrName = optarg; @@ -155,6 +158,10 @@ int main (int argc, char *argv[]) dump_label = TRUE; break; + case 'p': + ignore_label_errors = true; + break; + case 'v': verbose++; break; @@ -192,6 +199,7 @@ int main (int argc, char *argv[]) bsr = parse_bsr(NULL, bsrName); } jcr = setup_jcr("bls", argv[i], bsr, VolumeName); + jcr->ignore_label_errors = ignore_label_errors; dev = setup_to_access_device(jcr, 1); /* acquire for read */ if (!dev) { exit(1); diff --git a/bacula/src/stored/label.c b/bacula/src/stored/label.c index a92b259ccb..559bb7c2ae 100644 --- a/bacula/src/stored/label.c +++ b/bacula/src/stored/label.c @@ -111,6 +111,11 @@ because:\n %s"), dev_name(dev), strerror_dev(dev)); } if (!ok) { free_record(record); + if (jcr->ignore_label_errors) { + dev->state |= ST_LABEL; /* set has Bacula label */ + Jmsg(jcr, M_ERROR, 0, "%s", jcr->errmsg); + return jcr->label_status = VOL_OK; + } empty_block(block); rewind_dev(dev); return jcr->label_status = VOL_NO_LABEL; diff --git a/bacula/src/version.h b/bacula/src/version.h index cb4afae638..492893a380 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -2,8 +2,8 @@ #undef VERSION #define VERSION "1.33" #define VSTRING "1" -#define BDATE "03 Feb 2004" -#define LSMDATE "03Feb04" +#define BDATE "04 Feb 2004" +#define LSMDATE "04Feb04" /* Debug flags */ #undef DEBUG