diff --git a/cmd/stbak/cmd/restore.go b/cmd/stbak/cmd/restore.go index 4c8ea86..8f97c12 100644 --- a/cmd/stbak/cmd/restore.go +++ b/cmd/stbak/cmd/restore.go @@ -87,6 +87,10 @@ var restoreCmd = &cobra.Command{ return err } + if err := dstFile.Truncate(0); err != nil { + return err + } + if _, err := io.Copy(dstFile, tr); err != nil { return err }