*(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);
}
berrno be;
Jmsg(jcr, M_WARNING, 0, _("VSS was not initialized properly. VSS support is disabled. ERR=%s\n"), be.bstrerror());
}
+ run_scripts(jcr, jcr->RunScripts, "ClientAfterVSS");
}
#endif
if (strstr(label, NT_("Before"))) {
when = SCRIPT_Before;
+ } else if (bstrcmp(label, NT_("ClientAfterVSS"))) {
+ when = SCRIPT_AfterVSS;
} else {
when = SCRIPT_After;
}
}
}
+ 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;
+ }
+ }
+
if ((script->when & SCRIPT_After) && (when & SCRIPT_After)) {
if ((script->on_success && (jcr->JobStatus == JS_Terminated))
|| (script->on_failure && job_canceled(jcr))
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
};
General:
13Mar08
+ebl Add RunsWhen = AfterVSS to runscript. You can execute a command
+ (restart an application) just after the VSS snapshot on windows.
kes Don't zap dcr values during release_volume() as they might
have the next Volume to be mounted.
kes Fix AIX prototype.