]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/job.c
Make migration work with new subroutine
[bacula/bacula] / bacula / src / dird / job.c
index 280159e84a981b050c0eeecdfd41ed6098e2515a..339fb408440e625d7e7a5707915fecbdcad288a7 100644 (file)
@@ -265,7 +265,19 @@ 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.
+       */
+      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) {