]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Eliminate some compile warnings in dird_conf.c
authorKern Sibbald <kern@sibbald.com>
Tue, 15 Aug 2006 13:51:22 +0000 (13:51 +0000)
committerKern Sibbald <kern@sibbald.com>
Tue, 15 Aug 2006 13:51:22 +0000 (13:51 +0000)
kes  Format the bytes field in the terminated jobs part of the status
     command for the three daemons with suffixes to reduce print size
     of backup bytes.  Suggested by a user.
kes  When not descending into a directory, print the File= name that
     triggered it -- makes why not descending a bit clearer.
kes  Do not unload autochanger when doing a list command -- basic code
     from Eric Bollengier.

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

13 files changed:
bacula/kernstodo
bacula/src/dird/dird_conf.c
bacula/src/dird/ua_status.c
bacula/src/filed/backup.c
bacula/src/filed/status.c
bacula/src/findlib/find.c
bacula/src/findlib/find.h
bacula/src/lib/bsock.h
bacula/src/stored/autochanger.c
bacula/src/stored/dircmd.c
bacula/src/stored/status.c
bacula/src/version.h
bacula/technotes-1.39

index 2603a3b290a348cc617515bbf5e666c0405f10ed..6258919c07cf9fddb45b6e2e5dcefadb746ebdf5 100644 (file)
@@ -27,10 +27,15 @@ Document:
 - Document JobStatus and Termination codes.
 - Fix the error with the "DVI file can't be opened" while
   building the French PDF.
+- Document more DVD stuff -- particularly that recycling doesn't work,
+  and all the other things too.
 
 Priority:
 
 For 1.39:
+- Change dbcheck to tell users to use native tools for fixing
+  broken databases, and to ensure they have the proper indexes.
+- add udev rules for Bacula devices.
 - Add manpages to the list of directories for make install.
 - If a job terminates, the DIR connection can close before the
   Volume info is updated, leaving the File count wrong.
index 325831dba4d91837a0ba9019d5ae1330bd0e4bac..8cbf3e3febe04abae04dcd152bc2b6b95e527729 100644 (file)
@@ -1680,13 +1680,13 @@ static void store_short_runscript(LEX *lc, RES_ITEM *item, int index, int pass)
  *   name             handler         value                                code flags default_value
  */
 static RES_ITEM runscript_items[] = {
-   {"command", store_runscript_cmd,    (char **)&res_runscript,           0,  ITEM_REQUIRED, 0}, 
-   {"target", store_runscript_target,  (char **)&res_runscript,            0,  0, 0}, 
-   {"runsonsuccess",    store_bool,    (char **)&res_runscript.on_success, 0,  0, 0},
-   {"runsonfailure",    store_bool,    (char **)&res_runscript.on_failure, 0,  0, 0},
-   {"abortjobonerror", store_bool,     (char **)&res_runscript.abort_on_error, 0, 0,   0},
-   {"runswhen", store_runscript_when,  (char **)&res_runscript.when,       0,  0, 0},
-   {"runsonclient", store_runscript_target,  (char **)&res_runscript,       0,  0, 0}, /* TODO */
+   {"command", store_runscript_cmd,    {(char **)&res_runscript},           0,  ITEM_REQUIRED, 0}, 
+   {"target", store_runscript_target,  {(char **)&res_runscript},            0,  0, 0}, 
+   {"runsonsuccess",    store_bool,    {(char **)&res_runscript.on_success}, 0,  0, 0},
+   {"runsonfailure",    store_bool,    {(char **)&res_runscript.on_failure}, 0,  0, 0},
+   {"abortjobonerror", store_bool,     {(char **)&res_runscript.abort_on_error}, 0, 0,   0},
+   {"runswhen", store_runscript_when,  {(char **)&res_runscript.when},       0,  0, 0},
+   {"runsonclient", store_runscript_target,  {(char **)&res_runscript},       0,  0, 0}, /* TODO */
    {NULL, NULL, {0}, 0, 0, 0}
 };
 
