]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/job.c
26May06
[bacula/bacula] / bacula / src / dird / job.c
index 280159e84a981b050c0eeecdfd41ed6098e2515a..511581d3874f20f2053922bac8305da6bf5edd07 100644 (file)
@@ -265,7 +265,21 @@ static void *job_thread(void *arg)
             goto bail_out;
          }
       }
-
+      /*
+       * We re-update the job start record so that the start
+       *  time is set after the run before job.  This avoids
+       *  that any files created by the run before job will
+       *  be saved twice.  They will be backed up in the current
+       *  job, but not in the next one unless they are changed.
+       *  Without this, they will be backed up in this job and
+       *  in the next job run because in that case, their date
+       *   is after the start of this run.
+       */
+      jcr->start_time = time(NULL);
+      jcr->jr.StartTime = jcr->start_time;
+      if (!db_update_job_start_record(jcr, jcr->db, &jcr->jr)) {
+         Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db));
+      }
       generate_job_event(jcr, "JobRun");
 
       switch (jcr->JobType) {