]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/verify.c
03Dec05
[bacula/bacula] / bacula / src / dird / verify.c
index 478ab4a6f479dbb34929cf788bcc6fffca4caea7..f15233465f6ba664d69c712947f99dde1cb55f4a 100644 (file)
@@ -18,7 +18,7 @@
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
-   version 2 as ammended with additional clauses defined in the
+   version 2 as amended with additional clauses defined in the
    file LICENSE in the main source directory.
 
    This program is distributed in the hope that it will be useful,
@@ -125,18 +125,21 @@ bool do_verify_init(JCR *jcr)
     *   File daemon but not used).
     */
    if (jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG) {
-      RBSR *bsr = new_bsr();
+      RESTORE_CTX rx;
       UAContext *ua;
-      bsr->JobId = jcr->target_jr.JobId;
+      memset(&rx, 0, sizeof(rx));
+      rx.bsr = new_bsr();
+      rx.JobIds = "";                       
+      rx.bsr->JobId = jcr->target_jr.JobId;
       ua = new_ua_context(jcr);
-      complete_bsr(ua, bsr);
-      bsr->fi = new_findex();
-      bsr->fi->findex = 1;
-      bsr->fi->findex2 = jcr->target_jr.JobFiles;
-      jcr->ExpectedFiles = write_bsr_file(ua, bsr);
+      complete_bsr(ua, rx.bsr);
+      rx.bsr->fi = new_findex();
+      rx.bsr->fi->findex = 1;
+      rx.bsr->fi->findex2 = jcr->target_jr.JobFiles;
+      jcr->ExpectedFiles = write_bsr_file(ua, rx);
       if (jcr->ExpectedFiles == 0) {
          free_ua_context(ua);
-         free_bsr(bsr);
+         free_bsr(rx.bsr);
          return false;
       }
       if (jcr->RestoreBootstrap) {
@@ -146,7 +149,7 @@ bool do_verify_init(JCR *jcr)
       make_unique_restore_filename(ua, &fname);
       jcr->RestoreBootstrap = bstrdup(fname);
       free_ua_context(ua);
-      free_bsr(bsr);
+      free_bsr(rx.bsr);
       free_pool_memory(fname);
       jcr->needs_sd = true;
 
@@ -173,6 +176,7 @@ bool do_verify(JCR *jcr)
    const char *level;
    BSOCK   *fd;
    int stat;
+   char ed1[100];
 
    if (!db_update_job_start_record(jcr, jcr->db, &jcr->jr)) {
       Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db));
@@ -180,8 +184,8 @@ bool do_verify(JCR *jcr)
    }
 
    /* Print Job Start message */
-   Jmsg(jcr, M_INFO, 0, _("Start Verify JobId=%d Level=%s Job=%s\n"),
-      jcr->JobId, level_to_str(jcr->JobLevel), jcr->Job);
+   Jmsg(jcr, M_INFO, 0, _("Start Verify JobId=%s Level=%s Job=%s\n"),
+      edit_uint64(jcr->JobId, ed1), level_to_str(jcr->JobLevel), jcr->Job);
 
    if (jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG) {
       /*
@@ -194,7 +198,7 @@ bool do_verify(JCR *jcr)
       /*
        * Now start a job with the Storage daemon
        */
-      if (!start_storage_daemon_job(jcr, jcr->storage, SD_READ)) {
+      if (!start_storage_daemon_job(jcr, jcr->storage, NULL)) {
          return false;
       }
       /*
@@ -412,7 +416,7 @@ void verify_cleanup(JCR *jcr, int TermCode)
    jobstatus_to_ascii(jcr->FDJobStatus, fd_term_msg, sizeof(fd_term_msg));
    if (jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG) {
       jobstatus_to_ascii(jcr->SDJobStatus, sd_term_msg, sizeof(sd_term_msg));
-      Jmsg(jcr, msg_type, 0, _("Bacula " VERSION " (" LSMDATE "): %s\n"
+      Jmsg(jcr, msg_type, 0, _("Bacula %s (%s): %s\n"
 "  JobId:                  %d\n"
 "  Job:                    %s\n"
 "  FileSet:                %s\n"
@@ -428,6 +432,8 @@ void verify_cleanup(JCR *jcr, int TermCode)
 "  FD termination status:  %s\n"
 "  SD termination status:  %s\n"
 "  Termination:            %s\n\n"),
+         VERSION,
+         LSMDATE,
          edt,
          jcr->jr.JobId,
          jcr->jr.Job,
@@ -445,7 +451,7 @@ void verify_cleanup(JCR *jcr, int TermCode)
          sd_term_msg,
          term_msg);
    } else {
-      Jmsg(jcr, msg_type, 0, _("Bacula " VERSION " (" LSMDATE "): %s\n"
+      Jmsg(jcr, msg_type, 0, _("Bacula %s (%s): %s\n"
 "  JobId:                  %d\n"
 "  Job:                    %s\n"
 "  FileSet:                %s\n"
@@ -459,6 +465,8 @@ void verify_cleanup(JCR *jcr, int TermCode)
 "  Non-fatal FD errors:    %d\n"
 "  FD termination status:  %s\n"
 "  Termination:            %s\n\n"),
+         VERSION,
+         LSMDATE,
          edt,
          jcr->jr.JobId,
          jcr->jr.Job,