]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
kes Manual updates.
authorKern Sibbald <kern@sibbald.com>
Wed, 6 Sep 2006 18:40:39 +0000 (18:40 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 6 Sep 2006 18:40:39 +0000 (18:40 +0000)
kes  Update examples directory.
kes  Remove unused variable in winservice.cpp
kes  Make Win32 make command build installer.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3418 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/ReleaseNotes
bacula/examples/Write-DVD-with-UDF.txt [new file with mode: 0644]
bacula/examples/client-backup [moved from bacula/examples/backup with 100% similarity]
bacula/examples/nagios/check_bacula_pools.sh [new file with mode: 0644]
bacula/examples/nagios/nagios.txt [moved from bacula/examples/nagios.txt with 100% similarity]
bacula/examples/nagios/nagios_plugin_check_bacula.tgz [moved from bacula/examples/nagios_plugin_check_bacula.tgz with 100% similarity]
bacula/kernstodo
bacula/projects
bacula/src/stored/dev.c
bacula/src/version.h
bacula/technotes-1.39

index 35cd4cdd39670a74ab1e272d4dad6ac6efa51873..157dbbb0e16dc5755392b3fe71006476bfd5b0e9 100644 (file)
@@ -49,6 +49,12 @@ Fixes for 1.39.20:
   general, it should be very fast.
 
 New Features in 1.40.0 (beginning of release info)
+- Additional support for removable devices.  See the 
+  Requires Mount, Mount Point, Mount Command, and Unmount
+  Commands in the Storage daemon configuration chapter:
+  http://www.bacula.org/dev-manual/Storage_Daemon_Configuratio.html
+  Also see the Edit Codes for Mount and Unmount Directives in the
+  same chapter.
 - There is a new cross-compiled Win32 File daemon that now has all the features
   that were previously only in the Unix versions.
 
diff --git a/bacula/examples/Write-DVD-with-UDF.txt b/bacula/examples/Write-DVD-with-UDF.txt
new file mode 100644 (file)
index 0000000..17aaf63
--- /dev/null
@@ -0,0 +1,75 @@
+From stephan.ebelt@net-linx.com Fri Apr  7 21:01:24 2006
+From: Stephan Ebelt <stephan.ebelt@net-linx.com>
+Subject: [Bacula-devel] DVD + packet writing + UDF
+
+Hello,
+
+is anyone using this approach in production?
+
+I do for about a week now. And it appears to be easier to setup and is,
+in fact, quite media independent. (I actually gave up on trying the
+growisofs/dvd-handler method - bacula constantly rejected most of my
+media...)
+
+Here is how it works for me (all done with bacula 1.38.5 on FC4 with the
+udftools package installed):
+
+1. load udf file system support (modprobe udf)
+
+2. create a packet writing device on top of the dvd drive (pktsetup
+   dvd-writer /dev/hdc)
+
+3. format a blank media with UDF file system (mkudffs --media-type=dvd
+   /dev/pktcdvd/dvd-writer), I tried with DVD-RAM, DVD+RW and CD-RW
+   media. All appear to work fine - at different speeds of course.
+
+4. mount the freshly formatted media (mount -t udf
+   /dev/pktcdvd/dvd-writer /mnt/dvd-writer -o noatime). Note that
+   'noatime' makes the media living longer.
+
+5. configure the SD as it would write to hard disk:
+
+    Device {
+      Name       = DVD-Writer
+      Media Type = DVD
+
+      ArchiveDevice  = /mnt/dvd-writer
+
+      LabelMedia     = no      # I want only one Volume per DVD
+      AutomaticMount = yes
+      RemovableMedia = yes
+      AlwaysOpen     = no
+    }
+
+Now the whole thing can be automated further: steps 1, 2 and 5 are
+one-time system setup.
+
+Step 3 would require some logic to determine whether a media really is
+blank. I guess something the like is already in dvd-handler?.
+
+Step 4 should be automatic with 1.39.5+ (with the RequiresMount,
+MountPoint, MountCommand... etc... options being more general). I havn't
+tried this yet.
+
+I do not know how stable this is yet. I am a bit concerned because I
+read in a older mail (from Nicolas Boichat, end of 2004) that he
+considered packet-writing/UDF as not reliable enough at that time.
+
+However, the few restores I tried were all successful. Also I can read
+the DVDs on at least one other computer. Maybe the UDF and pkcdvd code
+matured in the meantime? I'll leave it running here and keep on testing...
+
+best regards,
+Stephan
+
+
+
+-------------------------------------------------------
+This SF.Net email is sponsored by xPML, a groundbreaking scripting language
+that extends applications into web and mobile media. Attend the live webcast
+and join the prime developer group breaking into this new coding territory!
+http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
+_______________________________________________
+Bacula-devel mailing list
+Bacula-devel@lists.sourceforge.net
+https://lists.sourceforge.net/lists/listinfo/bacula-devel
diff --git a/bacula/examples/nagios/check_bacula_pools.sh b/bacula/examples/nagios/check_bacula_pools.sh
new file mode 100644 (file)
index 0000000..946f83e
--- /dev/null
@@ -0,0 +1,159 @@
+#! /bin/sh
+# Author : Ludovic Strappazon. l.strappazon@gmail.com
+# Copyright : Kern Sibbald 
+# Any comment, advice or enhancement are welcome  :-) 
+
+PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
+MYSQL="/usr/bin/mysql -u bacula --password=mypassword"
+TMP=/tmp
+BACULA=/usr/local/bacula
+
+PROGNAME=`basename $0`
+PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'`
+STATUS=""
+
+. $PROGPATH/utils.sh
+
+print_usage() {
+        echo "Usage: $PROGNAME -P <pool> -M <media-type> -w <warning threshold> -c <critical threshold> [-S]"
+}
+
+print_help() {
+        echo ""
+        print_usage
+        echo ""
+        echo "This plugin checks the space available in the pool against the space required for the next scheduled backups"
+        echo "Example : $PROGNAME -P default -M LTO -w 20 -c 10 will check the default pool, return OK if (available space) > 1,20*(required space), WARNING if 1,20*(required space) > (available space) > 1,10*(required space), and CRITICAL else."
+       echo ""
+       echo "With the -S option, it will check the pool named Scratch and return WARNING instead of CRITICAL if the Scratch pool can save the situation."
+       echo "Example : $PROGNAME -P default -M LTO -w 20 -c 10 -S will check the default pool, return OK if (available space) > 1,20*(required space), WARNING if 1,20*(required space) > (available space) > 1,10*(required space) or if (available space in default and Scratch) > 1,10*(required space) > (available space in default), and CRITICAL else."
+       echo ""
+       echo "The evaluation of the space required is done by adding the biggest backups of the same level than the scheduled jobs"
+       echo "The available space is evaluated by the number of out of retention tapes and the average VolBytes of these Full tapes"
+       echo ""
+       echo "The Information Status are : \"Required, Available, Volume Errors\" and \"Will use Scratch pool\" if necessary."
+       echo ""
+       echo "I think this plugin should be used in passive mode, and ran by a RunAfterJob"
+       exit 3
+}
+
+NB_ARGS=$#
+SCRATCH=0
+while getopts :P:M:w:c:hS OPTION
+do
+  case $OPTION in
+    P) POOL="$OPTARG"
+       ;;
+    M) MEDIA_TYPE="$OPTARG"
+       ;;
+    S) SCRATCH=1
+       ;;
+    w) WARNING="$OPTARG"
+       ;;
+    c) CRITICAL="$OPTARG"
+       ;;
+    h) print_help
+       exit 3
+       ;;
+    *) print_usage
+       exit 3
+       ;;
+  esac
+done
+shift $(($OPTIND - 1))
+
+if [ "$NB_ARGS" -ne 8 -a "$NB_ARGS" -ne 9 ]; then
+       print_revision $PROGNAME 25/05/2005
+       print_usage
+        exit 3
+fi
+
+LAST_CHECK=`ps -ef | grep check_ba[Cc]ula_pools.sh | awk {'print $5'} | uniq | wc -l`
+if [ "$LAST_CHECK" -gt 1 ]; then
+       echo "The last check was not complete, you should increase the check_period."
+       exit 3
+fi
+
+  NB_VOLUMES_OUT_OF_RETENTION=`$MYSQL << EOF
+USE bacula
+SELECT COUNT(MediaId) from Media, Pool where Media.PoolId=Pool.PoolId and Pool.Name="$POOL" AND LastWritten <> "0000-00-00 00:00:00" AND UNIX_TIMESTAMP()-UNIX_TIMESTAMP(LastWritten)>Media.VolRetention AND Inchanger = "1";
+EOF
+`
+  NB_VOLUMES_OUT_OF_RETENTION=`echo $NB_VOLUMES_OUT_OF_RETENTION | cut -f 2 -d ' '`
+
+NB_VOLUMES_ERROR=`$MYSQL << EOF
+USE bacula
+SELECT COUNT(MediaId) from Media, Pool where Media.PoolId=Pool.PoolId and Pool.Name="$POOL" AND VolStatus="Error" AND Inchanger = "1";
+EOF
+`
+NB_VOLUMES_ERROR=`echo $NB_VOLUMES_ERROR | cut -f 2 -d ' '`
+
+AVERAGE_CAPA_VOLUME=`$MYSQL << EOF
+USE bacula
+SELECT SUM(VolBytes)/COUNT(MediaId) FROM Media where VolStatus="Full" AND MediaType="$MEDIA_TYPE";
+EOF
+`
+AVERAGE_CAPA_VOLUME=`echo $AVERAGE_CAPA_VOLUME | cut -f 2 -d ' ' | cut -f 1 -d '.'`
+
+CAPA_VOLUMES_APPEND=`$MYSQL << EOF
+USE bacula
+SELECT SUM("$AVERAGE_CAPA_VOLUME"-VolBytes) from Media, Pool where Media.PoolId=Pool.PoolId and Pool.Name="$POOL" AND (VolStatus = "Append" OR VolStatus = "Recycle" OR VolStatus = "Purge") AND Inchanger = "1" AND MediaType="$MEDIA_TYPE";
+EOF
+`
+CAPA_VOLUMES_APPEND=`echo $CAPA_VOLUMES_APPEND | cut -f 2 -d ' '`
+
+if [ $SCRATCH -eq 1 ]
+then
+CAPA_VOLUMES_SCRATCH=`$MYSQL << EOF
+USE bacula
+SELECT SUM("$AVERAGE_CAPA_VOLUME"-VolBytes) from Media, Pool where Media.PoolId=Pool.PoolId and Pool.Name="Scratch" AND VolStatus = "Append" AND Inchanger = "1" AND MediaType="$MEDIA_TYPE";
+EOF
+`
+CAPA_VOLUMES_SCRATCH=`echo $CAPA_VOLUMES_SCRATCH | cut -f 2 -d ' '`
+else 
+CAPA_VOLUMES_SCRATCH=0
+fi
+
+echo "st
+1
+q" | $BACULA/etc/bconsole | sed -n /Scheduled/,/Running/p | grep Backup | tr -s [:blank:] | tr '[:blank:]' '@' > ${TMP}/Scheduled.txt
+
+CAPA_REQUIRED=0
+for LINE in `cat ${TMP}/Scheduled.txt`
+do
+  SCHEDULED_JOB=`echo $LINE | awk -F@ '{print $6}'`
+  LEVEL=`echo $LINE | awk -F@ '{print $1}' | cut -c 1` 
+
+MAX_VOLUME_JOB_FOR_LEVEL=`$MYSQL << EOF
+USE bacula
+SELECT MAX(JobBytes) from Job, Pool where Level="$LEVEL" AND Job.Name="$SCHEDULED_JOB" AND Job.PoolId=Pool.PoolId AND Pool.Name="$POOL";
+EOF
+`
+MAX_VOLUME_JOB_FOR_LEVEL=`echo $MAX_VOLUME_JOB_FOR_LEVEL | cut -f 2 -d ' ' `
+
+CAPA_REQUIRED=$[CAPA_REQUIRED+MAX_VOLUME_JOB_FOR_LEVEL]
+done
+
+rm ${TMP}/Scheduled.txt
+
+CAPA_WARNING=`echo $[(WARNING+100)*CAPA_REQUIRED]/100 | bc | cut -f 1 -d '.'`
+CAPA_CRITICAL=`echo $[(CRITICAL+100)*CAPA_REQUIRED]/100 | bc | cut -f 1 -d '.'`
+CAPA_DISP=$[NB_VOLUMES_OUT_OF_RETENTION*AVERAGE_CAPA_VOLUME+CAPA_VOLUMES_APPEND]
+CAPA_DISP_INCLUDING_SCRATCH=$[CAPA_DISP+CAPA_VOLUMES_SCRATCH]
+
+MESSAGE="Required : $[CAPA_REQUIRED/1000000000] Go, available : $[CAPA_DISP/1000000000] Go, Volumes Error : $NB_VOLUMES_ERROR"
+
+if [ "$CAPA_DISP" -gt $CAPA_WARNING ]; then
+   echo $MESSAGE
+   exit 0
+elif [ "$CAPA_DISP" -gt $CAPA_CRITICAL ];then
+   echo $MESSAGE
+   exit 1
+elif [ "$CAPA_DISP_INCLUDING_SCRATCH" -gt $CAPA_CRITICAL ];then
+   MESSAGE="${MESSAGE}. Will use Scratch Pool !"
+   echo $MESSAGE
+   exit 1
+else
+   exit 2
+fi
+exit 3
index ca5f74a2d78e72dedb940e2b0582f6c5ad1cdeea..0758a854dd53f7fc6cc542449400e64f29d26b60 100644 (file)
@@ -69,6 +69,32 @@ For 1.39:
   .move eject device=xxx toslot=yyy the same as above, but with a new 
      target slot. The catalog should be updated accordingly.
   .move transfer device=xxx fromslot=yyy toslot=zzz
