]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/migrate.c
ebl Check size, age of each file after their backup to see if
[bacula/bacula] / bacula / src / dird / migrate.c
index 0165f7153d428c66f67d55baa231dd7366beba29..abe785e4b4ddb3793454b0ff180bd05aff98e775 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;
@@ -783,8 +786,10 @@ static int get_job_to_migrate(JCR *jcr)
       Jmsg(jcr, M_INFO, 0, _("No JobIds found to migrate.\n"));
       goto ok_out;
    }
-   Jmsg(jcr, M_INFO, 0, _("The following %u JobId%s will be migrated: %s\n"),
+
+   Jmsg(jcr, M_INFO, 0, _("The following %u JobId%s were chosen to be migrated: %s\n"),
       ids.count, ids.count==0?"":"s", ids.list);
+
    Dmsg2(dbglevel, "Before loop count=%d ids=%s\n", ids.count, ids.list);
    for (int i=1; i < (int)ids.count; i++) {
       JobId = 0;
@@ -1147,7 +1152,7 @@ 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 Version: %s (%s) %s %s %s at %s\n"
 "  Prev Backup JobId:      %s\n"
 "  New Backup JobId:       %s\n"
 "  Migration JobId:        %s\n"
@@ -1173,8 +1178,7 @@ void migration_cleanup(JCR *jcr, int TermCode)
 "  SD Errors:              %d\n"
 "  SD termination status:  %s\n"
 "  Termination:            %s\n\n"),
-   VERSION,
-   LSMDATE,
+        my_name, VERSION, BDATE, HOST_OS, DISTNAME, DISTVER,
         edt, 
         edit_uint64(jcr->previous_jr.JobId, ec6),
         mig_jcr ? edit_uint64(mig_jcr->jr.JobId, ec7) : "0",