diff --git a/src/dird/ua.h b/src/dird/ua.h index 56574450c23..5fd2db5f487 100644 --- a/src/dird/ua.h +++ b/src/dird/ua.h @@ -169,6 +169,7 @@ class RUN_CTX { CATRES *catalog; int Priority; int files; + int level_override; int spool_data; int accurate; int ignoreduplicatecheck; diff --git a/src/dird/ua_run.c b/src/dird/ua_run.c index 1732dcf4782..4f6d4420c28 100644 --- a/src/dird/ua_run.c +++ b/src/dird/ua_run.c @@ -371,8 +371,7 @@ int run_cmd(UAContext *ua, const char *cmd) } /* - * Create JCR to run job. NOTE!!! after this point, free_jcr() - * before returning. + * Create JCR to run job. NOTE!!! after this point, free_jcr() before returning. */ if (!jcr) { jcr = new_jcr(sizeof(JCR), dird_free_jcr); @@ -594,6 +593,8 @@ int modify_job_parameters(UAContext *ua, JCR *jcr, RUN_CTX &rc) case JT_BACKUP: if (!jcr->is_JobLevel(L_VIRTUAL_FULL)) { apply_pool_overrides(jcr, true); + rc.pool = jcr->res.pool; + rc.level_override = true; } break; default: @@ -680,6 +681,7 @@ int modify_job_parameters(UAContext *ua, JCR *jcr, RUN_CTX &rc) rc.pool = select_pool_resource(ua); if (rc.pool) { jcr->res.pool = rc.pool; + rc.level_override = false; Dmsg1(100, "Set new pool=%s\n", jcr->res.pool->name()); goto try_again; } @@ -818,8 +820,7 @@ int modify_job_parameters(UAContext *ua, JCR *jcr, RUN_CTX &rc) /* * Reset the restore context. - * This subroutine can be called multiple times, so it - * must keep any prior settings. + * This subroutine can be called multiple times, so it must keep any prior settings. */ static bool reset_restore_context(UAContext *ua, JCR *jcr, RUN_CTX &rc) { @@ -837,7 +838,7 @@ static bool reset_restore_context(UAContext *ua, JCR *jcr, RUN_CTX &rc) if (rc.pool_name) { pm_strcpy(jcr->res.pool_source, _("command line")); jcr->IgnoreLevelPoolOverides = true; - } else if (jcr->res.pool != jcr->res.job->pool) { + } else if (!rc.level_override && jcr->res.pool != jcr->res.job->pool) { pm_strcpy(jcr->res.pool_source, _("user input")); } set_rwstorage(jcr, rc.store);