- 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_Before (%s,%i,%i,%c)\n", script->command,
- script->on_success,
- script->on_failure,
- jcr->JobStatus );
-
- runit = true;
- }
+ 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",
+ script->command, script->on_success, script->on_failure,
+ jcr->JobStatus );
+ runit = true;
+ }
+ }
+
+ if ((script->when & SCRIPT_AfterVSS) && (when & SCRIPT_AfterVSS)) {
+ if ((script->on_success && (jcr->JobStatus == JS_Blocked))
+ || (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;
+ }