+- Figure out how to configure query.sql.  Suggestion to use m4:
+    == changequote.m4 ===
+    changequote(`[',`]')dnl
+    ==== query.sql.in ===
+    :List next 20 volumes to expire
+    SELECT
+        Pool.Name AS PoolName,
+        Media.VolumeName,
+        Media.VolStatus,
+        Media.MediaType,
+    ifdef([MySQL],
+    [ FROM_UNIXTIME(UNIX_TIMESTAMP(Media.LastWritten) Media.VolRetention) AS Expire, ])dnl
+    ifdef([PostgreSQL],
+    [ media.lastwritten + interval '1 second' * media.volretention as expire, ])dnl
+      Media.LastWritten
+      FROM Pool
+      LEFT JOIN Media
+      ON Media.PoolId=Pool.PoolId
+      WHERE Media.LastWritten>0
+      ORDER BY Expire
+      LIMIT 20;
+    ====
+    Command: m4 -DmySQL changequote.m4 query.sql.in >query.sql
+
+  The problem is that it requires m4, which is not present on all machines
+  at ./configure time.
 
 Low priority:
 - Get Perl replacement for bregex.c
@@ -1658,4 +1684,3 @@ Block Position: 0
     > the Volumes in the magazine disabled prior to taking them offsite, and mark 
     > them all enabled when bringing them back on site.   Coupled with the options 
     > to the slots keyword, you can apply the enable/disable to any or all volumes.
