Skip to content

Commit

Permalink
Remove backup from host after download (#373)
Browse files Browse the repository at this point in the history
  • Loading branch information
kke authored Apr 11, 2022
1 parent 39a3f13 commit 5e3d301
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions phase/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ func (p *Backup) Run() error {
return err
}

defer func() {
log.Debugf("%s: cleaning up %s", h, remoteFile)
if err := h.Configurer.DeleteFile(h, remoteFile); err != nil {
log.Warnf("%s: failed to clean up backup temp file %s: %s", h, remoteFile, err)
}
}()

localFile, err := filepath.Abs(fmt.Sprintf("k0s_backup_%d.tar.gz", time.Now().Unix()))
if err != nil {
return err
Expand Down

0 comments on commit 5e3d301

Please sign in to comment.