bsendmsg(ua, "%s Version: " VERSION " (" BDATE ") %s %s %s\n", my_name,
HOST_OS, DISTNAME, DISTVER);
bstrftime_nc(dt, sizeof(dt), daemon_start_time);
- bsendmsg(ua, _("Daemon started %s, %d Job%s run.\n"), dt, last_job.NumJobs,
- last_job.NumJobs == 1 ? "" : "s");
+ bsendmsg(ua, _("Daemon started %s, %d Job%s run.\n"), dt, last_jobs->size(),
+ last_jobs->size() == 1 ? "" : "s");
/*
* List scheduled Jobs
*/
Dmsg0(200, "enter list_run_jobs()\n");
lock_jcr_chain();
- for (jcr=NULL; (jcr=get_next_jcr(jcr)); njobs++) {
+ foreach_jcr(jcr) {
+ njobs++;
if (jcr->JobId == 0) { /* this is us */
/* this is a console or other control job. We only show console
* jobs in the status output.
bsendmsg(ua, _("\nRunning Jobs:\n"));
bsendmsg(ua, _("Level JobId Job Status\n"));
bsendmsg(ua, _("====================================================================\n"));
- for (jcr=NULL; (jcr=get_next_jcr(jcr)); njobs++) {
+ foreach_jcr(jcr) {
if (jcr->JobId == 0 || !acl_access_ok(ua, Job_ACL, jcr->job->hdr.name)) {
- njobs--;
free_locked_jcr(jcr);
continue;
}
+ njobs++;
switch (jcr->JobStatus) {
case JS_Created:
msg = _("is waiting execution");