From 6fdac3950371b5c1c8f0abba89800e45b075a68f Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 2 Jul 2009 12:31:15 +0000 Subject: [PATCH] ebl Add estimate accurate=yes/no ebl Change the code to check jcr->accurate and not jcr->job->accurate git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8949 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/dird/fd_cmds.c | 2 +- bacula/src/dird/ua_cmds.c | 16 +++++++++++++++- bacula/technotes | 2 ++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/bacula/src/dird/fd_cmds.c b/bacula/src/dird/fd_cmds.c index 762850e5be..caced8435d 100644 --- a/bacula/src/dird/fd_cmds.c +++ b/bacula/src/dird/fd_cmds.c @@ -291,7 +291,7 @@ static void send_since_time(JCR *jcr) bool send_level_command(JCR *jcr) { BSOCK *fd = jcr->file_bsock; - const char *accurate = jcr->job->accurate?"accurate_":""; + const char *accurate = jcr->accurate?"accurate_":""; const char *not_accurate = ""; /* * Send Level command to File daemon diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index 2e5defaa99..0ac8ba0fb6 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -1137,6 +1137,7 @@ static int estimate_cmd(UAContext *ua, const char *cmd) int listing = 0; char since[MAXSTRING]; JCR *jcr = ua->jcr; + int accurate=-1; jcr->set_JobLevel(L_FULL); for (int i=1; iargc; i++) { @@ -1204,6 +1205,12 @@ static int estimate_cmd(UAContext *ua, const char *cmd) return 1; } } + if (strcasecmp(ua->argk[i], NT_("accurate")) == 0) { + if (!is_yesno(ua->argv[i], &accurate)) { + ua->error_msg(_("Invalid value for accurate. " + "It must be yes or no.\n")); + } + } } if (!job && !(client && fileset)) { if (!(job = select_job_resource(ua))) { @@ -1270,6 +1277,13 @@ static int estimate_cmd(UAContext *ua, const char *cmd) goto bail_out; } + /* The level string change if accurate mode is enabled */ + if (accurate >= 0) { + jcr->accurate = accurate; + } else { + jcr->accurate = job->accurate; + } + if (!send_level_command(jcr)) { goto bail_out; } @@ -1278,7 +1292,7 @@ static int estimate_cmd(UAContext *ua, const char *cmd) * If the job is in accurate mode, we send the list of * all files to FD. */ - jcr->accurate = job->accurate; + Dmsg1(40, "estimate accurate=%i\n", jcr->accurate); if (!send_accurate_current_files(jcr)) { goto bail_out; } diff --git a/bacula/technotes b/bacula/technotes index f229aecb4d..7588eff492 100644 --- a/bacula/technotes +++ b/bacula/technotes @@ -5,6 +5,8 @@ General: 02Jul09 kes Another fix for bug #1311 to get the correct last_full_time ebl Make estimate command accurate compatible. Should fix #1318 +ebl Add estimate accurate=yes/no +ebl Change the code to check jcr->accurate and not jcr->job->accurate 01Jul09 kes Fix bug #1317 Allow duplicate jobs = no does not work kes Eliminate double job report when do_xxx_init() returns failure -- 2.39.5