]> git.sur5r.net Git - bacula/bacula/commitdiff
Add replace=xxx on restore command line
authorKern Sibbald <kern@sibbald.com>
Wed, 12 Jan 2011 14:13:16 +0000 (15:13 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:39:49 +0000 (14:39 +0200)
bacula/src/dird/ua.h
bacula/src/dird/ua_restore.c

index a9e3f5b60090cb14720fd699c24b1a947758c3e2..b8f01b94be0bfceb24f4410b9b147d8df66464f9 100644 (file)
@@ -116,6 +116,7 @@ struct RESTORE_CTX {
    char *comment;
    char *where;
    char *RegexWhere;
+   char *replace;
    RBSR *bsr;
    POOLMEM *fname;                    /* filename only */
    POOLMEM *path;                     /* path only */
index 1df4960b1719084a34b7db2ac807bf30f4ed0711..b6e3912a6def678eccda76158c19105d2022fc54 100644 (file)
@@ -108,6 +108,12 @@ int restore_cmd(UAContext *ua, const char *cmd)
       rx.where = ua->argv[i];
    }
 
+   i = find_arg_with_value(ua, "replace");
+   if (i >= 0) {
+      rx.replace = ua->argv[i];
+   }
+   
+
    i = find_arg_with_value(ua, "strip_prefix");
    if (i >= 0) {
       strip_prefix = ua->argv[i];
@@ -257,6 +263,11 @@ int restore_cmd(UAContext *ua, const char *cmd)
    }
    pm_strcat(ua->cmd, buf);
 
+   if (rx.replace) {
+      Mmsg(buf, " replace=%s", rx.replace);
+      pm_strcat(ua->cmd, buf);
+   }
+
    if (rx.comment) {
       Mmsg(buf, " comment=\"%s\"", rx.comment);
       pm_strcat(ua->cmd, buf);
@@ -458,7 +469,8 @@ static int user_select_jobids_or_files(UAContext *ua, RESTORE_CTX *rx)
       "restoreclient", /* 19 */
       "copies",        /* 20 */
       "comment",       /* 21 */
-      "restore_job",   /* 22 */
+      "restorejob",    /* 22 */
+      "replace",       /* 23 */
       NULL
    };