From 153e9f8e3bf991f1d4211c6a63f22841df6e27a7 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Wed, 7 Sep 2011 22:56:04 +0200 Subject: [PATCH] Fix spooldata and ignoreduplicates run command options to use JCR instead of the Job resource. --- bacula/src/dird/job.c | 11 ++++++----- bacula/src/dird/ua_run.c | 25 +++++++++++++++---------- bacula/src/jcr.h | 1 + 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/bacula/src/dird/job.c b/bacula/src/dird/job.c index 65fc720f61..fa6b1860cb 100644 --- a/bacula/src/dird/job.c +++ b/bacula/src/dird/job.c @@ -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); diff --git a/bacula/src/dird/ua_run.c b/bacula/src/dird/ua_run.c index af374c724d..986473cc3d 100644 --- a/bacula/src/dird/ua_run.c +++ b/bacula/src/dird/ua_run.c @@ -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")); diff --git a/bacula/src/jcr.h b/bacula/src/jcr.h index 3ee29e44c0..5c80e00111 100644 --- a/bacula/src/jcr.h +++ b/bacula/src/jcr.h @@ -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 */ -- 2.39.5