]> git.sur5r.net Git - bacula/bacula/commitdiff
Restart incomplete jobs only if type Backup
authorKern Sibbald <kern@sibbald.com>
Sun, 20 Feb 2011 14:39:14 +0000 (15:39 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:43:25 +0000 (14:43 +0200)
bacula/src/dird/jobq.c

index 97917b676b79c4d7f782316d6c76851e8792faa3..7ceeb86f3e61f52870682b3bcd0d53bc03a556f2 100644 (file)
@@ -616,17 +616,18 @@ static bool reschedule_job(JCR *jcr, jobq_t *jq, jobq_item_t *je)
    /*
     * Reschedule the job if requested and possible
     */
-   /* Basic condition is that more times remain */
+   /* Basic condition is that more reschedule times remain */
    if (jcr->job->RescheduleTimes == 0 ||
        jcr->reschedule_count < jcr->job->RescheduleTimes) {
       resched = 
          /* Check for incomplete jobs */
-         (jcr->job->RescheduleIncompleteJobs && jcr->is_incomplete()) ||
+         (jcr->job->RescheduleIncompleteJobs && 
+          jcr->is_incomplete() && jcr->is_JobType(JT_BACKUP)) ||
          /* Check for failed jobs */
          (jcr->job->RescheduleOnError &&
-          jcr->JobStatus != JS_Terminated &&
-          jcr->JobStatus != JS_Canceled &&
-          jcr->getJobType() == JT_BACKUP);
+          !jcr->is_JobStatus(JS_Terminated) &&
+          !jcr->is_JobStatus(JS_Canceled) &&
+          jcr->is_JobType(JT_BACKUP));
    }
    if (resched) {
        char dt[50], dt2[50];