/* Job needs to be marked as terminated before running the after runscript */
jcr->setJobStatus(TermCode);
- run_scripts(jcr, jcr->job->RunScripts, "EndJob");
+ run_scripts(jcr, jcr->job->RunScripts, "AtJobCompletion");
/* Runscript could have changed JobStatus,
* now check if it should be changed in the report or not */
/* Job needs to be marked as terminated before running the after runscript */
jcr->setJobStatus(TermCode);
- run_scripts(jcr, jcr->job->RunScripts, "EndJob");
+ run_scripts(jcr, jcr->job->RunScripts, "AtJobCompletion");
/* Runscript could have changed JobStatus,
* now check if it should be changed in the report or not */
*(uint32_t *)(item->value) = SCRIPT_AfterVSS;
} else if (strcasecmp(lc->str, "aftersnapshot") == 0) {
*(uint32_t *)(item->value) = SCRIPT_AfterVSS;
- } else if (strcasecmp(lc->str, "endjob") == 0) {
- *(uint32_t *)(item->value) = SCRIPT_EndJob;
+ } else if (strcasecmp(lc->str, "atjobcompletion") == 0) {
+ *(uint32_t *)(item->value) = SCRIPT_AtJobCompletion;
} else if (strcasecmp(lc->str, "always") == 0) {
*(uint32_t *)(item->value) = SCRIPT_Any;
} else {
- scan_err2(lc, _("Expect %s, got: %s"), "Before, EndJob, After, AfterVSS or Always", lc->str);
+ scan_err2(lc, _("Expect %s, got: %s"), "Before, AtJobCompletion, After, AfterVSS or Always", lc->str);
}
scan_to_eol(lc);
}
result = send_runscript_with_old_proto(jcr, cmd->when, msg);
} else {
- /* On the FileDaemon, EndJob is a synonym of After */
- cmd->when = (cmd->when == SCRIPT_EndJob) ? SCRIPT_After : cmd->when;
+ /* On the FileDaemon, AtJobCompletion is a synonym of After */
+ cmd->when = (cmd->when == SCRIPT_AtJobCompletion) ? SCRIPT_After : cmd->when;
fd->fsend(runscript, cmd->on_success,
cmd->on_failure,
cmd->fail_on_error,
db_sql_query(wjcr->db, query.c_str(), NULL, NULL);
}
}
- run_scripts(jcr, jcr->job->RunScripts, "EndJob");
+ run_scripts(jcr, jcr->job->RunScripts, "AtJobCompletion");
/* Runscript could have changed JobStatus,
* now check if it should be changed in the report or not */
/* Job needs to be marked as terminated before running the after runscript */
jcr->setJobStatus(TermCode);
- run_scripts(jcr, jcr->job->RunScripts, "EndJob");
+ run_scripts(jcr, jcr->job->RunScripts, "AtJobCompletion");
/* Runscript could have changed JobStatus,
* now check if it should be changed in the report or not */
/* Job needs to be marked as terminated before running the after runscript */
jcr->setJobStatus(TermCode);
- run_scripts(jcr, jcr->job->RunScripts, "EndJob");
+ run_scripts(jcr, jcr->job->RunScripts, "AtJobCompletion");
/* Runscript could have changed JobStatus,
* now check if it should be changed in the report or not */
/* Job needs to be marked as terminated before running the after runscript */
jcr->setJobStatus(TermCode);
- run_scripts(jcr, jcr->job->RunScripts, "EndJob");
+ run_scripts(jcr, jcr->job->RunScripts, "AtJobCompletion");
/* Runscript could have changed JobStatus,
* now check if it should be changed in the report or not */
when = SCRIPT_Before;
} else if (bstrcmp(label, NT_("ClientAfterVSS"))) {
when = SCRIPT_AfterVSS;
- } else if (bstrcmp(label, NT_("EndJob"))) {
- when = SCRIPT_EndJob;
+ } else if (bstrcmp(label, NT_("AtJobCompletion"))) {
+ when = SCRIPT_AtJobCompletion;
} else {
when = SCRIPT_After;
}
}
}
- if ((script->when & SCRIPT_EndJob) && (when & SCRIPT_EndJob)) {
- Dmsg1(0, "EndJob jobstatus=%c\n", jcr->JobStatus);
+ if ((script->when & SCRIPT_AtJobCompletion) && (when & SCRIPT_AtJobCompletion)) {
+ Dmsg1(0, "AtJobCompletion jobstatus=%c\n", jcr->JobStatus);
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_EndJob (%s,%i,%i,%c)\n",
+ Dmsg4(200, "runscript: Run it because SCRIPT_AtJobCompletion (%s,%i,%i,%c)\n",
script->command, script->on_success, script->on_failure,
jcr->JobStatus );
/* Set job task code */
SCRIPT_After = (1<<0), /* AfterJob */
SCRIPT_Before = (1<<1), /* BeforeJob */
SCRIPT_AfterVSS = (1<<2), /* BeforeJob and After VSS */
- SCRIPT_EndJob = (1<<3), /* Before AfterJob on the Director, take status in account */
+ SCRIPT_AtJobCompletion = (1<<3), /* Before AfterJob on the Director, take status in account */
SCRIPT_Any = SCRIPT_Before | SCRIPT_After
};