]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/verify.c
First cut at Duplicate Job implementation.
[bacula/bacula] / bacula / src / dird / verify.c
index 17e1443c50b1e89bbad60b1b1568d0a87c5ab4c3..57663a26e29c9f0ac2629e9863a14782bc235070 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -66,6 +66,9 @@ static int missing_handler(void *ctx, int num_fields, char **row);
  */
 bool do_verify_init(JCR *jcr) 
 {
+   if (!allow_duplicate_job(jcr)) {
+      return false;
+   }
    return true;
 }
 
@@ -193,7 +196,7 @@ bool do_verify(JCR *jcr)
       if (!start_storage_daemon_job(jcr, jcr->rstorage, NULL)) {
          return false;
       }
-      if (!bnet_fsend(jcr->store_bsock, "run")) {
+      if (!jcr->store_bsock->fsend("run")) {
          return false;
       }
       /*
@@ -332,13 +335,10 @@ bool do_verify(JCR *jcr)
    }
 
    stat = wait_for_job_termination(jcr);
-   if (stat == JS_Terminated) {
-      verify_cleanup(jcr, stat);
-      return true;
-   }
+   verify_cleanup(jcr, stat);
+   return true;
 
 bail_out:
-   verify_cleanup(jcr, JS_ErrorTerminated);
    return false;
 }
 
@@ -421,7 +421,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 %s %s (%s): %s\n"
+      Jmsg(jcr, msg_type, 0, _("Bacula %s %s (%s): %s\n"
 "  Build OS:               %s %s %s\n"
 "  JobId:                  %d\n"
 "  Job:                    %s\n"
@@ -456,7 +456,7 @@ void verify_cleanup(JCR *jcr, int TermCode)
          sd_term_msg,
          term_msg);
    } else {
-   Jmsg(jcr, msg_type, 0, _("Bacula %s %s (%s): %s\n"
+      Jmsg(jcr, msg_type, 0, _("Bacula %s %s (%s): %s\n"
 "  Build:                  %s %s %s\n"
 "  JobId:                  %d\n"
 "  Job:                    %s\n"
@@ -750,7 +750,9 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId)
       stat = JS_Differences;
    }
    free_pool_memory(fname);
-   set_jcr_job_status(jcr, stat);
+   if (!job_canceled(jcr)) {
+      jcr->JobStatus = stat;
+   }
    return stat == JS_Terminated;
 }
 
@@ -768,11 +770,11 @@ static int missing_handler(void *ctx, int num_fields, char **row)
       return 1;
    }
    if (!jcr->fn_printed) {
-      Jmsg(jcr, M_INFO, 0, _("\nThe following files are in the Catalog but not on %s:\n"),
+      Qmsg(jcr, M_INFO, 0, _("\nThe following files are in the Catalog but not on %s:\n"),
        jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG ? "the Volume(s)" : "disk");
       jcr->fn_printed = true;
    }
-   Jmsg(jcr, M_INFO, 0, "      %s%s\n", row[0]?row[0]:"", row[1]?row[1]:"");
+   Qmsg(jcr, M_INFO, 0, "      %s%s\n", row[0]?row[0]:"", row[1]?row[1]:"");
    return 0;
 }