From 0f8ee5f0d81d2d7f407734bceb7a0c0b486cee3a Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Mon, 15 Dec 2008 17:01:53 +0000 Subject: [PATCH] ebl Copy joblog after a Copy job git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8168 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/dird/migrate.c | 14 ++++++++++++++ bacula/technotes-2.5 | 4 +++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/bacula/src/dird/migrate.c b/bacula/src/dird/migrate.c index 655c5a30fd..b2d3fb4256 100644 --- a/bacula/src/dird/migrate.c +++ b/bacula/src/dird/migrate.c @@ -1155,6 +1155,20 @@ void migration_cleanup(JCR *jcr, int TermCode) free_ua_context(ua); } + /* + * If we terminated a copy normally: + * - copy any Log records to the new JobId + */ + if (jcr->get_JobType() == JT_COPY && jcr->JobStatus == JS_Terminated) { + UAContext *ua = new_ua_context(jcr); + /* Copy JobLog to new JobId */ + Mmsg(query, "INSERT INTO Log (JobId, Time, LogText ) " + "SELECT %s, Time, LogText FROM Log WHERE JobId=%s", + new_jobid, old_jobid); + db_sql_query(mig_jcr->db, query.c_str(), NULL, NULL); + free_ua_context(ua); + } + if (!db_get_job_record(jcr, jcr->db, &jcr->jr)) { Jmsg(jcr, M_WARNING, 0, _("Error getting Job record for Job report: ERR=%s"), db_strerror(jcr->db)); diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index 3b413cff03..3ce50854ef 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -10,9 +10,11 @@ filepattern (restore with regex in bsr) mixed priorities General: +15Dec08 +ebl Copy joblog after a Copy job +14Dec08 kes Tweak block.c read to more closely simulate write for computing block addresses and turn on disk block testing. -14Dec08 kes Implement a crude 'list joblog' mostly for debugging. 13Dec08 kes Fix Migration bug #1206 sql error with NULL FileSetId when no jobs -- 2.39.5