]> git.sur5r.net Git - bacula/bacula/commitdiff
Apply patch from Frank Kardel that implements 'honor no dump flag',
authorKern Sibbald <kern@sibbald.com>
Mon, 3 Mar 2008 11:18:12 +0000 (11:18 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 3 Mar 2008 11:18:12 +0000 (11:18 +0000)
     which causes the FD to detect whether or not the OS has the
     honor no dump bit (*BSD systems), and if so, to skip backing up
     any file with this bit set.  The feature is enabled by setting
     'honor no dump flag = yes' in the Options section of a FileSet

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

bacula/AUTHORS
bacula/src/dird/dird_conf.h
bacula/src/dird/inc_conf.c
bacula/src/dird/ua_cmds.c
bacula/src/filed/backup.c
bacula/src/filed/job.c
bacula/src/findlib/find.h
bacula/src/version.h
bacula/technotes-2.3

index e2eb11cc0882c78b8a90b423645aca33d8064123..1d4b26752c89b09dc8c06634e0f32ba134cf3ef0 100644 (file)
@@ -40,6 +40,7 @@ Eric Bollengier
 Erich Prinz
 Felix Schwarz
 Francisco Reyes
 Erich Prinz
 Felix Schwarz
 Francisco Reyes
+Frank Kardel
 Frank Sweetser
 Howard Thomson
 Jaime Ventura                      
 Frank Sweetser
 Howard Thomson
 Jaime Ventura                      
index f35890ff7fb7c3adeb08d31986900fa6961591eb..0407cea6ac1384a93575b088785c2fa73070bd01 100644 (file)
@@ -428,7 +428,7 @@ public:
 inline char *JOB::name() const { return hdr.name; }
 
 #undef  MAX_FOPTS
 inline char *JOB::name() const { return hdr.name; }
 
 #undef  MAX_FOPTS
-#define MAX_FOPTS 34
+#define MAX_FOPTS 40
 
 /* File options structure */
 struct FOPTS {
 
 /* File options structure */
 struct FOPTS {
index b7a52e1accfed2b6568b229116650518277ff938..62837e42bcddaba53ff77602298ce963355e2759 100644 (file)
@@ -127,6 +127,7 @@ static RES_ITEM options_items[] = {
    {"drivetype",       store_drivetype, {0},     0, 0, 0},
    {"checkfilechanges",store_opts,    {0},     0, 0, 0},
    {"strippath",       store_opts,    {0},     0, 0, 0},
    {"drivetype",       store_drivetype, {0},     0, 0, 0},
    {"checkfilechanges",store_opts,    {0},     0, 0, 0},
    {"strippath",       store_opts,    {0},     0, 0, 0},
+   {"honornodumpflag", store_opts,    {0},     0, 0, 0},
    {NULL, NULL, {0}, 0, 0, 0}
 };
 
    {NULL, NULL, {0}, 0, 0, 0}
 };
 
@@ -155,7 +156,8 @@ enum {
    INC_KW_NOATIME,
    INC_KW_ENHANCEDWILD,
    INC_KW_CHKCHANGES,
    INC_KW_NOATIME,
    INC_KW_ENHANCEDWILD,
    INC_KW_CHKCHANGES,
-   INC_KW_STRIPPATH
+   INC_KW_STRIPPATH,
+   INC_KW_HONOR_NODUMP
 };
 
 /*
 };
 
 /*
@@ -187,6 +189,7 @@ static struct s_kw FS_option_kw[] = {
    {"enhancedwild", INC_KW_ENHANCEDWILD},
    {"checkfilechanges", INC_KW_CHKCHANGES},
    {"strippath",    INC_KW_STRIPPATH},
    {"enhancedwild", INC_KW_ENHANCEDWILD},
    {"checkfilechanges", INC_KW_CHKCHANGES},
    {"strippath",    INC_KW_STRIPPATH},
+   {"honornodumpflag",    INC_KW_HONOR_NODUMP},
    {NULL,          0}
 };
 
    {NULL,          0}
 };
 
@@ -254,6 +257,8 @@ static struct s_fs_opt FS_options[] = {
    {"no",       INC_KW_ENHANCEDWILD,  "0"},
    {"yes",      INC_KW_CHKCHANGES,    "c"},
    {"no",       INC_KW_CHKCHANGES,    "0"},
    {"no",       INC_KW_ENHANCEDWILD,  "0"},
    {"yes",      INC_KW_CHKCHANGES,    "c"},
    {"no",       INC_KW_CHKCHANGES,    "0"},
+   {"yes",      INC_KW_HONOR_NODUMP,  "N"},
+   {"no",       INC_KW_HONOR_NODUMP,  "0"},
    {NULL,       0,                      0}
 };
 
    {NULL,       0,                      0}
 };
 
index ce5d8f09bc392b343fe886910f443640dfee53f4..db8d98dab964dc36bcc479662d3df398ed6e4bcc 100644 (file)
@@ -1558,7 +1558,8 @@ int wait_cmd(UAContext *ua, const char *cmd)
 {
    JCR *jcr;
 
 {
    JCR *jcr;
 
-   /* no args
+   /*
+    * no args
     * Wait until no job is running
     */
    if (ua->argc == 1) {
     * Wait until no job is running
     */
    if (ua->argc == 1) {
@@ -1626,7 +1627,7 @@ int wait_cmd(UAContext *ua, const char *cmd)
    }
 
    /*
    }
 
    /*
-    * We wait the end of job
+    * We wait the end of a specific job
     */
 
    bmicrosleep(0, 200000);            /* let job actually start */
     */
 
    bmicrosleep(0, 200000);            /* let job actually start */
index c3ba64f6b43e2140fd8a7047ea18090b74614b6f..f2f60bd35ae83b6d34f1e891947e0609dc87194e 100644 (file)
@@ -298,6 +298,22 @@ bail_out:
    return true;
 }
 
    return true;
 }
 
+/*
+ * check for BSD nodump flag
+ */
+static bool no_dump(JCR *jcr, FF_PKT *ff_pkt)
+{
+#if defined(HAVE_CHFLAGS) && defined(UF_NODUMP)
+   if ( (ff_pkt->flags & FO_HONOR_NODUMP) &&
+        (ff_pkt->statp.st_flags & UF_NODUMP) ) {
+      Jmsg(jcr, M_INFO, 1, _("     NODUMP flag set - will not process %s\n"),
+           ff_pkt->fname);
+      return true;                    /* do not backup this file */
+   }
+#endif
+   return false;                      /* do backup */
+}
+
 /*
  * Find all the requested files and send them
  * to the Storage daemon.
 /*
  * Find all the requested files and send them
  * to the Storage daemon.
@@ -533,10 +549,14 @@ int save_file(JCR *jcr, FF_PKT *ff_pkt, bool top_level)
       break;
    case FT_REGE:
       Dmsg1(130, "FT_REGE saving: %s\n", ff_pkt->fname);
       break;
    case FT_REGE:
       Dmsg1(130, "FT_REGE saving: %s\n", ff_pkt->fname);
+      if (no_dump(jcr, ff_pkt))
+          return 1;
       has_file_data = true;
       break;
    case FT_REG:
       Dmsg1(130, "FT_REG saving: %s\n", ff_pkt->fname);
       has_file_data = true;
       break;
    case FT_REG:
       Dmsg1(130, "FT_REG saving: %s\n", ff_pkt->fname);
+      if (no_dump(jcr, ff_pkt))
+          return 1;
       has_file_data = true;
       break;
    case FT_LNK:
       has_file_data = true;
       break;
    case FT_LNK:
@@ -544,6 +564,8 @@ int save_file(JCR *jcr, FF_PKT *ff_pkt, bool top_level)
       break;
    case FT_DIRBEGIN:
       jcr->num_files_examined--;      /* correct file count */
       break;
    case FT_DIRBEGIN:
       jcr->num_files_examined--;      /* correct file count */
+      if (no_dump(jcr, ff_pkt))       /* disable recursion on nodump directories */
+          ff_pkt->flags |= FO_NO_RECURSION;
       return 1;                       /* not used */
    case FT_NORECURSE:
       Jmsg(jcr, M_INFO, 1, _("     Recursion turned off. Will not descend from %s into %s\n"),
       return 1;                       /* not used */
    case FT_NORECURSE:
       Jmsg(jcr, M_INFO, 1, _("     Recursion turned off. Will not descend from %s into %s\n"),
index 9e1f8d2de4f9027db78c1577a9cdf5ed2837a1c0..d8ee96eacceb1ce9a79477d56d3a80da75dcdbf2 100644 (file)
@@ -1099,6 +1099,9 @@ static void set_options(findFOPTS *fo, const char *opts)
       case 'c':
          fo->flags |= FO_CHKCHANGES;
          break;
       case 'c':
          fo->flags |= FO_CHKCHANGES;
          break;
+      case 'N':
+         fo->flags |= FO_HONOR_NODUMP;
+         break;
       default:
          Emsg1(M_ERROR, 0, _("Unknown include/exclude option: %c\n"), *p);
          break;
       default:
          Emsg1(M_ERROR, 0, _("Unknown include/exclude option: %c\n"), *p);
          break;
index 7a00819ee0e394583df6040121f964d21781abde..cbbbe6c63cdc9e7d161768e47e25bb94d800b05f 100644 (file)
@@ -108,6 +108,7 @@ enum {
 #define FO_ENHANCEDWILD (1<<23)       /* Enhanced wild card processing */
 #define FO_CHKCHANGES   (1<<24)       /* Check if file have been modified during backup */
 #define FO_STRIPPATH    (1<<25)       /* Check for stripping path */
 #define FO_ENHANCEDWILD (1<<23)       /* Enhanced wild card processing */
 #define FO_CHKCHANGES   (1<<24)       /* Check if file have been modified during backup */
 #define FO_STRIPPATH    (1<<25)       /* Check for stripping path */
+#define FO_HONOR_NODUMP (1<<26)       /* honor NODUMP flag */
 
 struct s_included_file {
    struct s_included_file *next;
 
 struct s_included_file {
    struct s_included_file *next;
index f133f9d0ecea3eacd74564b9e5da0e6ac4413ad2..563c1fa5d535df6bf21e442e2984c22ba76552be 100644 (file)
@@ -3,9 +3,9 @@
  */
 
 #undef  VERSION
  */
 
 #undef  VERSION
-#define VERSION "2.3.10"
-#define BDATE   "26 February 2008"
-#define LSMDATE "26Feb08"
+#define VERSION "2.3.11"
+#define BDATE   "03 March 2008"
+#define LSMDATE "03Mar08"
 
 #define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
 #define BYEAR "2008"       /* year for copyright messages in progs */
 
 #define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
 #define BYEAR "2008"       /* year for copyright messages in progs */
index 73f260fe80d5a3e66e982512f71b2ae76d2aef50..cf3617a214300b0a51023e5543a6b7746357e9db 100644 (file)
@@ -1,6 +1,12 @@
               Technical notes on version 2.3
 
 General:
               Technical notes on version 2.3
 
 General:
+03Mar08
+kes  Apply patch from Frank Kardel that implements 'honor no dump flag',
+     which causes the FD to detect whether or not the OS has the 
+     honor no dump bit (*BSD systems), and if so, to skip backing up
+     any file with this bit set.  The feature is enabled by setting
+     'honor no dump flag = yes' in the Options section of a FileSet.
 28Feb08
 kes  Correct po warning message with datarootdir
 kes  Implement more code in dird.c to put configuration parsing in
 28Feb08
 kes  Correct po warning message with datarootdir
 kes  Implement more code in dird.c to put configuration parsing in