From a0fe2cf42d0248830762422faa783c4f673c478e Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Thu, 26 Aug 2021 12:50:22 +0200 Subject: [PATCH] handle errors on container restart --- cmd/backup/main.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/backup/main.go b/cmd/backup/main.go index bda0bde..ade109d 100644 --- a/cmd/backup/main.go +++ b/cmd/backup/main.go @@ -37,7 +37,7 @@ func main() { s.must(func() error { restartContainers, err := s.stopContainers() - defer restartContainers() + defer s.must(restartContainers()) if err != nil { return err } @@ -391,9 +391,10 @@ func (s *script) pruneOldBackups() error { ) } s.logger.Infof( - "Pruned %d out of %d remote backup(s) as their age exceeded the configured retention period.", + "Pruned %d out of %d remote backup(s) as their age exceeded the configured retention period of %d days.", len(matches), lenCandidates, + s.c.BackupRetentionDays, ) } else if len(matches) != 0 && len(matches) == lenCandidates { s.logger.Warnf( @@ -447,9 +448,10 @@ func (s *script) pruneOldBackups() error { ) } s.logger.Infof( - "Pruned %d out of %d local backup(s) as their age exceeded the configured retention period.", + "Pruned %d out of %d local backup(s) as their age exceeded the configured retention period of %d days.", len(matches), len(candidates), + s.c.BackupRetentionDays, ) } else if len(matches) != 0 && len(matches) == len(candidates) { s.logger.Warnf(