From: Eric Bollengier Date: Tue, 9 Mar 2021 12:08:02 +0000 (+0100) Subject: Fix #7451 About deleted files incorrectly kept in Virtual Full X-Git-Tag: Release-11.0.2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd7756fea732cec99ca8367af813f1b9e1a774e3;p=thirdparty%2Fbacula.git Fix #7451 About deleted files incorrectly kept in Virtual Full --- diff --git a/bacula/src/dird/vbackup.c b/bacula/src/dird/vbackup.c index e0f69bc64..e2f52170c 100644 --- a/bacula/src/dird/vbackup.c +++ b/bacula/src/dird/vbackup.c @@ -590,8 +590,15 @@ static bool create_bootstrap_file(JCR *jcr, char *jobids) Jmsg0(jcr, M_FATAL, 0, "Can't get batch sql connexion"); return false; } - - if (!db_get_file_list(jcr, jcr->db_batch, jobids, DBL_USE_DELTA | DBL_ALL_FILES, + /* If the new Job is a Full, we don't need to keep deleted records, + * however, if it's an incremental/differential, we should not restore + * the files from the Full, so we keep the deleted records + */ + int opt = DBL_USE_DELTA; + if (jcr->jr.JobLevel != 'F') { + opt |= DBL_ALL_FILES; + } + if (!db_get_file_list(jcr, jcr->db_batch, jobids, opt, insert_bootstrap_handler, (void *)rx.bsr_list)) { Jmsg(jcr, M_ERROR, 0, "%s", db_strerror(jcr->db_batch));