I have a question regarding the maxfull/maxdiff interval options, and how they
are implemented.
Normally I'd ask the users list, but I am again running into a design question
rather than an implementation question.
I had assumed they were meant so that one could set backups as incremental in
the schedules, and let Bacula handle things in an automated fashion. What I am
finding is that this is not completely the case.
Is this indeed the point of these options? If not then the below can be
disregarded.
If it is the case, then I think the implementation of MaxDiffInterval could use
2 tweaks:
1) Have Full backups count as well as Diff backups for satisfying
MaxDiff
2) Do not require a previous diff backup for this option to do anything
(looking at the code, it appears it is an errant case due to the code used
being copied from maxfull which handles missing fulls in a different manner
already)
One suggested patch (plus a minor comment fix) if the above assumption is
correct (Note: I am not a C coder so there may be issues, figured I'd still
try. It does compile and I am testing this internally now):
--- fd_cmds.c.old 2009-06-05 16:03:06.000000000 -0500
+++ fd_cmds.c 2009-06-05 16:33:28.000000000 -0500
@@ -194,8 +194,13 @@
have_full = db_find_job_start_time(jcr, jcr->db, &jcr->jr, &jcr->stime);
/* If there was a successful job, make sure it is recent enough */
if (jcr->get_JobLevel() == L_INCREMENTAL && have_full &&
jcr->job->MaxDiffInterval > 0) {
+ /* Lookup last full job */
+ if (db_find_last_job_start_time(jcr, jcr->db, &jcr->jr, &stime,
L_FULL)) {
+ last_full_time = str_to_utime(stime);
+ do_diff = ((now - last_full_time) >= jcr->job->MaxDiffInterval);
+ }
/* Lookup last diff job */
- if (db_find_last_job_start_time(jcr, jcr->db, &jcr->jr, &stime,
L_DIFFERENTIAL)) {
+ if (do_diff && db_find_last_job_start_time(jcr, jcr->db, &jcr->jr,
&stime, L_DIFFERENTIAL)) {
last_diff_time = str_to_utime(stime);
do_diff = ((now - last_diff_time) >= jcr->job->MaxDiffInterval);
}
@@ -215,7 +220,7 @@
level_to_str(jcr->get_JobLevel()));
jcr->set_JobLevel(jcr->jr.JobLevel = L_FULL);
} else if (do_diff) {
- /* No recent diff job found, so upgrade this one to Full */
+ /* 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"));
bsnprintf(since, since_len, _(" (upgraded from %s)"),
level_to_str(jcr->get_JobLevel()));
Blake Dunlap
The Nexus Group, Inc.
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Bacula-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-devel