{"clientrunafterjob", store_short_runscript, ITEM(res_job.RunScripts), 0, 0, 0},
{"maximumconcurrentjobs", store_pint32, ITEM(res_job.MaxConcurrentJobs), 0, ITEM_DEFAULT, 1},
{"rescheduleonerror", store_bool, ITEM(res_job.RescheduleOnError), 0, ITEM_DEFAULT, false},
+ {"rescheduleincompletejobs", store_bool, ITEM(res_job.RescheduleIncompleteJobs), 0, ITEM_DEFAULT, true},
{"rescheduleinterval", store_time, ITEM(res_job.RescheduleInterval), 0, ITEM_DEFAULT, 60 * 30},
- {"rescheduletimes", store_pint32, ITEM(res_job.RescheduleTimes), 0, 0, 0},
+ {"rescheduletimes", store_pint32, ITEM(res_job.RescheduleTimes), 0, 0, 5},
{"priority", store_pint32, ITEM(res_job.Priority), 0, ITEM_DEFAULT, 10},
{"allowmixedpriority", store_bool, ITEM(res_job.allow_mixed_priority), 0, ITEM_DEFAULT, false},
{"writepartafterjob", store_bool, ITEM(res_job.write_part_after_job), 0, ITEM_DEFAULT, true},
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2011 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
bool where_use_regexp; /* true if RestoreWhere is a BREGEXP */
bool RescheduleOnError; /* Set to reschedule on error */
+ bool RescheduleIncompleteJobs; /* Set to reschedule incomplete Jobs */
bool PrefixLinks; /* prefix soft links with Where path */
bool PruneJobs; /* Force pruning of Jobs */
bool PruneFiles; /* Force pruning of Files */
*/
static bool reschedule_job(JCR *jcr, jobq_t *jq, jobq_item_t *je)
{
+ bool resched = false;
/*
- * Reschedule the job if necessary and requested
+ * Reschedule the job if requested and possible
*/
- if (jcr->job->RescheduleOnError &&
- jcr->JobStatus != JS_Terminated &&
- jcr->JobStatus != JS_Canceled &&
- jcr->getJobType() == JT_BACKUP &&
- (jcr->job->RescheduleTimes == 0 ||
- jcr->reschedule_count < jcr->job->RescheduleTimes)) {
+ /* Basic condition is that more times remain */
+ if (jcr->job->RescheduleTimes == 0 ||
+ jcr->reschedule_count < jcr->job->RescheduleTimes) {
+ resched =
+ /* Check for incomplete jobs */
+ (jcr->job->RescheduleIncompleteJobs && jcr->is_incomplete()) ||
+ /* Check for failed jobs */
+ (jcr->job->RescheduleOnError &&
+ jcr->JobStatus != JS_Terminated &&
+ jcr->JobStatus != JS_Canceled &&
+ jcr->getJobType() == JT_BACKUP);
+ }
+ if (resched) {
char dt[50], dt2[50];
/*
if (!allow_duplicate_job(jcr)) {
return false;
}
+ /* Only jobs with no output or Incomplete jobs can run on same JCR */
if (jcr->JobBytes == 0 || jcr->incomplete) {
Dmsg2(2300, "Requeue job=%d use=%d\n", jcr->JobId, jcr->use_count());
V(jq->mutex);