Scheduled backup failures after sleep on OS X?

I was wondering if someone could help me troubleshoot this. It seems that restic frequently fails to start/resume scheduled backups after sleeping on OSX (for example, I close the laptop). Not always, but sometimes the repositories become locked or the scheduled backups simply fail to run or resume.

Does anyone know how to troubleshoot this further?

You probably need to provide a little more background information in order to receive help from a Mac user here: how are you running restic (exact command and how is it invoked)? What version of restic are you using? What exactly happens and what would be expect to happen? Do you close your lid while the backup runs? What’s the backup target? What do you mean by “fail to run” and “resume”?

I think long story short is that with lock files based backup program like restic it is unfortunately expected. Simply backup/forget/prune starts, repo is locked (by storing lock file) and then can no finish gracefully (you close your laptop lid for example) - repo is locked when you try to access it next time. Now restic gives you option to unlock it - but you have to be careful and understand consequences if you get it wrong. As long it is only one computer accessing it you should solve it easily with some wrapper running restic unlock after making sure that there is no other restic instance active at the same time.

If it sounds like too much then look and lock free options like rustic

Mac user here. Yeah, this is normal behavior. It used to be a bit more “loosey-goosey” with sleep and the lock files, allowing you to “pause” the backup for days at a time via sleep - but recent versions are more likely to time out. Though I find that slightly annoying, I also think it’s a good thing.

Say you have one user with a Mac who starts a backup, then closes the lid. Goes on vacation for a week. The backup admin decides to run a prune, sees an old 3-4 day lock, goes ahead and removes it… then that Mac user comes back, opens the lid, and Restic just… goes about it’s merry business as if nothing’s changed. That could lead to corruption, I’d imagine.

With Restic being a bit more strict about lock timeouts, it kind of mitigates that issue. So although I liked being able to essentially “pause” my backup as long as I’d like, and resume it - a lot of people use Restic in a multi-user environment where that could cause some issues.