From 06141ce1f4cf6bebf0615017fe9aec9dc898941d Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Mon, 31 Oct 2022 18:59:49 +0100 Subject: [PATCH] backup: print full snapshot id in JSON summary --- changelog/unreleased/issue-2724 | 9 +++++++++ internal/ui/backup/json.go | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/issue-2724 diff --git a/changelog/unreleased/issue-2724 b/changelog/unreleased/issue-2724 new file mode 100644 index 000000000..f8b605837 --- /dev/null +++ b/changelog/unreleased/issue-2724 @@ -0,0 +1,9 @@ +Change: Include full snapshot ID in JSON output of the bacukp command + +We have changed the JSON output of the backup command to include the full snapshot ID instead of just a shortened version. +The latter can be ambiguous in rare cases. + +To derive the short ID, truncate the full ID down to 8 characters. + +https://github.com/restic/restic/issues/2724 +https://github.com/restic/restic/pull/3993 diff --git a/internal/ui/backup/json.go b/internal/ui/backup/json.go index 1cbd0c197..ef3d568fe 100644 --- a/internal/ui/backup/json.go +++ b/internal/ui/backup/json.go @@ -191,7 +191,7 @@ func (b *JSONProgress) Finish(snapshotID restic.ID, start time.Time, summary *Su TotalFilesProcessed: summary.Files.New + summary.Files.Changed + summary.Files.Unchanged, TotalBytesProcessed: summary.ProcessedBytes, TotalDuration: time.Since(start).Seconds(), - SnapshotID: snapshotID.Str(), + SnapshotID: snapshotID.String(), DryRun: dryRun, }) }