mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 08:26:00 +01:00
Delete temp file before running backup (#6248)
(cherry picked from commit b4d148bdb0)
This commit is contained in:
parent
7716c4dd87
commit
cbb1c04fd5
1 changed files with 5 additions and 0 deletions
|
|
@ -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 != "" {
|
||||
|
|
|
|||
Loading…
Reference in a new issue