Skip to content

Commit 1fde657

Browse files
authored
Merge pull request #1159 from elliott-logrocket/error-on-watch-when-delete-source-not-specified
Checking that the local backup hasn't already been deleted by the cre…
2 parents 54f6f0b + 3081417 commit 1fde657

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/backup/watch.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ func (b *Backuper) Watch(watchInterval, fullInterval, watchBackupNameTemplate, t
124124
createRemoteErr, createRemoteErrCount = metrics.ExecuteWithMetrics("create_remote", createRemoteErrCount, func() error {
125125
return b.CreateToRemote(backupName, deleteSource, "", diffFromRemote, tablePattern, partitions, skipProjections, schemaOnly, backupRBAC, false, backupConfigs, false, skipCheckPartsColumns, false, version, commandId)
126126
})
127-
if !deleteSource {
127+
// If backups_to_keep_local=-1 then the local backup is deleted in the upload step when RemoveOldBackupsLocal is called
128+
if !deleteSource && b.cfg.General.BackupsToKeepLocal >= 0 {
128129
deleteLocalErr, deleteLocalErrCount = metrics.ExecuteWithMetrics("delete", deleteLocalErrCount, func() error {
129130
return b.RemoveBackupLocal(ctx, backupName, nil)
130131
})

0 commit comments

Comments
 (0)