From 7f8f8ac4c6dc52821b03d3e1289d8db8a1cd48fb Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Wed, 5 Nov 2008 14:46:07 +0000 Subject: [PATCH] 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 --- bacula/src/dird/ua_run.c | 22 ++++++++++++++++++++++ bacula/technotes-2.5 | 3 +++ 2 files changed, 25 insertions(+) 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 -- 2.39.5