]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix #1526 about verify jobs and runscript
authorEric Bollengier <eric@eb.homelinux.org>
Mon, 22 Mar 2010 13:31:58 +0000 (14:31 +0100)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 2 Aug 2010 14:49:41 +0000 (16:49 +0200)
bacula/src/lib/runscript.c

index 1122f30dc14045af1ba247635cd4a76880ee2610..49099cec79db2cb07d2bcd2ce2d4d2d6889c8738 100644 (file)
@@ -132,9 +132,10 @@ int run_scripts(JCR *jcr, alist *runscripts, const char *label)
       runit = false;
 
       if ((script->when & SCRIPT_Before) && (when & SCRIPT_Before)) {
-         if ((script->on_success 
-            && (jcr->JobStatus == JS_Running || jcr->JobStatus == JS_Created))
-            || (script->on_failure && job_canceled(jcr))
+         if ((script->on_success && 
+              (jcr->JobStatus == JS_Running || jcr->JobStatus == JS_Created))
+            || (script->on_failure && 
+                (job_canceled(jcr) || jcr->JobStatus == JS_Differences))
             )
          {
             Dmsg4(200, "runscript: Run it because SCRIPT_Before (%s,%i,%i,%c)\n", 
@@ -159,7 +160,8 @@ int run_scripts(JCR *jcr, alist *runscripts, const char *label)
       if ((script->when & SCRIPT_After) && (when & SCRIPT_After)) {
          if ((script->on_success &&
               (jcr->JobStatus == JS_Terminated || jcr->JobStatus == JS_Warnings))
-             || (script->on_failure && job_canceled(jcr))
+            || (script->on_failure && 
+                (job_canceled(jcr) || jcr->JobStatus == JS_Differences))
             )
          {
             Dmsg4(200, "runscript: Run it because SCRIPT_After (%s,%i,%i,%c)\n",