From: Eric Bollengier Date: Wed, 5 Nov 2008 14:46:07 +0000 (+0000) Subject: ebl Apply Bastian's patch that add spooldata=yes|no option X-Git-Tag: Release-3.0.0~641 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1d7ae48af53f1a58ccc7b43b00340b4ca71af8bc;p=bacula%2Fbacula ebl Apply Bastian's patch that add spooldata=yes|no option to run command. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7982 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/ua_run.c b/bacula/src/dird/ua_run.c index 6112a6ea95..3c6357c6a1 100644 --- a/bacula/src/dird/ua_run.c +++ b/bacula/src/dird/ua_run.c @@ -60,6 +60,8 @@ public: int files; bool cloned; bool mod; + int spool_data; + bool spool_data_set; /* Methods */ run_ctx() { memset(this, 0, sizeof(run_ctx)); @@ -174,6 +176,7 @@ try_again: start_job: Dmsg3(100, "JobId=%u using pool %s priority=%d\n", (int)jcr->JobId, jcr->pool->name(), jcr->JobPriority); + Dmsg1(900, "Running a job; its spool_data = %d\n", jcr->spool_data); JobId = run_job(jcr); Dmsg4(100, "JobId=%u NewJobId=%d using pool %s priority=%d\n", (int)jcr->JobId, JobId, jcr->pool->name(), jcr->JobPriority); @@ -1008,6 +1011,7 @@ static bool scan_command_line_arguments(UAContext *ua, run_ctx &rc) "backupclient", /* 23 */ "restoreclient", /* 24 */ "pluginoptions", /* 25 */ + "spooldata", /* 26 */ NULL}; #define YES_POS 14 @@ -1021,6 +1025,7 @@ static bool scan_command_line_arguments(UAContext *ua, run_ctx &rc) rc.fileset_name = NULL; rc.verify_job_name = NULL; rc.previous_job_name = NULL; + rc.spool_data_set = 0; for (i=1; iargc; i++) { @@ -1225,6 +1230,18 @@ static bool scan_command_line_arguments(UAContext *ua, run_ctx &rc) } kw_ok = true; break; + case 26: /* spooldata */ + if (rc.spool_data_set) { + ua->send_msg(_("Spool flag specified twice.\n")); + return false; + } + if (is_yesno(ua->argv[i], &rc.spool_data)) { + rc.spool_data_set = 1; + kw_ok = true; + } else { + ua->send_msg(_("Invalid spooldata flag.\n")); + } + break; default: break; } @@ -1305,6 +1322,11 @@ 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.store_name) { rc.store->store = GetStoreResWithName(rc.store_name); pm_strcpy(rc.store->store_source, _("command line")); diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index 8890336468..ccf0b64ec3 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -10,6 +10,9 @@ filepattern (restore with regex in bsr) mixed priorities General: +05Nov08 +ebl Apply Bastian's patch that add spooldata=yes|no option + to run command. 04Nov08 ebl Fix bash shell to sh shell in database creation script 02Nov08