2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-22 21:05:10 +00:00

rewrite: log snapshot saved before removal of the old snapshot

The snapshot was already saved before removing the old snapshot. Only
the log messages were printed in the wrong order.
This commit is contained in:
Michael Eischer 2023-04-17 21:00:45 +02:00
parent 913eab3361
commit 09cddb8927

View File

@ -136,6 +136,7 @@ func rewriteSnapshot(ctx context.Context, repo *repository.Repository, sn *resti
if err != nil {
return false, err
}
Verbosef("saved new snapshot %v\n", id.Str())
if opts.Forget {
h := restic.Handle{Type: restic.SnapshotFile, Name: sn.ID().String()}
@ -145,7 +146,6 @@ func rewriteSnapshot(ctx context.Context, repo *repository.Repository, sn *resti
debug.Log("removed old snapshot %v", sn.ID())
Verbosef("removed old snapshot %v\n", sn.ID().Str())
}
Verbosef("saved new snapshot %v\n", id.Str())
return true, nil
}