From 8e91473a9469d988496e8c55ae69d106cfe22a8a Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 10 Oct 2008 10:26:09 +0000 Subject: [PATCH] Move generation of bsr file for Virtual Backup to run section so that it is generated just before actually running. Suggested by Graham Keeling. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7743 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/dird/vbackup.c | 79 ++++++++++++++++++++------------------- bacula/src/version.h | 6 +-- bacula/technotes-2.5 | 4 ++ 3 files changed, 47 insertions(+), 42 deletions(-) diff --git a/bacula/src/dird/vbackup.c b/bacula/src/dird/vbackup.c index df556d11a5..8b098226c7 100644 --- a/bacula/src/dird/vbackup.c +++ b/bacula/src/dird/vbackup.c @@ -61,7 +61,6 @@ void vbackup_cleanup(JCR *jcr, int TermCode); */ bool do_vbackup_init(JCR *jcr) { - char *p; if (!get_or_create_fileset_record(jcr)) { Dmsg1(dbglevel, "JobId=%d no FileSet\n", (int)jcr->JobId); @@ -101,44 +100,6 @@ bool do_vbackup_init(JCR *jcr) Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db)); } - POOLMEM *jobids = get_pool_memory(PM_FNAME); - jcr->jr.JobLevel = L_VIRTUAL_FULL; - db_accurate_get_jobids(jcr, jcr->db, &jcr->jr, jobids); - jcr->jr.JobLevel = L_FULL; - Dmsg1(10, "Accurate jobids=%s\n", jobids); - if (*jobids == 0) { - free_pool_memory(jobids); - Jmsg(jcr, M_FATAL, 0, _("Cannot find previous JobIds.\n")); - return false; - } - - /* - * Now we find the last job that ran and store it's info in - * the previous_jr record. We will set our times to the - * values from that job so that anything changed after that - * time will be picked up on the next backup. - */ - p = strrchr(jobids, ','); /* find last jobid */ - if (p != NULL) { - p++; - } else { - p = jobids; - } - memset(&jcr->previous_jr, 0, sizeof(jcr->previous_jr)); - jcr->previous_jr.JobId = str_to_int64(p); - Dmsg1(10, "Previous JobId=%s\n", p); - if (!db_get_job_record(jcr, jcr->db, &jcr->previous_jr)) { - Jmsg(jcr, M_FATAL, 0, _("Error getting Job record for previous Job: ERR=%s"), - db_strerror(jcr->db)); - return false; - } - - if (!create_bootstrap_file(jcr, jobids)) { - Jmsg(jcr, M_FATAL, 0, _("Could not get or create the FileSet record.\n")); - free_pool_memory(jobids); - return false; - } - free_pool_memory(jobids); /* * If the original backup pool has a NextPool, make sure a @@ -175,6 +136,7 @@ bool do_vbackup(JCR *jcr) { char ed1[100]; BSOCK *sd; + char *p; Dmsg2(100, "rstorage=%p wstorage=%p\n", jcr->rstorage, jcr->wstorage); Dmsg2(100, "Read store=%s, write store=%s\n", @@ -197,6 +159,45 @@ bool do_vbackup(JCR *jcr) _("This Job is not an Accurate backup so is not equivalent to a Full backup.\n")); } + POOLMEM *jobids = get_pool_memory(PM_FNAME); + jcr->jr.JobLevel = L_VIRTUAL_FULL; + db_accurate_get_jobids(jcr, jcr->db, &jcr->jr, jobids); + jcr->jr.JobLevel = L_FULL; + Dmsg1(10, "Accurate jobids=%s\n", jobids); + if (*jobids == 0) { + free_pool_memory(jobids); + Jmsg(jcr, M_FATAL, 0, _("Cannot find previous JobIds.\n")); + return false; + } + + /* + * Now we find the last job that ran and store it's info in + * the previous_jr record. We will set our times to the + * values from that job so that anything changed after that + * time will be picked up on the next backup. + */ + p = strrchr(jobids, ','); /* find last jobid */ + if (p != NULL) { + p++; + } else { + p = jobids; + } + memset(&jcr->previous_jr, 0, sizeof(jcr->previous_jr)); + jcr->previous_jr.JobId = str_to_int64(p); + Dmsg1(10, "Previous JobId=%s\n", p); + if (!db_get_job_record(jcr, jcr->db, &jcr->previous_jr)) { + Jmsg(jcr, M_FATAL, 0, _("Error getting Job record for previous Job: ERR=%s"), + db_strerror(jcr->db)); + return false; + } + + if (!create_bootstrap_file(jcr, jobids)) { + Jmsg(jcr, M_FATAL, 0, _("Could not get or create the FileSet record.\n")); + free_pool_memory(jobids); + return false; + } + free_pool_memory(jobids); + /* * Open a message channel connection with the Storage * daemon. This is to let him know that our client diff --git a/bacula/src/version.h b/bacula/src/version.h index ea8d190ac3..f1bad0be54 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -3,9 +3,9 @@ */ #undef VERSION -#define VERSION "2.5.12" -#define BDATE "07 October 2008" -#define LSMDATE "07Oct08" +#define VERSION "2.5.13" +#define BDATE "10 October 2008" +#define LSMDATE "10Oct08" #define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n" #define BYEAR "2008" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index 33e2ca5aa7..8bd5a9e4d8 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -17,6 +17,10 @@ dbdriver remove reader/writer in FOPTS???? General: +10Oct08 +kes Move generation of bsr file for Virtual Backup to run section + so that it is generated just before actually running. + Suggested by Graham Keeling. 09Oct08 kes Add malloc and free Bacula entry points for plugins. Increment FD plugin interface version. Create a bacula plugin context -- 2.39.5