From cbb1c04fd559eb41baea78fceec936a35dbcac52 Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Mon, 10 Nov 2025 09:20:48 +1100 Subject: [PATCH] Delete temp file before running backup (#6248) (cherry picked from commit b4d148bdb079f631337c0b8af554839786927b68) --- internal/manager/manager.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/manager/manager.go b/internal/manager/manager.go index 4827a3e3d..ca70b1c13 100644 --- a/internal/manager/manager.go +++ b/internal/manager/manager.go @@ -322,6 +322,11 @@ func (s *Manager) BackupDatabase(download bool) (string, string, error) { backupPath = f.Name() backupName = s.Database.DatabaseBackupPath("") f.Close() + + // delete the temp file so that the backup operation can create it + if err := os.Remove(backupPath); err != nil { + return "", "", fmt.Errorf("could not remove temporary backup file %v: %w", backupPath, err) + } } else { backupDir := s.Config.GetBackupDirectoryPathOrDefault() if backupDir != "" {