-
index 69b1a556d82f80c09071903ade0225966276d2ee..76c0e48a7647daf1df43c8cf21cc345601464427 100644 (file)
@@ -1022,3 +1022,55 @@ Notes:    Legato Networker supports a similar system with full, incr, and 1-9 as
 
 Kern notes: I think this would add very little functionality, but a *lot* of
           additional overhead to Bacula.
+
+Item 1:   include JobID in spool file name
+  Origin: Mark Bergman <mark.bergman@uphs.upenn.edu>
+  Date:  Tue Aug 22 17:13:39 EDT 2006
+  Status:
+
+  What:   Change the name of the spool file to include the JobID
+
+  Why:    JobIDs are the common key used to refer to jobs, yet the 
+        spoolfile name doesn't include that information. The date/time
+        stamp is useful (and should be retained).
+
+
+
+Item 2:   include timestamp of job launch in "stat clients" output
+  Origin: Mark Bergman <mark.bergman@uphs.upenn.edu>
+  Date:  Tue Aug 22 17:13:39 EDT 2006
+  Status:
+
+  What:   The "stat clients" command doesn't include any detail on when
+        the active backup jobs were launched.
+
+  Why:   Including the timestamp would make it much easier to decide whether
+        a job is running properly. 
+
+  Notes: It may be helpful to have the output from "stat clients" formatted 
+        more like that from "stat dir" (and other commands), in a column
+        format. The per-client information that's currently shown (level,
+        client name, JobId, Volume, pool, device, Files, etc.) is good, but
+        somewhat hard to parse (both programmatically and visually), 
+        particularly when there are many active clients.
+
+Item 1:   Filesystemwatch triggered backup.
+  Date:   31 August 2006
+  Origin: Jesper Krogh <jesper@krogh.cc>
+  Status: Unimplemented, depends probably on "client initiated backups"
+
+  What:   With inotify and similar filesystem triggeret notification
+          systems is it possible to have the file-daemon to monitor
+          filesystem changes and initiate backup.
+
+  Why:    There are 2 situations where this is nice to have.
+          1) It is possible to get a much finer-grained backup than
+             the fixed schedules used now.. A file created and deleted
+             a few hours later, can automatically be caught.
+
+          2) The introduced load on the system will probably be
+             distributed more even on the system.
+
+  Notes:  This can be combined with configration that specifies
+          something like: "at most every 15 minutes or when changes
+          consumed XX MB".
index 2ba6fa455f48a577a46c29c7f47166cfd7898246..e3bcda034e90392629ae7f0a6722f6a39ea1c9f1 100644 (file)
@@ -432,7 +432,7 @@ void DEVICE::open_file_device(DCR *dcr, int omode)
    pm_strcpy(archive_name, dev_name);
    /*  
     * If this is a virtual autochanger (i.e. changer_res != NULL)
-    *  we simply use the deviced name, assuming it has been
+    *  we simply use the device name, assuming it has been
     *  appropriately setup by the "autochanger".
     */
    if (!device->changer_res) {
@@ -1908,7 +1908,7 @@ bool DEVICE::do_mount(int mount, int dotimeout)
    Dmsg1(20, "do_mount run_prog=%s\n", ocmd.c_str());
    while ((status = run_program_full_output(ocmd.c_str(), 
                        max_open_wait/2, results)) != 0) {
-      /* Doesn't work with internationalisation (This is not a problem) */
+      /* Doesn't work with internationalization (This is not a problem) */
       if (fnmatch("*is already mounted on", results, 0) == 0) {
          break;
       }
index ef3500c71c921819089fa4797e9e5f43823c8ab3..5f68f53358384c7a720f1e5a46fa53ab95eebea0 100644 (file)
@@ -3,9 +3,9 @@
  */
 
 #undef  VERSION
-#define VERSION "1.39.21"
-#define BDATE   "04 Septermber 2006"
-#define LSMDATE "04Sep06"
+#define VERSION "1.39.22"
+#define BDATE   "06 Septermber 2006"
+#define LSMDATE "06Sep06"
 #define BYEAR "2006"       /* year for copyright messages in progs */
 
 /* Debug flags */
index 5018864e336025e9783dc02c169ce1d6065334d3..9780ec87ad6d1174c1f88803e26e862c3cf24629 100644 (file)
@@ -1,6 +1,11 @@
               Technical notes on version 1.39  
 
 General:
+06Sep06
+kes  Manual updates.
+kes  Update examples directory.
+kes  Remove unused variable in winservice.cpp
+kes  Make Win32 make command build installer.
 04Sep06
 kes  Correct dvd code that breaks tape labeling.      
 kes  Implement Enabled on update slots.