index 6ea1e34de78d9d54dcf544955bc70677ec7bc52f..596d7426591665766f02adf0d921f80c122728ff 100644 (file)
@@ -677,8 +677,8 @@ static void list_terminated_jobs(UAContext *ua)
    lock_last_jobs_list();
    struct s_last_job *je;
    bsendmsg(ua, _("\nTerminated Jobs:\n"));
-   bsendmsg(ua, _(" JobId  Level     Files      Bytes     Status   Finished        Name \n"));
-   bsendmsg(ua, _("========================================================================\n"));
+   bsendmsg(ua, _(" JobId  Level    Files      Bytes   Status   Finished        Name \n"));
+   bsendmsg(ua, _("====================================================================\n"));
    foreach_dlist(je, last_jobs) {
       char JobName[MAX_NAME_LENGTH];
       const char *termstat;
@@ -728,11 +728,11 @@ static void list_terminated_jobs(UAContext *ua)
          termstat = _("Other");
          break;
       }
-      bsendmsg(ua, _("%6d  %-6s %8s %14s %-7s  %-8s %s\n"),
+      bsendmsg(ua, _("%6d  %-6s %8s %10s  %-7s  %-8s %s\n"),
          je->JobId,
          level,
          edit_uint64_with_commas(je->JobFiles, b1),
-         edit_uint64_with_commas(je->JobBytes, b2),
+         edit_uint64_with_suffix(je->JobBytes, b2),
          termstat,
          dt, JobName);
    }
index e39454c3483d88e782ffd63a3687d7f6261f7477..282e2296a77afe2245f31321f5643335ddd9e1ad 100644 (file)
@@ -233,21 +233,21 @@ static int save_file(FF_PKT *ff_pkt, void *vjcr, bool top_level)
       jcr->num_files_examined--;      /* correct file count */
       return 1;                       /* not used */
    case FT_NORECURSE:
-     Jmsg(jcr, M_INFO, 1, _("     Recursion turned off. Will not descend into %s\n"),
-          ff_pkt->fname);
+      Jmsg(jcr, M_INFO, 1, _("     Recursion turned off. Will not descend from %s into %s\n"),
+           ff_pkt->top_fname, ff_pkt->fname);
       ff_pkt->type = FT_DIREND;       /* Backup only the directory entry */
       break;
    case FT_NOFSCHG:
       /* Suppress message for /dev filesystems */
       if (strncmp(ff_pkt->fname, "/dev/", 5) != 0) {
-         Jmsg(jcr, M_INFO, 1, _("     Filesystem change prohibited. Will not descend into %s\n"),
-            ff_pkt->fname);
+         Jmsg(jcr, M_INFO, 1, _("     Filesystem change prohibited. Will not descend from %s into %s\n"),
+              ff_pkt->top_fname, ff_pkt->fname);
       }
       ff_pkt->type = FT_DIREND;       /* Backup only the directory entry */
       break;
    case FT_INVALIDFS:
-      Jmsg(jcr, M_INFO, 1, _("     Disallowed filesystem. Will not descend into %s\n"),
-           ff_pkt->fname);
+      Jmsg(jcr, M_INFO, 1, _("     Disallowed filesystem. Will not descend from %s into %s\n"),
+           ff_pkt->top_fname, ff_pkt->fname);
       ff_pkt->type = FT_DIREND;       /* Backup only the directory entry */
       break;
    case FT_INVALIDDT:
