From: Eric Bollengier Date: Tue, 27 Nov 2007 20:44:06 +0000 (+0000) Subject: ebl First version of this patch, we need to handle VSS failure X-Git-Tag: Release-3.0.0~2196 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=afa0a4e0fc7c1db345df1c3ed4a7503283b4f4ec;p=bacula%2Fbacula ebl First version of this patch, we need to handle VSS failure git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5994 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/patches/testing/clientrunaftervss.patch b/bacula/patches/testing/clientrunaftervss.patch new file mode 100644 index 0000000000..c057b81d7e --- /dev/null +++ b/bacula/patches/testing/clientrunaftervss.patch @@ -0,0 +1,90 @@ + Add a new runswhen directive ClientRunAfterVSS + "Run After VSS snapshot, but before backup" + + It can be applied to Bacula trunk (and probably earlier + 2.2.x versions) with: + + cd + ./configure + patch -p0 when & SCRIPT_AfterVSS) && (when & SCRIPT_AfterVSS)) { ++ if ((script->on_success ++ && (jcr->JobStatus == JS_Running || jcr->JobStatus == JS_Created)) ++ || (script->on_failure && job_canceled(jcr)) ++ ) ++ { ++ Dmsg4(200, "runscript: Run it because SCRIPT_AfterVSS (%s,%i,%i,%c)\n", ++ script->command, script->on_success, script->on_failure, ++ jcr->JobStatus ); ++ runit = true; ++ } ++ } ++ + if ((script->when & SCRIPT_After) && (when & SCRIPT_After)) { + if ((script->on_success && (jcr->JobStatus == JS_Terminated)) + || (script->on_failure && job_canceled(jcr)) +Index: src/lib/runscript.h +=================================================================== +--- src/lib/runscript.h (révision 5993) ++++ src/lib/runscript.h (copie de travail) +@@ -56,6 +56,7 @@ + SCRIPT_Never = 0, + SCRIPT_After = (1<<0), /* AfterJob */ + SCRIPT_Before = (1<<1), /* BeforeJob */ ++ SCRIPT_AfterVSS = (1<<2), /* BeforeJob and After VSS */ + SCRIPT_Any = SCRIPT_Before | SCRIPT_After + }; + +Index: src/filed/job.c +=================================================================== +--- src/filed/job.c (révision 5993) ++++ src/filed/job.c (copie de travail) +@@ -1427,6 +1435,7 @@ + berrno be; + Jmsg(jcr, M_WARNING, 0, _("VSS was not initialized properly. VSS support is disabled. ERR=%s\n"), be.bstrerror()); + } ++ script->run(jcr, "ClientRunAfterVSS"); + } + #endif + +Index: src/dird/dird_conf.c +=================================================================== +--- src/dird/dird_conf.c (révision 5993) ++++ src/dird/dird_conf.c (copie de travail) +@@ -1682,10 +1682,12 @@ + *(int *)(item->value) = SCRIPT_Before ; + } else if (strcasecmp(lc->str, "after") == 0) { + *(int *)(item->value) = SCRIPT_After; ++ } else if (strcasecmp(lc->str, "aftervss") == 0) { ++ *(int *)(item->value) = SCRIPT_AfterVSS; + } else if (strcasecmp(lc->str, "always") == 0) { + *(int *)(item->value) = SCRIPT_Any; + } else { +- scan_err2(lc, _("Expect %s, got: %s"), "Before, After or Always", lc->str); ++ scan_err2(lc, _("Expect %s, got: %s"), "Before, After, AfterVSS or Always", lc->str); + } + scan_to_eol(lc); + }