* Version $Id$
*/
/*
- Copyright (C) 2000-2005 Kern Sibbald
+ Copyright (C) 2000-2006 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
/* Wait until we have something in the
* next hour or so.
*/
+again:
while (jobs_to_run->empty()) {
find_runs();
if (!jobs_to_run->empty()) {
#ifdef list_chain
job_item *je;
foreach_dlist(je, jobs_to_run) {
- dump_job(je, "Walk queue");
+ dump_job(je, _("Walk queue"));
}
#endif
/*
next_job = (job_item *)jobs_to_run->first();
jobs_to_run->remove(next_job);
- dump_job(next_job, "Dequeued job");
+ dump_job(next_job, _("Dequeued job"));
if (!next_job) { /* we really should have something now */
Emsg0(M_ABORT, 0, _("Scheduler logic error\n"));
}
run = next_job->run; /* pick up needed values */
job = next_job->job;
- run->last_run = now; /* mark as run now */
-
- dump_job(next_job, "Run job");
-
+ if (job->enabled) {
+ dump_job(next_job, _("Run job"));
+ }
free(next_job);
+ if (!job->enabled) {
+ goto again; /* ignore this job */
+ }
+ run->last_run = now; /* mark as run now */
jcr = new_jcr(sizeof(JCR), dird_free_jcr);
ASSERT(job);
LockRes();
foreach_res(job, R_JOB) {
sched = job->schedule;
- if (sched == NULL) { /* scheduled? */
+ if (sched == NULL || !job->enabled) { /* scheduled? or enabled? */
continue; /* no, skip this job */
}
Dmsg1(1200, "Got job: %s\n", job->hdr.name);
if (ji->runtime > je->runtime ||
(ji->runtime == je->runtime && ji->Priority > je->Priority)) {
jobs_to_run->insert_before(je, ji);
- dump_job(je, "Inserted job");
+ dump_job(je, _("Inserted job"));
inserted = true;
break;
}
/* If place not found in queue, append it */
if (!inserted) {
jobs_to_run->append(je);
- dump_job(je, "Appended job");
+ dump_job(je, _("Appended job"));
}
#ifdef SCHED_DEBUG
foreach_dlist(ji, jobs_to_run) {
- dump_job(ji, "Run queue");
+ dump_job(ji, _("Run queue"));
}
Dmsg0(000, "End run queue\n");
#endif