X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Flib%2Frunscript.c;h=47a55c631bafa35069becc5dba1b2dc4d88f4d37;hb=4d90a54f244499151f1c2451d420c624524a3ba9;hp=c2f61aa8c9f16eda770622e047a456c392c63215;hpb=908d0c5a7c352c4473409fd01cab16d968c41b43;p=bacula%2Fbacula diff --git a/bacula/src/lib/runscript.c b/bacula/src/lib/runscript.c index c2f61aa8c9..47a55c631b 100644 --- a/bacula/src/lib/runscript.c +++ b/bacula/src/lib/runscript.c @@ -6,7 +6,7 @@ The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. This program is Free Software; you can redistribute it and/or - modify it under the terms of version two of the GNU General Public + modify it under the terms of version three of the GNU Affero General Public License as published by the Free Software Foundation and included in the file LICENSE. @@ -15,7 +15,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU Affero General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -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", @@ -157,8 +158,10 @@ 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)) - || (script->on_failure && job_canceled(jcr)) + if ((script->on_success && + (jcr->JobStatus == JS_Terminated || jcr->JobStatus == JS_Warnings)) + || (script->on_failure && + (job_canceled(jcr) || jcr->JobStatus == JS_Differences)) ) { Dmsg4(200, "runscript: Run it because SCRIPT_After (%s,%i,%i,%c)\n",