From 1db50e877f1d8625f9765a9861642d99bdd708a9 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Sun, 10 Feb 2008 17:20:31 +0000 Subject: [PATCH] ebl Upgrade current JobLevel if BackupId is not found git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6394 91ce42f0-d328-0410-95d8-f526ca767f89 --- .../testing/project-accurate-backup.patch | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/bacula/patches/testing/project-accurate-backup.patch b/bacula/patches/testing/project-accurate-backup.patch index 53c08a9439..5897c180f5 100644 --- a/bacula/patches/testing/project-accurate-backup.patch +++ b/bacula/patches/testing/project-accurate-backup.patch @@ -11,7 +11,20 @@ Index: src/dird/fd_cmds.c static char runscript[] = "Run OnSuccess=%u OnFailure=%u AbortOnError=%u When=%u Command=%s\n"; static char runbeforenow[]= "RunBeforeNow\n"; -@@ -217,7 +217,7 @@ +@@ -189,6 +189,12 @@ + bsnprintf(since, since_len, _(" (upgraded from %s)"), + level_to_str(jcr->JobLevel)); + jcr->JobLevel = jcr->jr.JobLevel = L_FULL; ++ /* look if we found the last accurate backup */ ++ } else if (jcr->accurate && !db_accurate_find_backupid(jcr, jcr->db, &jcr->jr)) { ++ Jmsg(jcr, M_INFO, 0, _("No prior or suitable Full accurate backup found in catalog. Doing FULL backup.\n")); ++ bsnprintf(since, since_len, _(" (upgraded from %s)"), ++ level_to_str(jcr->JobLevel)); ++ jcr->JobLevel = jcr->jr.JobLevel = L_FULL; + } else { + if (jcr->job->rerun_failed_levels) { + if (db_find_failed_job_since(jcr, jcr->db, &jcr->jr, jcr->stime, JobLevel)) { +@@ -217,7 +223,7 @@ char ed1[50]; stime = str_to_utime(jcr->stime); @@ -20,7 +33,7 @@ Index: src/dird/fd_cmds.c while (bget_dirmsg(fd) >= 0) { /* allow him to poll us to sync clocks */ Jmsg(jcr, M_INFO, 0, "%s\n", fd->msg); } -@@ -231,24 +231,25 @@ +@@ -231,24 +237,25 @@ bool send_level_command(JCR *jcr) { BSOCK *fd = jcr->file_bsock; @@ -284,8 +297,8 @@ Index: src/dird/backup.c + * Accurate backup mode + * 1. Receive the list of all files including those backed up to the Dir + * 2. Dir computes files and deleted files. -+ * 3. Dir sends list of additional files (new files) to backup, and list of files -+ * deleted. ++ * 3. Dir sends list of additional files (new files) to backup, ++ * and list of files deleted. + * + * Cleanup attributes (don't use atime, inode etc..) + * Need to insert file and attributes to temp table ? @@ -319,7 +332,7 @@ Index: src/dird/backup.c + + backupid = db_accurate_find_backupid(jcr, jcr->db, &jcr->jr); + if (!backupid) { -+ Jmsg(jcr, M_ERROR, 0, _("Can't use Accurate mode ERR=Can't find BackupId\n")); ++ Jmsg(jcr, M_FATAL, 0, _("Can't use Accurate mode ERR=Can't find BackupId\n")); + return false; + } + db_accurate_create_tobackup_table(jcr, jcr->db, jcr->JobId); @@ -1021,7 +1034,7 @@ Index: src/cats/sql_find.c =================================================================== --- src/cats/sql_find.c (révision 6372) +++ src/cats/sql_find.c (copie de travail) -@@ -190,7 +190,60 @@ +@@ -190,7 +190,64 @@ return true; } @@ -1038,6 +1051,10 @@ Index: src/cats/sql_find.c + char ed1[50],ed2[50]; + JobId_t backupid=0; ++ if (jcr->accurate == false) { ++ return 0; ++ } ++ + /* Find backupid */ + db_lock(mdb); + Dmsg2(100, "JobLevel=%d JobType=%d\n", jcr->JobLevel, jcr->JobType); -- 2.39.5