]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/migrate.c
kes Modify job report to include director name and Build OS.
[bacula/bacula] / bacula / src / dird / migrate.c
index f6b369d5a47a71932d20a53ef3472fe31630d93b..b45c9876b3d9d9089468fb9563758c2863048dfa 100644 (file)
@@ -377,16 +377,19 @@ bool do_migration(JCR *jcr)
    /* Pickup Job termination data */
    /* Note, the SD stores in jcr->JobFiles/ReadBytes/JobBytes/Errors */
    wait_for_storage_daemon_termination(jcr);
-
    set_jcr_job_status(jcr, jcr->SDJobStatus);
+   db_write_batch_file_records(jcr);    /* used by bulk batch file insert */
    if (jcr->JobStatus != JS_Terminated) {
       return false;
    }
 
    migration_cleanup(jcr, jcr->JobStatus);
    if (mig_jcr) {
+      char jobid[50];
       UAContext *ua = new_ua_context(jcr);
-      purge_job_records_from_catalog(ua, jcr->previous_jr.JobId);
+      edit_uint64(jcr->previous_jr.JobId, jobid);
+      /* Purge all old file records, but leave Job record */
+      purge_files_from_jobs(ua, jobid);
       free_ua_context(ua);
    }
    return true;
@@ -1149,7 +1152,8 @@ void migration_cleanup(JCR *jcr, int TermCode)
 
    jobstatus_to_ascii(jcr->SDJobStatus, sd_term_msg, sizeof(sd_term_msg));
 
-   Jmsg(jcr, msg_type, 0, _("Bacula %s (%s): %s\n"
+   Jmsg(jcr, msg_type, 0, _("Bacula %s %s (%s): %s\n"
+"  Build OS:               %s %s %s\n"
 "  Prev Backup JobId:      %s\n"
 "  New Backup JobId:       %s\n"
 "  Migration JobId:        %s\n"
@@ -1175,9 +1179,8 @@ void migration_cleanup(JCR *jcr, int TermCode)
 "  SD Errors:              %d\n"
 "  SD termination status:  %s\n"
 "  Termination:            %s\n\n"),
-   VERSION,
-   LSMDATE,
-        edt, 
+        my_name, VERSION, LSMDATE, edt,
+        HOST_OS, DISTNAME, DISTVER,
         edit_uint64(jcr->previous_jr.JobId, ec6),
         mig_jcr ? edit_uint64(mig_jcr->jr.JobId, ec7) : "0",
         edit_uint64(jcr->jr.JobId, ec8),