From ec5af180f5c964d2a8edabeff3a7d341aafb0213 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Tue, 7 Aug 2007 16:01:19 +0000 Subject: [PATCH] kes Modify the Verify output to specify if files are missing on the Volume(s) or disk. Fixes confusion in bug #916. kes When more than one Volume is read in a migration job, the last Volume bytes reported are from the last read volume rather than the last written volume. Fixed. This fixes bug #910. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5300 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/dird/migrate.c | 20 ++++++++++++++------ bacula/src/dird/verify.c | 8 ++++---- bacula/technotes-2.1 | 5 +++++ 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/bacula/src/dird/migrate.c b/bacula/src/dird/migrate.c index 32afb06a95..223328c1f5 100644 --- a/bacula/src/dird/migrate.c +++ b/bacula/src/dird/migrate.c @@ -1079,12 +1079,6 @@ void migration_cleanup(JCR *jcr, int TermCode) set_jcr_job_status(jcr, JS_ErrorTerminated); } - bstrncpy(mr.VolumeName, jcr->VolumeName, sizeof(mr.VolumeName)); - if (!db_get_media_record(jcr, jcr->db, &mr)) { - Jmsg(jcr, M_WARNING, 0, _("Error getting Media record for Volume \"%s\": ERR=%s"), - mr.VolumeName, db_strerror(jcr->db)); - set_jcr_job_status(jcr, JS_ErrorTerminated); - } update_bootstrap_file(mig_jcr); @@ -1100,6 +1094,20 @@ void migration_cleanup(JCR *jcr, int TermCode) } mig_jcr->VolumeName[0] = 0; /* none */ } + + if (mig_jcr->VolumeName[0]) { + /* Find last volume name. Multiple vols are separated by | */ + char *p = strrchr(mig_jcr->VolumeName, '|'); + if (!p) { + p = mig_jcr->VolumeName; + } + bstrncpy(mr.VolumeName, p, sizeof(mr.VolumeName)); + if (!db_get_media_record(jcr, jcr->db, &mr)) { + Jmsg(jcr, M_WARNING, 0, _("Error getting Media record for Volume \"%s\": ERR=%s"), + mr.VolumeName, db_strerror(jcr->db)); + } + } + switch (jcr->JobStatus) { case JS_Terminated: if (jcr->Errors || jcr->SDErrors) { diff --git a/bacula/src/dird/verify.c b/bacula/src/dird/verify.c index f32c738723..85651452b4 100644 --- a/bacula/src/dird/verify.c +++ b/bacula/src/dird/verify.c @@ -470,7 +470,7 @@ void verify_cleanup(JCR *jcr, int TermCode) jcr->jr.Job, jcr->fileset->hdr.name, level_to_str(jcr->JobLevel), - jcr->client->hdr.name, + jcr->client->name(), jcr->previous_jr.JobId, Name, sdt, @@ -761,8 +761,8 @@ static int missing_handler(void *ctx, int num_fields, char **row) return 1; } if (!jcr->fn_printed) { - Jmsg(jcr, M_INFO, 0, "\n"); - Jmsg(jcr, M_INFO, 0, _("The following files are in the Catalog but not on disk:\n")); + Jmsg(jcr, M_INFO, 0, _("\nThe following files are in the Catalog but not on %s:\n"), + jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG ? "the Volume(s)" : "disk"); jcr->fn_printed = true; } Jmsg(jcr, M_INFO, 0, " %s%s\n", row[0]?row[0]:"", row[1]?row[1]:""); @@ -777,6 +777,6 @@ static void prt_fname(JCR *jcr) { if (!jcr->fn_printed) { Jmsg(jcr, M_INFO, 0, _("File: %s\n"), jcr->fname); - jcr->fn_printed = TRUE; + jcr->fn_printed = true; } } diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index 6454893fe8..b43d5e6560 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -2,6 +2,11 @@ General: 07Aug07 +kes Modify the Verify output to specify if files are missing on + the Volume(s) or disk. Fixes confusion in bug #916. +kes When more than one Volume is read in a migration job, the last + Volume bytes reported are from the last read volume rather than + the last written volume. Fixed. This fixes bug #910. kes Fix display of Recycle flag after update volume=foo recycle=yes. It previously printed New Recyle flag is: no. This fixes bug #917. -- 2.39.5