hi

i'm backing up some clients over the internet. i would like to use 
the MaxFullInterval config, but it needs to upgrade to VirtualFull 
and not to a plain full.

see the patch below. It  introduces MaxFullIntervalAsVirtual BOOL 
config (dird_conf.c). In fd_cmds.c it checks if this config is set 
and upgrades to VirtualFull.

if other virtual levels are planned/exists, maybe the config should better
 be called more generic like "LevelUpgradesAsVirtual".

be aware  that i'm really not a C programmer, I only tried. :)

- Thomas



diff --git a/bacula/src/dird/dird_conf.c b/bacula/src/dird/dird_conf.c
index da7db73..a4e5018 100644
--- a/bacula/src/dird/dird_conf.c
+++ b/bacula/src/dird/dird_conf.c
@@ -307,6 +307,7 @@ RES_ITEM job_items[] = {
    {"maxwaittime",  store_time, ITEM(res_job.MaxWaitTime), 0, 0, 0},
    {"maxstartdelay",store_time, ITEM(res_job.MaxStartDelay), 0, 0, 0},
    {"maxfullinterval",  store_time, ITEM(res_job.MaxFullInterval), 0, 0, 0},
+   {"maxfullintervalasvirtual",store_bool, 
ITEM(res_job.MaxFullIntervalAsVirtual), 0, ITEM_DEFAULT, false},
    {"maxdiffinterval",  store_time, ITEM(res_job.MaxDiffInterval), 0, 0, 0},
    {"prefixlinks", store_bool, ITEM(res_job.PrefixLinks), 0, ITEM_DEFAULT, 
false},
    {"prunejobs",   store_bool, ITEM(res_job.PruneJobs), 0, ITEM_DEFAULT, 
false},
diff --git a/bacula/src/dird/fd_cmds.c b/bacula/src/dird/fd_cmds.c
index 6b99d99..fbd9b50 100644
--- a/bacula/src/dird/fd_cmds.c
+++ b/bacula/src/dird/fd_cmds.c
@@ -242,10 +242,17 @@ void get_level_since_time(JCR *jcr, char *since, int 
since_len)
       if (do_full) {
          /* No recent Full job found, so upgrade this one to Full */
          Jmsg(jcr, M_INFO, 0, "%s", db_strerror(jcr->db));
-         Jmsg(jcr, M_INFO, 0, _("No prior or suitable Full backup found in 
catalog. Doing FULL backup.\n"));
-         bsnprintf(since, since_len, _(" (upgraded from %s)"),
-            level_to_str(jcr->getJobLevel()));
-         jcr->set_JobLevel(jcr->jr.JobLevel = L_FULL);
+         if (have_full && jcr->job->MaxFullIntervalAsVirtual) {
+            Jmsg(jcr, M_INFO, 0, _("No prior or suitable Full backup found in 
catalog. Doing VirtualFull backup.\n"));
+            bsnprintf(since, since_len, _(" (upgraded from %s)"),
+               level_to_str(jcr->getJobLevel()));
+            jcr->set_JobLevel(jcr->jr.JobLevel = L_VIRTUAL_FULL);
+         } else {
+            Jmsg(jcr, M_INFO, 0, _("No prior or suitable Full backup found in 
catalog. Doing FULL backup.\n"));
+            bsnprintf(since, since_len, _(" (upgraded from %s)"),
+               level_to_str(jcr->getJobLevel()));
+            jcr->set_JobLevel(jcr->jr.JobLevel = L_FULL);
+         }
        } else if (do_diff) {
          /* No recent diff job found, so upgrade this one to Diff */
          Jmsg(jcr, M_INFO, 0, _("No prior or suitable Differential backup 
found in catalog. Doing Differential backup.\n"));


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Bacula-devel mailing list
Bacula-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to