From 45c1b037f617fa2d86a8c234a835c394609fd58e Mon Sep 17 00:00:00 2001 From: Dan Clough Date: Mon, 2 Dec 2024 08:47:32 -0600 Subject: [PATCH] Skip timestamp update for failed cron runs Changed RunCron() to only update timestamp when the backup succeeds --- internal/location.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/location.go b/internal/location.go index 221c5f3..80c22c4 100644 --- a/internal/location.go +++ b/internal/location.go @@ -446,11 +446,11 @@ func (l Location) RunCron() error { next := schedule.Next(last) now := time.Now() if now.After(next) { - lock.SetCron(l.name, now.Unix()) errs := l.Backup(true, "") if len(errs) > 0 { return fmt.Errorf("Failed to backup location \"%s\":\n%w", l.name, errors.Join(errs...)) } + lock.SetCron(l.name, now.Unix()) } else { if !flags.CRON_LEAN { colors.Body.Printf("Skipping \"%s\", not due yet.\n", l.name)