]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix spooldata and ignoreduplicates run command options to use JCR instead
authorEric Bollengier <eric@eb.homelinux.org>
Wed, 7 Sep 2011 20:56:04 +0000 (22:56 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Wed, 7 Sep 2011 20:58:35 +0000 (22:58 +0200)
of the Job resource.

bacula/src/dird/job.c
bacula/src/dird/ua_run.c
bacula/src/jcr.h

index 65fc720f61b2e3d0418b6b0b17667872d69ad204..fa6b1860cbfc663274646587bfa3a432994f211e 100644 (file)
@@ -703,7 +703,7 @@ bool allow_duplicate_job(JCR *jcr)
     * See if AllowDuplicateJobs is set or
     * if duplicate checking is disabled for this job.
     */
-   if (job->AllowDuplicateJobs || job->IgnoreDuplicateJobChecking) {
+   if (job->AllowDuplicateJobs || jcr->IgnoreDuplicateJobChecking) {
       return true;
    }
 
@@ -720,10 +720,10 @@ bool allow_duplicate_job(JCR *jcr)
       }
 
       /*
-       * See if this Job has the IgnoreDuplicateJobChecking flag set, ignore it for any
-       * checking against other jobs.
+       * See if this Job has the IgnoreDuplicateJobChecking flag set, ignore it
+       * for any checking against other jobs.
        */
-      if (djcr->job && djcr->job->IgnoreDuplicateJobChecking) {
+      if (djcr->IgnoreDuplicateJobChecking) {
          continue;
       }
 
@@ -1186,11 +1186,12 @@ void set_jcr_defaults(JCR *jcr, JOB *job)
       pm_strcpy(jcr->catalog_source, _("Client resource"));
    }
    jcr->fileset = job->fileset;
+   jcr->accurate = job->accurate;
    jcr->messages = job->messages;
    jcr->spool_data = job->spool_data;
    jcr->spool_size = job->spool_size;
    jcr->write_part_after_job = job->write_part_after_job;
-   jcr->accurate = job->accurate;
+   jcr->IgnoreDuplicateJobChecking = job->IgnoreDuplicateJobChecking;
    jcr->MaxRunSchedTime = job->MaxRunSchedTime;
    if (jcr->RestoreBootstrap) {
       free(jcr->RestoreBootstrap);
index af374c724d688d0b2e22cc7182bd27ccc42f729d..986473cc3dc4740a3de25d57d6dfc5ee820cc891 100644 (file)
@@ -205,6 +205,21 @@ bail_out:
 int modify_job_parameters(UAContext *ua, JCR *jcr, run_ctx &rc)
 {
    int i, opt;
+   
+   /* Some options are not available through the menu
+    * TODO: Add an advanced menu?
+    */
+   if (rc.spool_data_set) {
+      jcr->spool_data = rc.spool_data;
+   }
+
+   /* Used by migration jobs that can have the same name,
+    * but can run at the same time
+    */
+   if (rc.ignoreduplicatecheck_set) {
+      jcr->IgnoreDuplicateJobChecking = rc.ignoreduplicatecheck;
+   }
+
    /*
     * At user request modify parameters of job to be run.
     */
@@ -1517,16 +1532,6 @@ static bool scan_command_line_arguments(UAContext *ua, run_ctx &rc)
    }
    Dmsg1(100, "Using pool %s\n", rc.pool->name());
 
-   if (rc.spool_data_set) {
-      rc.job->spool_data = rc.spool_data;
-   }
-   Dmsg1(900, "Spooling data: %s\n", (rc.job->spool_data ? "Yes" : "No"));
-
-   if (rc.ignoreduplicatecheck) {
-      rc.job->IgnoreDuplicateJobChecking = rc.ignoreduplicatecheck;
-   }
-   Dmsg1(900, "Ignore Duplicate Job Check: %s\n", (rc.job->IgnoreDuplicateJobChecking ? "Yes" : "No"));
-
    if (rc.store_name) {
       rc.store->store = GetStoreResWithName(rc.store_name);
       pm_strcpy(rc.store->store_source, _("command line"));
index 3ee29e44c0c9ef0d93470ded3813628e72324b8c..5c80e00111a5066dcad97eb234e46162a8e3e49f 100644 (file)
@@ -344,6 +344,7 @@ public:
    int32_t FDVersion;                 /* File daemon version number */
    int64_t spool_size;                /* Spool size for this job */
    bool wasVirtualFull;               /* set if job was VirtualFull */
+   bool IgnoreDuplicateJobChecking;   /* set in migration jobs */
    bool spool_data;                   /* Spool data in SD */
    bool acquired_resource_locks;      /* set if resource locks acquired */
    bool term_wait_inited;             /* Set when cond var inited */