Hi,

when a job is canceled, its RunScripts (with "When = After") are not executed. 
This makes it difficult to trigger any process after job cancellation.

While the documentation does not clearly state that the scripts are executed, 
the description of the exit codes suggests that -- it says that %e may, e.g., 
contain the string "Canceled". This is, of course, only true if canceled jobs 
run their runscripts at all.

The attached (micro-)patch adds the call to "run_scripts" identically to the 
way it is done in the "job_thread" function to the "cancel_job" code.

a) Do you approve of calling the run scripts there at all? "Runs on Failure" 
is honored.
b) Do you see any problems with this code modification (other than the change 
of beahvior, that is)
c) Feel free to include the patch in bacula.

Best regards
   Bastian

-- 
Collax GmbH . Basler Str. 115a . 79115 Freiburg . Germany
p: +49 (0) 89-990 157-28        www.collax.com

Geschäftsführer: Falk Birkner, Ralf Elias
AG München HRB 173695. Ust.-IdNr: DE270819312
--- bacula-5.2.12.ori/src/dird/job.c	2012-11-22 09:02:13.000000000 +0100
+++ bacula-5.2.12/src/dird/job.c	2012-11-21 17:28:20.000000000 +0100
@@ -465,6 +465,8 @@
       break;
    }
 
+   run_scripts(jcr, jcr->job->RunScripts, "AfterJob");
+
    return true;
 }
 
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Bacula-devel mailing list
Bacula-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to