mirror of
https://github.com/cupcakearmy/autorestic.git
synced 2024-12-22 08:16:25 +00:00
Skip timestamp update for failed cron runs
Changed RunCron() to only update timestamp when the backup succeeds
This commit is contained in:
parent
48fa20b482
commit
45c1b037f6
@ -446,11 +446,11 @@ func (l Location) RunCron() error {
|
|||||||
next := schedule.Next(last)
|
next := schedule.Next(last)
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
if now.After(next) {
|
if now.After(next) {
|
||||||
lock.SetCron(l.name, now.Unix())
|
|
||||||
errs := l.Backup(true, "")
|
errs := l.Backup(true, "")
|
||||||
if len(errs) > 0 {
|
if len(errs) > 0 {
|
||||||
return fmt.Errorf("Failed to backup location \"%s\":\n%w", l.name, errors.Join(errs...))
|
return fmt.Errorf("Failed to backup location \"%s\":\n%w", l.name, errors.Join(errs...))
|
||||||
}
|
}
|
||||||
|
lock.SetCron(l.name, now.Unix())
|
||||||
} else {
|
} else {
|
||||||
if !flags.CRON_LEAN {
|
if !flags.CRON_LEAN {
|
||||||
colors.Body.Printf("Skipping \"%s\", not due yet.\n", l.name)
|
colors.Body.Printf("Skipping \"%s\", not due yet.\n", l.name)
|
||||||
|
Loading…
Reference in New Issue
Block a user