Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions src/command/verify/verify.c
Original file line number Diff line number Diff line change
Expand Up @@ -1910,6 +1910,19 @@ verifyProcess(const bool verboseText)
storage, STORAGE_REPO_BACKUP_STR,
.expression = backupRegExpStr),
sortOrderAsc);

// Warn if backups on disk are not described in backup.info
for (unsigned int repoIdx = 0; repoIdx < strLstSize(jobData.backupList); repoIdx++)
{
const String *const label = strLstGet(jobData.backupList, repoIdx);

if (!infoBackupLabelExists(backupInfo, label))
{
LOG_WARN_FMT(
"backup '%s' is not described in " INFO_BACKUP_FILE,
strZ(label));
}
}
}
else
jobData.backupList = strLstNew();
Expand Down Expand Up @@ -1947,6 +1960,31 @@ verifyProcess(const bool verboseText)
jobData.enableArchiveFilter = true;
}

// Check if backup.info contains backups not on disk and add them for processing.
if (!backupLabelInvalid && backupLabel == NULL)
{
const StringList *infoBackupLabelList = infoBackupDataLabelList(backupInfo, NULL);

for (unsigned int infoIdx = 0; infoIdx < strLstSize(infoBackupLabelList); infoIdx++)
{
const String *infoLabel = strLstGet(infoBackupLabelList, infoIdx);

if (strLstFindIdxP(jobData.backupList, infoLabel) == LIST_NOT_FOUND)
{
LOG_WARN_FMT(
"backup '%s' exists in " INFO_BACKUP_FILE " but was not found on disk",
strZ(infoLabel));

MEM_CONTEXT_BEGIN(jobData.memContext)
{
strLstAdd(jobData.backupList, strDup(infoLabel));
}
MEM_CONTEXT_END();
}
}
jobData.backupList = strLstSort(jobData.backupList, sortOrderAsc);
}

// Only begin processing if there are some archives or backups in the repo
if (!strLstEmpty(jobData.archiveIdList) || !strLstEmpty(jobData.backupList))
{
Expand Down
Loading