Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cron updates timestamp even when backup fails #343

Open
daniel-ferguson opened this issue Dec 5, 2023 · 0 comments
Open

Cron updates timestamp even when backup fails #343

daniel-ferguson opened this issue Dec 5, 2023 · 0 comments

Comments

@daniel-ferguson
Copy link

Hi! To start with I just wanted to say thanks for maintaining this project, it's made managing backups with restic so much easier for me 😄

Describe the bug

Even when an autorestic cron run fails during the backup process, the latest cron timestamp (found in .autorestic.lock.yml) is updated.

This is an issue for me because I have cron set to back up daily, and if the autorestic cron attempt happens when my internet is temporarily unavailable (for backblaze), or my removable hard drive is unplugged (for local) then it will refuse to run again that same day with the message: Skipping "<location>", not due yet.

Expected behavior

I would expect that the next autorestic cron command triggered after my internet came back on would run and back up my data.

Environment

  • OS: Linux - Fedora 39
  • Version: 1.7.9

Additional context

I suspect this is because the timestamp is written before the backup even starts, and no error handling is performed on the result of the backup, see:

if now.After(next) {
lock.SetCron(l.name, now.Unix())
l.Backup(true, "")
} else {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant