]> git.sur5r.net Git - bacula/bacula/commitdiff
Misc
authorKern Sibbald <kern@sibbald.com>
Wed, 28 Apr 2004 13:11:02 +0000 (13:11 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 28 Apr 2004 13:11:02 +0000 (13:11 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1319 91ce42f0-d328-0410-95d8-f526ca767f89

13 files changed:
bacula/autoconf/aclocal.m4
bacula/autoconf/config.h.in
bacula/autoconf/configure.in
bacula/configure
bacula/kernstodo
bacula/scripts/mtx-changer.in
bacula/src/baconfig.h
bacula/src/bacula.h
bacula/src/dird/dird_conf.c
bacula/src/dird/fd_cmds.c
bacula/src/dird/inc_conf.c
bacula/src/version.h
bacula/src/win32/compat/winconfig.h

index 0ad0a8affb674a528ea2d54930fa56c2a84258be..f144d6219033412e96fb5efccc20f87ffdfd05c3 100644 (file)
@@ -568,6 +568,10 @@ AC_ARG_WITH(postgresql,
               POSTGRESQL_INCDIR=/usr/include/pgsql
               POSTGRESQL_LIBDIR=/usr/lib/pgsql
               POSTGRESQL_BINDIR=/usr/bin
+          elif test -f /usr/include/postgresql/libpq-fe.h; then
+              POSTGRESQL_INCDIR=/usr/include/postgresql
+              POSTGRESQL_LIBDIR=/usr/lib/postgresql
+              POSTGRESQL_BINDIR=/usr/bin
           else
               AC_MSG_RESULT(no)
               AC_MSG_ERROR(Unable to find libpq-fe.h in standard locations)
index 58ddd8e8bfb7178372600b16b941b4dd48a09c53..db298b00848a4067cf4a2c5fee90a5aae94cf924 100644 (file)
 /* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
 #undef HAVE_NDIR_H
 
+/* Define to 1 if you have the `nl_langinfo' function. */
+#undef HAVE_NL_LANGINFO
+
 /* Define to 1 if you have the `putenv' function. */
 #undef HAVE_PUTENV
 
index dde544c6330132377b73ac2ddd92b91f863d1394..26e4aaa98fb5f11fcda4f83963128942bc21f5b8 100644 (file)
@@ -454,7 +454,7 @@ AC_HEADER_STAT
 AC_HEADER_DIRENT
 
 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat lchown)
-AC_CHECK_FUNCS(nanosleep)
+AC_CHECK_FUNCS(nanosleep nl_langinfo)
 
 AC_CHECK_HEADERS(varargs.h)
 
index 92517a105a63084fc036c77c464c67f47f73c6c1..224466aa72aa62b5d72b6c999f983d796130e76c 100755 (executable)
@@ -6352,7 +6352,8 @@ fi
 done
 
 
-for ac_func in nanosleep
+
+for ac_func in nanosleep nl_langinfo
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -7187,6 +7188,10 @@ echo "$as_me: error: \"You can configure for only one database.\"" >&2;}
               POSTGRESQL_INCDIR=/usr/include/pgsql
               POSTGRESQL_LIBDIR=/usr/lib/pgsql
               POSTGRESQL_BINDIR=/usr/bin
+          elif test -f /usr/include/postgresql/libpq-fe.h; then
+              POSTGRESQL_INCDIR=/usr/include/postgresql
+              POSTGRESQL_LIBDIR=/usr/lib/postgresql
+              POSTGRESQL_BINDIR=/usr/bin
           else
               echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
index 50c1a46713f3fad70344eec9eb6b374426a33fbc..c5b4b497be9316ec9658fc43afe537dea0b672cb 100644 (file)
@@ -43,6 +43,7 @@ For 1.33 Testing/Documentation:
 
 
 For version 1.35:
+- Add check for tape alerts.
 - Add a "base" package to the window installer for pthreadsVCE.dll
   which is needed by all packages.
 - Add message to user to check for fixed block size when the forward
@@ -698,37 +699,6 @@ Ideas from Jerry Scharf:
   > woorkstations to be shut down overnight to save power.
   > 
 
-- From Terry Manderson <terry@apnic.net>
-   jobdefs { # new structure
-     name = "monthlyUnixBoxen"
-     type = backup
-     level = full
-     schedule = monthly
-     storage = DLT
-     messages = Standard
-     pool = MonthlyPool
-     priority = 10
-   }
-
-   job {
-     name = "wakame"
-     jobdefs = "genericUnixSet"
-     client = wakame-fd
-   }
-
-   job {
-     name = "durian"
-     jobdefs = "genericUnixSet"
-     client = durian-fd
-   }
-
-   job {
-     name = "soy"
-     jobdefs = "UnixDevelBoxSet"
-     client = soy-fd
-   }
-
-
 - Autolabel should be specified by DIR instead of SD.
 - Storage daemon    
   - Add media capacity
@@ -877,56 +847,56 @@ Need:
   VolSessionId and VolSessionTime.
 =========================================================  
 
-  
-
 =============================================================
 
-          Request For Comments For File Backup Options
-                   10 November 2002
+              File Backup Options Project
+                  28 April 2004
+
 
 Subject: File Backup Options
 
 Problem: 
-  A few days ago, a Bacula user who is backing up to file volumes and
-  using compression asked if it was possible to suppress compressing
-  all .gz files since it was a waste of CPU time. Although Bacula
-  currently permits using different options (compression, ...) on
-  a directory by directory basis, it cannot do it on a file by 
-  file basis, which is clearly what was desired.   
+  Bacula users who are using compression would like to suppress
+  compressing all .gz files since it was a waste of CPU time.
+  Although Bacula currently permits using different options
+  (compression, ...) on a directory by directory basis, it cannot
+  do it on a file by file basis, which is clearly what was
+  desired.
 
 Proposed Implementation:
   To solve this problem, I propose the following:
 
   - Add a new Director resource type called Options.  
 
-  - The Options resource will have records for all
-    options that can currently be specified on the Include record 
-    (in a FileSet).  Examples below.
+  - The Options resource will have records for all options that
+    can currently be specified on the Include record (in a
+    FileSet).  Examples below.
 
   - The Options resource will permit an exclude option as well
     as a number of additional options.
 
-  - The heart of the Options resource is the ability to
-    supply any number of Match records which specify POSIX
-    regular expressions.  These Match regular expressions are
-    applied to the fully qualified filename (path and all). If
-    one matches, then the Options will be used.
+  - The heart of the Options resource is the ability to supply
+    any number of Regex records which specify POSIX regular
+    expressions.  These regular expressions are applied to the
+    fully qualified filename (path and all).  If one matches,
+    then the Options will be used.
 
-  - When an Match specification matches an included file, the
-    options specified in the Options resource will override
-    the default options specified on the Include record.
+  - When a Regex specification matches an included file, the
+    options specified in the Options resource will override the
+    default options specified on the Include record.
 
   - Include records will be modified to permit referencing one or
-    more Options resources.  The Options will be used
-    in the order listed on the Include record and the first
-    one that matches will be applied.
+    more Options resources.  The Options will be used in the
+    order listed on the Include record and the first one that
+    matches will be applied.
 
   - Options (or specifications) currently supplied on the Include
-    record will be deprecated (i.e. removed in a later version a
+    record will be deprecated (i.e.  removed in a later version a
     year or so from now).
 
   - The Exclude record will be deprecated as the same functionality
-    can be obtained by using an Exclude = yes in the Options.
+    can be obtained by using an Exclude = yes in the Options or
+    an Exclude = xxxx directive.
 
 Options records:
   The following records can appear in the Options resource. An
@@ -944,12 +914,10 @@ Options records:
     - Recurse=    (yes/no)    - recurse into subdirectories
     - Sparse=     (yes/no)    - do sparse file backup
     - *Exclude=   (yes/no)    - exclude file from being saved
+    - *INclude=   (yes/no)    - include the file (needed??)
     - *Reader=    (filename)  - external read (backup) program
     - *Plugin=    (filename)  - read/write plugin module
 
-    - Include=    (yes/no)    - Include the file matched no additional
-                                patterns are applied.
-
   For Verify Jobs:
     - verify=     (ipnougsamc5) - verify options
 
@@ -960,14 +928,15 @@ Options records:
 
 
 Implementation:
-  Currently options specifying compression, MD5 signatures, recursion,
-  ... of a FileSet are supplied on the Include record. These will now
-  all be collected into a Options resource, which will be
-  specified in the Include in place of the options. Multiple Options
-  may be specified.  Since the Options may contain regular expressions
-  that are applied to the full filename, this will give the ability
-  to specify backup options on a file by file basis to whatever level
-  of detail you wish.
+  Currently options specifying compression, MD5 signatures,
+  recursion, ...  of a FileSet are supplied on the Include
+  record.  These will now all be collected into a Options
+  resource, which will be specified in the Include in place of
+  the options.  Multiple Options may be specified.  Since the
+  Options may contain regular expressions that are applied to the
+  full filename, this will give the ability to specify backup
+  options on a file by file basis to whatever level of detail you
+  wish.
 
 Example:
 
@@ -985,10 +954,12 @@ Example:
     FileSet {
       Name = "FullSet"
       Include {
-        Compression = GZIP;
-        Signature = MD5
-        Wild  = /*.?*/                # matches all files.
-        File = /
+        Options {
+          Compression = GZIP;
+          Signature = MD5
+          Wild  = /*.?*/                # matches all files.
+        }
+        Include = /
       }
     }
 
@@ -997,8 +968,8 @@ Example:
   want to compress all files but not any file with extensions .gz or .Z.
   In that case, you will need to group two sets of options using
   the Options resource. Files may be anywhere except in an
-  option set???  All OptionSets apply to all files in the order
-  the OptionSets were specified.  To have files included with
+  option set ???  All Options apply to all files in the order
+  the Options were specified.  To have files included with
   different option sets without using wild-cards, use two or more
   Includes -- each one is handled in turn using only the files and
   optionsets specified in the include.
@@ -1006,18 +977,18 @@ Example:
     FileSet {
       Name = "FullSet"
       Include {
-        OptionSet {
+        Options {
           Signature = MD5
           # Note multiple Matches are ORed
           Wild  = "*.gz"   # matches .gz files
           Wild  = "*.Z"    # matches .Z files
         }
-        OptionSet {
+        Options {
           Compression = GZIP
           Signature = MD5
           Wild  = "*.?*"   # matches all files
         }
-        File = /
+        Include = /
       }
     }
 
@@ -1028,18 +999,6 @@ Example:
   compression.
 
 Questions:
-  - Is it necessary to provide some means of ANDing regular expressions
-    and negation?  (not currently planned)
-
-    e.g.  Wild  = /*.gz/ && !/big.gz/
-
-  - I see that Networker has a "null" module which, if specified, does not 
-    backup the file, but does make an record of the file in the catalog
-    so that the catalog will reflect an exact picture of the filesystem.
-    The result is that the file can be "seen" when "browsing" the save
-    sets, but it cannot be restored.
-    
-    Is this really useful?  Should it be implemented in Bacula?
   
 Results:
   After implementing the above, the user will be able to specify
@@ -1049,6 +1008,7 @@ Results:
 
 =============================================
 
+
 ========================================================== 
     Unsaved File design
 For each Incremental job that is run, there may be files that
index 3e59e869079d46b7092d4f32fe410819c15d9ec9..17e57ec3aed923cb8c3008666ba10ab3fad35b8f 100644 (file)
@@ -96,7 +96,7 @@ case $cmd in
 
    list) 
 #     echo "Requested list"
-      ${MTX} -f $ctl status | grep " *Storage Element [0-9]*:.*Full" | awk "{print \$slot \$device}" | sed "s/Full *\(:VolumeTag=\)*//"
+      ${MTX} -f $ctl status | grep " *Storage Element [0-9]*:.*Full" | awk "{print \$3 \$4}" | sed "s/Full *\(:VolumeTag=\)*//"
       ;;
 
    loaded)
@@ -110,6 +110,6 @@ case $cmd in
 
    slots)
 #     echo "Request slots"
-      ${MTX} -f $ctl status | grep " *Storage Changer" | awk "{print \$drive}"
+      ${MTX} -f $ctl status | grep " *Storage Changer" | awk "{print \$5}"
       ;;
 esac
index 8aacd9c478f7ab88110e900afffd2de31d982c96..e1155c2d2a5023a38624314ef625b88136ef2a36 100644 (file)
@@ -487,4 +487,15 @@ extern "C" int getdomainname(char *name, int len);
 #define REPLACE_NEVER    'n'
 #define REPLACE_IFOLDER  'o'
 
+#ifdef HAVE_SETLOCALE
+#include <locale.h>
+#else
+#define setlocale(x, y) ("ANSI_X3.4-1968")
+#endif
+#ifdef HAVE_NL_LANGINFO
+#include <langinfo.h>
+#else 
+#define nl_langinfo(x) ("ANSI_X3.4-1968")
+#endif
+
 #endif /* _BACONFIG_H */
index 35f3c07ea18e1300afaa28da89de69514e65422f..54c355f42e7d95bb6d26e776a11592a89d1b556d 100644 (file)
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <pthread.h>
-     
+
 /* Local Bacula includes. Be sure to put all the system
  *  includes before these.  
  */
index 047f106e2d400c891401703867aa95704464604c..d28007fa0c324c34852cbbf1d54207774ea65a09 100644 (file)
@@ -561,20 +561,38 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, char *fmt, ...
       }
       break;
    case R_FILESET:
+   {
+      int i, j, k;
       sendit(sock, "FileSet: name=%s\n", res->res_fs.hdr.name);
-      for (int i=0; i<res->res_fs.num_includes; i++) {
+      for (i=0; i<res->res_fs.num_includes; i++) {
         INCEXE *incexe = res->res_fs.include_items[i];
-        for (int j=0; j<incexe->name_list.size(); j++) {
-            sendit(sock, "      Inc: %s\n", incexe->name_list.get(j));
+        for (j=0; j<incexe->num_opts; j++) {
+           FOPTS *fo = incexe->opts_list[j];
+            sendit(sock, "      O %s\n", fo->opts);
+           for (k=0; k<fo->match.size(); k++) {
+               sendit(sock, "      W %s\n", fo->match.get(j));
+           }
+            sendit(sock, "      N\n");
+        }
+        for (j=0; j<incexe->name_list.size(); j++) {
+            sendit(sock, "      I %s\n", incexe->name_list.get(j));
+        }
+        if (incexe->name_list.size()) {
+            sendit(sock, "      N\n");
         }
       }
-      for (int i=0; i<res->res_fs.num_excludes; i++) {
+        
+      for (i=0; i<res->res_fs.num_excludes; i++) {
         INCEXE *incexe = res->res_fs.exclude_items[i];
-        for (int j=0; j<incexe->name_list.size(); j++) {
-            sendit(sock, "      Exc: %s\n", incexe->name_list.get(j));
+        for (j=0; j<incexe->name_list.size(); j++) {
+            sendit(sock, "      E %s\n", incexe->name_list.get(j));
+        }
+        if (incexe->name_list.size()) {
+            sendit(sock, "      N\n");
         }
       }
       break;
+   }
    case R_SCHEDULE:
       if (res->res_sch.run) {
         int i;
index b3b6f3d7606ce64980536de74f10a73776655ba8..2432151218e761d8318f664e606a2d979280f396 100644 (file)
@@ -245,9 +245,11 @@ static int send_list(JCR *jcr, int list)
       } else {
         ie = fileset->exclude_items[i];
       }
-      fo = ie->opts_list[0];
-      for (int j=0; j<fo->match.size(); j++) {
-         Dmsg1(100, "Match=%s\n", fo->match.get(j));
+      if (ie->num_opts) {
+        fo = ie->opts_list[0];
+        for (int j=0; j<fo->match.size(); j++) {
+            Dmsg1(100, "Match=%s\n", fo->match.get(j));
+        }
       }
       for (int j=0; j<ie->name_list.size(); j++) {
         p = (char *)ie->name_list.get(j);
@@ -313,8 +315,8 @@ static int send_list(JCR *jcr, int list)
             p++;                      /* skip over \ */
            /* Note, fall through wanted */
         default:
-            Dmsg2(100, "numopts=%d opts=%s\n", ie->num_opts, NPRT(ie->opts_list[0]->opts));
            if (ie->num_opts) {
+               Dmsg2(100, "numopts=%d opts=%s\n", ie->num_opts, NPRT(ie->opts_list[0]->opts));
               pm_strcpy(&fd->msg, ie->opts_list[0]->opts);
                pm_strcat(&fd->msg, " ");
            } else {
index 2488e67984a4259dccf7dc05398f30546f24a055..2c1413217ef0673124b582fbbf8ae7ec47164b47 100644 (file)
@@ -37,6 +37,7 @@ static void store_newinc(LEX *lc, RES_ITEM *item, int index, int pass);
 static void store_match(LEX *lc, RES_ITEM *item, int index, int pass);
 static void store_opts(LEX *lc, RES_ITEM *item, int index, int pass);
 static void store_fname(LEX *lc, RES_ITEM *item, int index, int pass);
+static void options_res(LEX *lc, RES_ITEM *item, int index, int pass);
 static void store_base(LEX *lc, RES_ITEM *item, int index, int pass);
 static void setup_current_opts(void);
 
@@ -54,9 +55,18 @@ static INCEXE res_incexe;
 
 /* 
  * new Include/Exclude items
- *   name            handler     value                        code flags default_value
+ *   name            handler     value    code flags default_value
  */
 static RES_ITEM newinc_items[] = {
+   {"file",            store_fname,   NULL,     0, 0, 0},
+   {"options",         options_res,   NULL,     0, 0, 0},
+   {NULL, NULL, NULL, 0, 0, 0} 
+};
+
+/*
+ * Items that are valid in an Options resource
+ */
+static RES_ITEM options_items[] = {
    {"compression",     store_opts,    NULL,     0, 0, 0},
    {"signature",       store_opts,    NULL,     0, 0, 0},
    {"verify",          store_opts,    NULL,     0, 0, 0},
@@ -67,11 +77,11 @@ static RES_ITEM newinc_items[] = {
    {"replace",         store_opts,    NULL,     0, 0, 0},
    {"portable",        store_opts,    NULL,     0, 0, 0},
    {"match",           store_match,   NULL,     0, 0, 0},
-   {"file",            store_fname,   NULL,     0, 0, 0},
    {"base",            store_base,    NULL,     0, 0, 0},
    {NULL, NULL, NULL, 0, 0, 0} 
 };
 
+
 /* Define FileSet KeyWord values */
 
 #define INC_KW_NONE        0
@@ -162,6 +172,7 @@ static struct s_fs_opt FS_options[] = {
  * Scan for right hand side of Include options (keyword=option) is 
  *    converted into one or two characters. Verifyopts=xxxx is Vxxxx:
  *    Whatever is found is concatenated to the opts string.
+ * This code is also used inside an Options resource.
  */
 static void scan_include_options(LEX *lc, int keyword, char *opts, int optlen)
 {
@@ -205,7 +216,10 @@ static void scan_include_options(LEX *lc, int keyword, char *opts, int optlen)
    }
 }
 
-/* Store FileSet Include/Exclude info */
+/* 
+ * 
+ * Store FileSet Include/Exclude info  
+ */
 void store_inc(LEX *lc, RES_ITEM *item, int index, int pass)
 {
    int token, i;
@@ -342,6 +356,7 @@ static void store_newinc(LEX *lc, RES_ITEM *item, int index, int pass)
 {
    int token, i;
    INCEXE *incexe;
+   bool options;  
 
    if (!res_all.res_fs.have_MD5) {
       MD5Init(&res_all.res_fs.md5c);
@@ -360,10 +375,13 @@ static void store_newinc(LEX *lc, RES_ITEM *item, int index, int pass)
          scan_err1(lc, _("Expecting keyword, got: %s\n"), lc->str);
       }
       for (i=0; newinc_items[i].name; i++) {
+         options = strcasecmp(lc->str, "options") == 0;
         if (strcasecmp(newinc_items[i].name, lc->str) == 0) {
-           token = lex_get_token(lc, T_ALL);
-           if (token != T_EQUALS) {
-               scan_err1(lc, "expected an equals, got: %s", lc->str);
+           if (!options) {
+              token = lex_get_token(lc, T_ALL);
+              if (token != T_EQUALS) {
+                  scan_err1(lc, "expected an equals, got: %s", lc->str);
+              }
            }
            /* Call item handler */
            newinc_items[i].handler(lc, &newinc_items[i], i, pass);
@@ -483,6 +501,48 @@ static void store_fname(LEX *lc, RES_ITEM *item, int index, int pass)
    scan_to_eol(lc);
 }
 
+/*
+ * Come here when Options seen in Include/Exclude
+ */
+static void options_res(LEX *lc, RES_ITEM *item, int index, int pass)
+{
+   int token, i;
+
+   token = lex_get_token(lc, T_ALL);           
+   if (token != T_BOB) {
+      scan_err1(lc, "Expecting open brace. Got %s", lc->str);
+   }
+
+   while ((token = lex_get_token(lc, T_ALL)) != T_EOF) {
+      if (token == T_EOL) {
+        continue;
+      }
+      if (token == T_EOB) {
+        break;
+      }
+      if (token != T_IDENTIFIER) {
+         scan_err1(lc, _("Expecting keyword, got: %s\n"), lc->str);
+      }
+      for (i=0; options_items[i].name; i++) {
+        if (strcasecmp(options_items[i].name, lc->str) == 0) {
+           token = lex_get_token(lc, T_ALL);
+           if (token != T_EQUALS) {
+               scan_err1(lc, "expected an equals, got: %s", lc->str);
+           }
+           /* Call item handler */
+           options_items[i].handler(lc, &options_items[i], i, pass);
+           i = -1;
+           break;
+        }
+      }
+      if (i >=0) {
+         scan_err1(lc, "Keyword %s not permitted in this resource", lc->str);
+      }
+   }
+   scan_to_eol(lc);
+}
+
+
 /*
  * New style options come here
  */
@@ -508,7 +568,7 @@ static void store_opts(LEX *lc, RES_ITEM *item, int index, int pass)
    scan_include_options(lc, keyword, inc_opts, sizeof(inc_opts));
    if (pass == 1) {
       setup_current_opts();
-      bstrncpy(res_incexe.current_opts->opts, inc_opts, MAX_FOPTS);
+      bstrncat(res_incexe.current_opts->opts, inc_opts, MAX_FOPTS);
       Dmsg2(100, "new pass=%d incexe opts=%s\n", pass, res_incexe.current_opts->opts);
    }
    scan_to_eol(lc);
index 9fbc00dc2c1b846a0a7b55cc84a6792135a8aaf7..b0630023f43a4a676e3b86a54a921c14e6a14944 100644 (file)
@@ -2,8 +2,8 @@
 #undef  VERSION
 #define VERSION "1.34.3"
 #define VSTRING "1"
-#define BDATE   "27 Apr 2004"
-#define LSMDATE "27Apr04"
+#define BDATE   "28 Apr 2004"
+#define LSMDATE "28Apr04"
 
 /* Debug flags */
 #undef  DEBUG
index 5f0d78b2692ea84fd89d4a8f5f8fc7bd3a78ea1e..eff32e4f3eed6c42f51ca34586f1bb111d00b0db 100644 (file)
 #define HAVE_SETENV 1
 
 /* Define to 1 if you have the `setlocale' function. */
-#define HAVE_SETLOCALE 1
+#undef HAVE_SETLOCALE  
+
+#undef HAVE_NL_LANGINFO
 
 /* Define to 1 if you have the `setpgid' function. */
 #define HAVE_SETPGID 1