]> git.sur5r.net Git - bacula/bacula/commitdiff
Allow plugin to backup a directory
authorEric Bollengier <eric@baculasystems.com>
Wed, 18 Apr 2012 14:32:43 +0000 (16:32 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 19 Apr 2012 06:44:34 +0000 (08:44 +0200)
bacula/src/filed/backup.c
bacula/src/filed/fd_plugins.c
bacula/src/filed/fd_plugins.h
bacula/src/findlib/find.h

index e9242a06de7adc83266e65e7e00af59d408d7ab7..a17e8ceb3f3af319751d0f4b2fe4afc03e05e191 100644 (file)
@@ -535,7 +535,7 @@ int save_file(JCR *jcr, FF_PKT *ff_pkt, bool top_level)
       set_portable_backup(&ff_pkt->bfd); /* disable Win32 BackupRead() */
    }
 
-   if (ff_pkt->cmd_plugin) {
+   if (ff_pkt->cmd_plugin && !ff_pkt->no_read) {
       do_plugin_set = true;
 
    /* option and cmd plugin are not compatible together */
index f09d9ad2c0236e8d237eed65878005693dfb86b5..7e25f04a3a33e97729d79cfb41c675bd1bc5751c 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2007-2011 Free Software Foundation Europe e.V.
+   Copyright (C) 2007-2012 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.
@@ -319,6 +319,7 @@ static bool get_plugin_name(JCR *jcr, char *cmd, int *ret)
 
 static void update_ff_pkt(FF_PKT *ff_pkt, struct save_pkt *sp)
 {
+   ff_pkt->no_read = sp->no_read;
    ff_pkt->delta_seq = sp->delta_seq;
    if (sp->flags & FO_DELTA) {
       ff_pkt->flags |= FO_DELTA;
index dfb0d93d9698cd192e2c0ca452b11a857a293b0b..d20f17b6e218edc1cea18fb02a8acc6e78a20ace 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2007-2011 Free Software Foundation Europe e.V.
+   Copyright (C) 2007-2012 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.
@@ -101,6 +101,7 @@ struct save_pkt {
    struct stat statp;                 /* System stat() packet for file */
    int32_t type;                      /* FT_xx for this file */             
    uint32_t flags;                    /* Bacula internal flags */
+   bool no_read;                      /* During the save, the file should not be saved */
    bool portable;                     /* set if data format is portable */
    bool accurate_found;               /* Found in accurate list (valid after check_changes()) */
    char *cmd;                         /* command */
@@ -187,7 +188,8 @@ typedef enum {
   bVarVersion    = 17,
   bVarDistName   = 18,
   bVarBEEF       = 19,
-  bVarPrevJobName = 20
+  bVarPrevJobName = 20,
+  bVarPrefixLinks = 21
 } bVariable;
 
 /* Events that are passed to plugin */
@@ -299,7 +301,7 @@ typedef enum {
 
 
 #define FD_PLUGIN_MAGIC     "*FDPluginData*" 
-#define FD_PLUGIN_INTERFACE_VERSION  5
+#define FD_PLUGIN_INTERFACE_VERSION  6
 
 typedef struct s_pluginInfo {
    uint32_t size;
index da504c27a343e83285cf5f1206433c1513b5e27d..a91ba882b42b367a8a29d28613fa4738752e3a09 100644 (file)
@@ -188,6 +188,7 @@ struct FF_PKT {
    bool dereference;                  /* follow links (not implemented) */
    bool null_output_device;           /* using null output device */
    bool incremental;                  /* incremental save */
+   bool no_read;                      /* Do not read this file when using Plugin */
    char VerifyOpts[20];
    char AccurateOpts[20];
    char BaseJobOpts[20];