]> git.sur5r.net Git - bacula/bacula/commitdiff
Add stats to bscan
authorKern Sibbald <kern@sibbald.com>
Fri, 16 Apr 2004 19:07:48 +0000 (19:07 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 16 Apr 2004 19:07:48 +0000 (19:07 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1217 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/ChangeLog
bacula/ReleaseNotes
bacula/src/dird/backup.c
bacula/src/lib/jcr.c
bacula/src/stored/bscan.c
bacula/src/tools/bsmtp.c
bacula/src/version.h

index b6b338a6ab60b0e085654422f87e591d56c6c055..54906ff1222d5343de85cc15d06ca669d8ea5f4f 100644 (file)
@@ -1,4 +1,13 @@
 
+16Apr04
+- Modify bscan to print some elementary statistics (#Jobs, #Files, ...)
+  added to catalog.
+15Apr04
+- Added --enable-wx-console and updated Makefile.in
+- Fix mtx-changer so that the calling sequence is compatible
+  with the previous version (the new one required arguments that
+  were not necessarily used).
+- Document how to use stunnel with Bacula.
 13Apr04
 - Fix crash in query command.
 - Remove schedule from the default restore job.
index 807e8fd718d9b092e01423ff8e9af8c83e854c61..c7191140ccba947665e027b6f1ce96224e77c3bd 100644 (file)
@@ -7,6 +7,15 @@ Changes for 1.34.1:
 - Autochanger users, please note you must add %d to the end of the
   changer command line in your Device resource in your bacula-sd.conf
   file.
+- Modify bscan to print some elementary statistics (#Jobs, #Files, ...)
+  added to catalog.
+- Added --enable-wx-console and updated Makefile.in
+- Fix mtx-changer so that the calling sequence is compatible
+  with the previous version (the new one required arguments that
+  were not necessarily used).
+- Document how to use stunnel with Bacula.
+- Fix crash in query command.
+- Remove schedule from the default restore job.
 - Fix data spooler to use min/max tape blocking factors.
 - Automatically turn of conio if library not found instead of bombing.
 - Cleaned up a lot of copyright dates.
index a2773826e2a159c655bdeed5e381da094712b83a..16f75993a0334b36e2142effaded0fbce1f2af6e 100644 (file)
@@ -395,7 +395,11 @@ static void backup_cleanup(JCR *jcr, int TermCode, char *since, FILESET_DBR *fsr
    msg_type = M_INFO;                /* by default INFO message */
    switch (jcr->JobStatus) {
       case JS_Terminated:
-         term_msg = _("Backup OK");
+        if (jcr->Errors || jcr->SDErrors) {
+            term_msg = _("Backup OK with warnings");
+        } else {
+            term_msg = _("Backup OK");
+        }
         break;
       case JS_FatalError:
       case JS_ErrorTerminated:
index 86113f3375c4ecbfcebbd6cbe9b85b7564b52a4d..2b10d6b936fa47b4bdabbb1e9b65c63e548c7440 100755 (executable)
@@ -201,7 +201,7 @@ JCR *new_jcr(int size, JCR_free_HANDLER *daemon_free_jcr)
    /* Setup some dummy values */
    jcr->Job[0] = 0;                  /* no job name by default */
    jcr->JobId = 0;
-   jcr->JobType = JT_ADMIN;
+   jcr->JobType = JT_SYSTEM;         /* internal job until defined */
    jcr->JobLevel = L_NONE;
    jcr->JobStatus = JS_Created;
 
index 0988a292e7a565ab905c3a232d78c2a614c93317..059cf0f8542eccab3065683d124192f35589781f 100644 (file)
@@ -90,6 +90,11 @@ static int update_vol_info = 0;
 static int list_records = 0;
 static int ignored_msgs = 0;
 
+static int num_jobs = 0;
+static int num_pools = 0;
+static int num_media = 0;
+static int num_files = 0;
+
 #define CONFIG_FILE "bacula-sd.conf"
 char *configfile;
 bool forge_on = false;
@@ -256,6 +261,8 @@ int main (int argc, char *argv[])
    }
 
    do_scan();
+   printf("Records added to catalog:\n%7d Media\n%7d Pool\n%7d Job\n%7d File\n",
+      num_media, num_pools, num_jobs, num_files);
 
    free_jcr(bjcr);
    return 0;
@@ -352,6 +359,7 @@ static int record_cb(JCR *bjcr, DEVICE *dev, DEV_BLOCK *block, DEV_RECORD *rec)
         /* Check Pool info */
         bstrncpy(pr.Name, dev->VolHdr.PoolName, sizeof(pr.Name));
         bstrncpy(pr.PoolType, dev->VolHdr.PoolType, sizeof(pr.PoolType));
+        num_pools++;
         if (db_get_pool_record(bjcr, db, &pr)) {
            if (verbose) {
                Pmsg1(000, _("Pool record for %s found in DB.\n"), pr.Name);
@@ -375,6 +383,7 @@ static int record_cb(JCR *bjcr, DEVICE *dev, DEV_BLOCK *block, DEV_RECORD *rec)
         memset(&mr, 0, sizeof(mr));
         bstrncpy(mr.VolumeName, dev->VolHdr.VolName, sizeof(mr.VolumeName));
         mr.PoolId = pr.PoolId;
+        num_media++;
         if (db_get_media_record(bjcr, db, &mr)) {
            if (verbose) {
                Pmsg1(000, _("Media record for %s found in DB.\n"), mr.VolumeName);
@@ -410,6 +419,7 @@ static int record_cb(JCR *bjcr, DEVICE *dev, DEV_BLOCK *block, DEV_RECORD *rec)
 
       case SOS_LABEL:
         mr.VolJobs++;
+        num_jobs++;
         if (ignored_msgs > 0) {
             Pmsg1(000, _("%d \"errors\" ignored before first Start of Session record.\n"), 
                  ignored_msgs);
@@ -589,6 +599,7 @@ static int record_cb(JCR *bjcr, DEVICE *dev, DEV_BLOCK *block, DEV_RECORD *rec)
       }
       fr.JobId = mjcr->JobId;
       fr.FileId = 0;
+      num_files++;
       if (db_get_file_attributes_record(bjcr, db, attr->fname, NULL, &fr)) {
         if (verbose > 1) {
             Pmsg1(000, _("File record already exists for: %s\n"), attr->fname);
index 4df5776f8e444164d7667a54803865236a6fc6c7..1b4fbdc970270cc16a10bc514ce7722137cb87c4 100644 (file)
     
  */
 
+#ifdef APCUPSD
+
+#include "apc.h"
+#undef main
+#define my_name_is(x)
+#define bstrdup(x) strdup(x)
+UPSINFO myUPS;
+UPSINFO *core_ups = &myUPS;
+#define MY_NAME "smtp"
+
+#else
+
 #include "bacula.h"
 #include "jcr.h"
+#define MY_NAME "bsmtp"
+
+#endif
+
 
 #ifndef MAXSTRING
 #define MAXSTRING 254
@@ -102,14 +118,14 @@ static void usage()
 {
    fprintf(stderr,
 "\n"
-"Usage: bsmtp [-f from] [-h mailhost] [-s subject] [-c copy] [recepient ...]\n"
+"Usage: %s [-f from] [-h mailhost] [-s subject] [-c copy] [recepient ...]\n"
 "       -c          set the Cc: field\n"
 "       -dnn        set debug level to nn\n"
 "       -f          set the From: field\n"
 "       -h          use mailhost:port as the SMTP server\n"
 "       -s          set the Subject: field\n"
 "       -?          print this message.\n"  
-"\n");
+"\n", MY_NAME);
 
    exit(1);
 }
index 60c5623f9807bff8e750bc8c38a1270dd86073d6..b5e80cb33cfa98aefd98b636aa0bf860f5bbe3af 100644 (file)
@@ -2,8 +2,8 @@
 #undef  VERSION
 #define VERSION "1.35.0"
 #define VSTRING "1"
-#define BDATE   "15 Apr 2004"
-#define LSMDATE "15Apr04"
+#define BDATE   "16 Apr 2004"
+#define LSMDATE "16Apr04"
 
 /* Debug flags */
 #undef  DEBUG