]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/dird_conf.c
kes Extend new GUI api code to tree commands.
[bacula/bacula] / bacula / src / dird / dird_conf.c
index b32c4122080c14b203945d1e665ed1c16fb8376d..e1b534415a6e1f27d4782ccc8919d6be20c694a0 100644 (file)
@@ -1,30 +1,7 @@
-/*
- *   Main configuration file parser for Bacula Directors,
- *    some parts may be split into separate files such as
- *    the schedule configuration (run_config.c).
- *
- *   Note, the configuration file parser consists of three parts
- *
- *   1. The generic lexical scanner in lib/lex.c and lib/lex.h
- *
- *   2. The generic config  scanner in lib/parse_config.c and
- *      lib/parse_config.h.
- *      These files contain the parser code, some utility
- *      routines, and the common store routines (name, int,
- *      string).
- *
- *   3. The daemon specific file, which contains the Resource
- *      definitions as well as any specific store routines
- *      for the resource records.
- *
- *     Kern Sibbald, January MM
- *
- *     Version $Id$
- */
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ *   Main configuration file parser for Bacula Directors,
+ *    some parts may be split into separate files such as
+ *    the schedule configuration (run_config.c).
+ *
+ *   Note, the configuration file parser consists of three parts
+ *
+ *   1. The generic lexical scanner in lib/lex.c and lib/lex.h
+ *
+ *   2. The generic config  scanner in lib/parse_config.c and
+ *      lib/parse_config.h.
+ *      These files contain the parser code, some utility
+ *      routines, and the common store routines (name, int,
+ *      string).
+ *
+ *   3. The daemon specific file, which contains the Resource
+ *      definitions as well as any specific store routines
+ *      for the resource records.
+ *
+ *     Kern Sibbald, January MM
+ *
+ *     Version $Id$
+ */
+
 
 #include "bacula.h"
 #include "dird.h"
@@ -361,6 +362,7 @@ static RES_ITEM pool_items[] = {
    {"storage",       store_alist_res, ITEM(res_pool.storage),  R_STORAGE, 0, 0},
    {"autoprune",       store_bool,    ITEM(res_pool.AutoPrune), 0, ITEM_DEFAULT, true},
    {"recycle",         store_bool,    ITEM(res_pool.Recycle),   0, ITEM_DEFAULT, true},
+   {"recyclepool",     store_res,     ITEM(res_pool.RecyclePool), R_POOL, 0, 0},
    {NULL, NULL, {0}, 0, 0, 0}
 };
 
@@ -853,8 +855,10 @@ next_run:
               edit_uint64(res->res_pool.MigrationHighBytes, ed2),
               edit_uint64(res->res_pool.MigrationLowBytes, ed3));
       if (res->res_pool.NextPool) {
-         sendit(sock, _("  --> "));
-         dump_resource(-R_POOL, (RES *)res->res_pool.NextPool, sendit, sock);
+         sendit(sock, _("      NextPool=%s\n"), res->res_pool.NextPool->name());
+      }
+      if (res->res_pool.RecyclePool) {
+         sendit(sock, _("      RecyclePool=%s\n"), res->res_pool.RecyclePool->name());
       }
       if (res->res_pool.storage) {
          STORE *store;
@@ -1245,6 +1249,7 @@ void save_resource(int type, RES_ITEM *items, int pass)
          }
          /* Explicitly copy resource pointers from this pass (res_all) */
          res->res_pool.NextPool = res_all.res_pool.NextPool;
+         res->res_pool.RecyclePool = res_all.res_pool.RecyclePool;
          res->res_pool.storage    = res_all.res_pool.storage;
          break;
       case R_CONSOLE:
@@ -1608,9 +1613,9 @@ static void store_runscript_target(LEX *lc, RES_ITEM *item, int index, int pass)
    if (pass == 2) {
       if (strcmp(lc->str, "%c") == 0) {
          ((RUNSCRIPT*) item->value)->set_target(lc->str);
-      } else if (strcmp(lc->str, "yes") == 0) {
+      } else if (strcasecmp(lc->str, "yes") == 0) {
          ((RUNSCRIPT*) item->value)->set_target("%c");
-      } else if (strcmp(lc->str, "no") == 0) {
+      } else if (strcasecmp(lc->str, "no") == 0) {
          ((RUNSCRIPT*) item->value)->set_target("");
       } else {
          RES *res = GetResWithName(R_CLIENT, lc->str);