Skip to content

Commit

Permalink
Fix bug in keep-versions logic where dangling partials were removed.
Browse files Browse the repository at this point in the history
If the most recent backups were partials (and not followed by a full
backup), they should not be removed.  A partial backup should only be
removed if it is followed by a full backup.

This concerns issue duplicati#3982.
  • Loading branch information
warwickmm committed Nov 29, 2019
1 parent afecf89 commit a47175a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Duplicati/Library/Main/Operation/DeleteHandler.cs
Expand Up @@ -239,16 +239,17 @@ private DateTime[] GetFilesetsToDelete(Database.LocalDeleteDatabase db, DateTime
bool isFullBackup = db.IsFilesetFullBackup(backup);
if (isFullBackup)
{
if (haveFullBackup)
{
toDelete.AddRange(intermediatePartials);
intermediatePartials.Clear();
}
toDelete.AddRange(intermediatePartials);
intermediatePartials.Clear();
haveFullBackup = true;
}
else
{
intermediatePartials.Add(backup);
// Only consider a partial backup for deletion if we have already encountered a full backup.
if (haveFullBackup)
{
intermediatePartials.Add(backup);
}
}

if (fullVersionsKeptCount < fullVersionsToKeep)
Expand Down

0 comments on commit a47175a

Please sign in to comment.