]> git.sur5r.net Git - bacula/bacula/commitdiff
- Add M_ALERT class and put tape alerts into it.
authorKern Sibbald <kern@sibbald.com>
Thu, 4 Nov 2004 10:47:54 +0000 (10:47 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 4 Nov 2004 10:47:54 +0000 (10:47 +0000)
- Fix Verify count vs found by not double counting files
  that are split across files/Volumes.

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

bacula/kernstodo
bacula/src/dird/bsr.c
bacula/src/lib/message.h
bacula/src/lib/parse_conf.c
bacula/src/stored/acquire.c
bacula/src/version.h

index fd8678d6c92d2d1fb349c6d218edbc6729dd6e57..49a3d72ad836144283c6b8906e1285274037d4d4 100644 (file)
@@ -14,6 +14,9 @@ Version 1.35                Kern (see below)
   
 
 1.37 Items:
+- Look at correcting the time jump in the sceduler for daylight
+  savings time changes.
+- Add a "real" timer to network connections.
 - Tell the "restore" user when browsing is no longer possible.
 - Write non-optimized bsrs from the JobMedia and Media records,
   even after Files are pruned.
index 5f8db936adbdfc3dfa75c8158b466dfe9cf7e2b5..6e6e374c3f7e13fc5f33ed5a0a9021839c7490b8 100644 (file)
@@ -238,6 +238,8 @@ static uint32_t write_bsr(UAContext *ua, RBSR *bsr, FILE *fd)
 {
    uint32_t count = 0;
    uint32_t total_count = 0; 
+   uint32_t LastIndex = 0;
+   bool first = true;
    if (bsr) {
       /*
        * For a given volume, loop over all the JobMedia records.
@@ -273,6 +275,15 @@ static uint32_t write_bsr(UAContext *ua, RBSR *bsr, FILE *fd)
             fprintf(fd, "Count=%u\n", count);
         }
         total_count += count;
+        /* If the same file is present on two tapes or in two files
+         *   on a tape, it is a continuation, and should not be treated
+         *   twice in the totals.
+         */
+        if (!first && LastIndex == bsr->VolParams[i].FirstIndex) {
+           total_count--;
+        }
+        first = false;
+        LastIndex = bsr->VolParams[i].LastIndex;
       }
       write_bsr(ua, bsr->next, fd);
    }
index cf323dded37f58ed6d04d1f9ae7516cdea9f9b8c..5c70ec0266253228f3ee2f0c7b9bd43a9f9baf91 100644 (file)
@@ -37,6 +37,7 @@
 #undef  M_TERM
 #undef  M_RESTORED
 #undef  M_SECURITY
+#undef  M_ALERT
 
 /*
  * Most of these message levels are more or less obvious. 
@@ -65,6 +66,8 @@
  *  M_SECURITY    For security viloations. This is equivalent to FATAL.
  *                (note, this is currently being implemented in 1.33).
  *
+ *  M_ALERT       For Tape Alert messages.
+ *
  */
 
 enum {
@@ -82,10 +85,11 @@ enum {
    M_ERROR_TERM,                      /* Error termination request (no dump) */
    M_TERM,                            /* Terminating daemon normally */
    M_RESTORED,                        /* ls -l of restored files */
-   M_SECURITY                         /* security violation */
+   M_SECURITY,                        /* security violation */
+   M_ALERT                            /* tape alert messages */
 };
 
-#define M_MAX      M_SECURITY         /* keep this updated ! */
+#define M_MAX      M_ALERT            /* keep this updated ! */
 
 /* Define message destination structure */
 /* *** FIXME **** where should be extended to handle multiple values */
index 80686bbcfad810380e82f9d30505615b4b47a142..82e22502ee998d4b2b398dd1075ca0b093e11a15 100755 (executable)
@@ -126,6 +126,8 @@ static struct s_mtypes msg_types[] = {
    {"mount",         M_MOUNT},
    {"terminate",     M_TERM},
    {"restored",      M_RESTORED},
+   {"security",      M_SECURITY},
+   {"alert",         M_ALERT},
    {"all",           M_MAX+1},
    {NULL,           0}
 };
index a93290f043c40fe8aadb99d6adccab390a58bc6e..ab909549d46ff3f708c233e46641190dde8ec0d0 100644 (file)
@@ -435,7 +435,7 @@ bool release_device(JCR *jcr)
       bpipe = open_bpipe(alert, 0, "r");
       if (bpipe) {
         while (fgets(line, sizeof(line), bpipe->rfd)) {
-            Jmsg(jcr, M_INFO, 0, _("Alert: %s"), line);
+            Jmsg(jcr, M_ALERT, 0, _("Alert: %s"), line);
         }
         status = close_bpipe(bpipe);
       } else {
@@ -443,7 +443,7 @@ bool release_device(JCR *jcr)
       }
       if (status != 0) {
         berrno be;
-         Jmsg(jcr, M_INFO, 0, _("3997 Bad alert command: %s: ERR=%s.\n"),
+         Jmsg(jcr, M_ALERT, 0, _("3997 Bad alert command: %s: ERR=%s.\n"),
              alert, be.strerror(status));
       }
 
index 9ce60c8227c9465e7f0f87b4bb73d88326da6371..add5a7cf71d08f87927e8b3dda79eccf722949cc 100644 (file)
@@ -1,8 +1,8 @@
 /* */
 #undef  VERSION
 #define VERSION "1.37.1"
-#define BDATE   "30 October 2004"
-#define LSMDATE "30Oct04"
+#define BDATE   "04 November 2004"
+#define LSMDATE "04Nov04"
 
 /* Debug flags */
 #undef  DEBUG
@@ -10,7 +10,7 @@
 #define TRACEBACK 1
 #define SMCHECK     
 #define TRACE_FILE 1  
-/* #define DEVELOPER 1 */
+#define DEVELOPER 1
 
 
 /* Debug flags not normally turned on */