index 302dd89567e5c79c7b7dd9cb37fedfd1d0b6503b..829757dcefad1ea67df3ba34edf24d078cd79221 100755 (executable)
@@ -208,7 +208,7 @@ static void  list_terminated_jobs(void sendit(const char *msg, int len, void *sa
    sendit("\n", 1, arg);               /* send separately */
    msg =  _("Terminated Jobs:\n");
    sendit(msg, strlen(msg), arg);
-   msg =  _(" JobId  Level     Files         Bytes  Status   Finished        Name \n");
+   msg =  _(" JobId  Level    Files      Bytes   Status   Finished        Name \n");
    sendit(msg, strlen(msg), arg);
    msg = _("======================================================================\n");
    sendit(msg, strlen(msg), arg);
@@ -257,11 +257,11 @@ static void  list_terminated_jobs(void sendit(const char *msg, int len, void *sa
             *p = 0;
          }
       }
-      bsnprintf(buf, sizeof(buf), _("%6d  %-6s %8s %14s %-7s  %-8s %s\n"),
+      bsnprintf(buf, sizeof(buf), _("%6d  %-6s %8s %10s  %-7s  %-8s %s\n"),
          je->JobId,
          level,
          edit_uint64_with_commas(je->JobFiles, b1),
-         edit_uint64_with_commas(je->JobBytes, b2),
+         edit_uint64_with_suffix(je->JobBytes, b2),
          termstat,
          dt, JobName);
       sendit(buf, strlen(buf), arg);
index c8e4e9aeede1c69da0b3a2f957aa3eddfdcd7fec..95ee92e1499b2530444903ca8401edc15df6fef7 100644 (file)
@@ -179,8 +179,8 @@ find_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt, bool t
          }
          for (j=0; j<incexe->name_list.size(); j++) {
             Dmsg1(100, "F %s\n", (char *)incexe->name_list.get(j));
-            char *fname = (char *)incexe->name_list.get(j);
-            if (find_one_file(jcr, ff, our_callback, his_pkt, fname, (dev_t)-1, true) == 0) {
+            ff->top_fname = (char *)incexe->name_list.get(j);
+            if (find_one_file(jcr, ff, our_callback, his_pkt, ff->top_fname, (dev_t)-1, true) == 0) {
                return 0;                  /* error return */
             }
          }
index 0217dfc988118faebd22864dd8e78d525d0b3d2e..e41fed6192b74278532237b78a58d5962c55e860 100755 (executable)
@@ -177,6 +177,7 @@ struct HFSPLUS_INFO {
  * first argument to the find_files callback subroutine.
  */
 struct FF_PKT {
+   char *top_fname;                   /* full filename before descending */
    char *fname;                       /* full filename */
    char *link;                        /* link if file linked */
    POOLMEM *sys_fname;                /* system filename */
index b04af0ffaf4d4605f1bae151bd21f9354501171a..4ca9fcff7a0cca3449e661e70739ebb166993a6a 100644 (file)
@@ -12,7 +12,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2005 Kern Sibbald
+   Copyright (C) 2000-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -87,4 +87,3 @@ enum {
 #define BNET_TLS_NONE     0           /* cannot do TLS */
 #define BNET_TLS_OK       1           /* can do, but not required on my end */
 #define BNET_TLS_REQUIRED 2           /* TLS is required */
-
index af5398944655b381eb289ba087a94c3b3c8a98d1..2db94094e48b3e8ba174cff961884c2d43092c77 100644 (file)
@@ -460,10 +460,6 @@ bool autochanger_cmd(DCR *dcr, BSOCK *dir, const char *cmd)
       return false;
    }
 
-   /* List command? */
-   if (strcmp(cmd, "list") == 0) {
-      unload_autochanger(dcr, -1);
-   }
    if (strcmp(cmd, "drives") == 0) {
       AUTOCHANGER *changer_res = dcr->device->changer_res;
       int drives = 1;
index c2a429378e441711a949fcb1e329a6cde61cee35..1243e24eea104b5dc2c3b4f7be2dd76d56e0041d 100644 (file)
@@ -857,10 +857,11 @@ static bool changer_cmd(JCR *jcr)
    DCR *dcr;
    const char *cmd = NULL;
    bool ok = false;
+   bool dolist = false;
 
    if (sscanf(dir->msg, "autochanger list %127s", devname.c_str()) == 1) {
       cmd = "list";
-      ok = true;
+      dolist = ok = true;
    } else if (sscanf(dir->msg, "autochanger slots %127s", devname.c_str()) == 1) {
       cmd = "slots";
       ok = true;
@@ -877,7 +878,7 @@ static bool changer_cmd(JCR *jcr)
             bnet_fsend(dir, _("3995 Device %s is not an autochanger.\n"), 
                dev->print_name());
          /* Under certain "safe" conditions, we can steal the lock */
-         } else if (!dev->is_open() || dev->can_steal_lock()) {
+         } else if (dolist || !dev->is_open() || dev->can_steal_lock()) {
             autochanger_cmd(dcr, dir, cmd);
          } else if (dev->is_busy() || dev->is_blocked()) {
             send_dir_busy_message(dir, dev);
index d483d41f456757a8e9ac2d651eee5184632ae3dc..b21d277911d1ddc8ebd1a47bd092e45b80832af4 100644 (file)
@@ -207,6 +207,7 @@ static void send_blocked_status(DEVICE *dev, void sendit(const char *msg, int le
    if (!dev) {
       len = Mmsg(msg, _("No DEVICE structure.\n\n"));
       sendit(msg, len, arg);
+      free_pool_memory(msg);
       return;
    }
    switch (dev->dev_blocked) {
@@ -452,9 +453,9 @@ static void list_terminated_jobs(void sendit(const char *msg, int len, void *sar
    lock_last_jobs_list();
    msg =  _("\nTerminated Jobs:\n");
    sendit(msg, strlen(msg), arg);
-   msg =  _(" JobId  Level   Files          Bytes Status   Finished        Name \n");
+   msg =  _(" JobId  Level    Files      Bytes   Status   Finished        Name \n");
    sendit(msg, strlen(msg), arg);
-   msg = _("======================================================================\n");
+   msg =  _("===================================================================\n");
    sendit(msg, strlen(msg), arg);
    foreach_dlist(je, last_jobs) {
       char JobName[MAX_NAME_LENGTH];
@@ -501,11 +502,11 @@ static void list_terminated_jobs(void sendit(const char *msg, int len, void *sar
             *p = 0;
          }
       }
-      bsnprintf(buf, sizeof(buf), _("%6d  %-6s %8s %14s %-7s  %-8s %s\n"),
+      bsnprintf(buf, sizeof(buf), _("%6d  %-6s %8s %10s  %-7s  %-8s %s\n"),
          je->JobId,
          level,
          edit_uint64_with_commas(je->JobFiles, b1),
-         edit_uint64_with_commas(je->JobBytes, b2),
+         edit_uint64_with_suffix(je->JobBytes, b2),
          termstat,
          dt, JobName);
       sendit(buf, strlen(buf), arg);
index 1acb70209a934dd18bddb8dd6c7121f2b14dec3d..e29b19d39e7a6c9ce871177b3bda9ac6359142e4 100644 (file)
@@ -4,8 +4,8 @@
 
 #undef  VERSION
 #define VERSION "1.39.19"
-#define BDATE   "07 August 2006"
-#define LSMDATE "07Aug06"
+#define BDATE   "15 August 2006"
+#define LSMDATE "15Aug06"
 #define BYEAR "2006"       /* year for copyright messages in progs */
 
 /* Debug flags */
index 7d4021b3c9497f9b0fe4506870e9c4e1bdf347a4..a81bb4f30b0a3b4bbfdaa414a80bec09e533f789 100644 (file)
@@ -1,7 +1,16 @@
               Technical notes on version 1.39  
 
 General:
-07Aug06
+15Aug06
+kes  Eliminate some compile warnings in dird_conf.c
+kes  Format the bytes field in the terminated jobs part of the status
+     command for the three daemons with suffixes to reduce print size 
+     of backup bytes.  Suggested by a user.
+kes  When not descending into a directory, print the File= name that
+     triggered it -- makes why not descending a bit clearer.
+kes  Do not unload autochanger when doing a list command -- basic code
+     from Eric Bollengier.
+07Aug06                
 kes  Fix bug #462 incorrect error message printed when client script called
      from File= was not found.
 kes  Fix bug #558 (waiting for feedback) where Bacula needs too much time to