Skip to content

Commit

Permalink
Save backup deletion statuses if any errors occur during deletion pro…
Browse files Browse the repository at this point in the history
…cess for local backups.
  • Loading branch information
woblerr committed Jul 14, 2024
1 parent e739b57 commit 8593d50
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/backup_clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func cleanBackup() error {
err = backupCleanFilePlugin(backupCleanCascade, beforeTimestamp, backupCleanPluginConfigFile, pluginConfig, &parseHData)
if err != nil {
// In current implementation, there are cases where some backups were deleted, and some were not.
// Foe example, the clean command was executed without --cascade option.
// For example, the clean command was executed without --cascade option.
// In this case - metadata backup was deleted, but full + incremental - weren't.
// We should update the history file even it error occurred.
errUpdateHFile := parseHData.UpdateHistoryFile(hFile)
Expand All @@ -179,6 +179,10 @@ func cleanBackup() error {
} else {
err := backupCleanFileLocal(backupCleanCascade, beforeTimestamp, &parseHData)
if err != nil {
errUpdateHFile := parseHData.UpdateHistoryFile(hFile)
if errUpdateHFile != nil {
gplog.Error(textmsg.ErrorTextUnableActionHistoryFile("update", errUpdateHFile))
}
return err
}
}
Expand Down Expand Up @@ -249,7 +253,6 @@ func backupCleanFileLocal(deleteCascade bool, cutOffTimestamp string, parseHData
backupList := getBackupNamesBeforeTimestampFile(cutOffTimestamp, false, parseHData)
gplog.Debug(textmsg.InfoTextBackupDeleteList(backupList))
err := backupDeleteFileLocal(backupList, "", deleteCascade, false, false, 1, parseHData)

if err != nil {
return err
}
Expand Down

0 comments on commit 8593d50

Please sign in to comment.