backrest
backrest copied to clipboard
Failed to get snapshots issue after leaving Sleep mode on Windows
Describe the bug
I have a scheduled plan that is supposed to run at 5pm each day with the target repo existing on an external NAS machine plugged into my computer. Everything seems to work fine for the most part when the computer is active but I've noticed some backups failed to go off if my computer is asleep during the scheduled time. Of course I wouldn't expect it to run in this state but I saw that it actually attempts a backup after I log in and fails, giving the error failed to get snapshots for plan
with exit status 1. Because of this I haven't been getting my files saved every time this happens and I have to backup manually using the "Backup Now" button while my computer is awake to get new snapshots.
To Reproduce Steps to reproduce the behavior:
- Schedule a plan for a specific time on Windows 11 which backs up to an external drive or NAS (might have to be a NAS machine)
- Activate sleep mode for the computer before that time
- Leave sleep mode after the time has passed
- Failed to get snapshots error shows up and nothing was backed up
Expected behavior Hoping that the backup can succeed once I leave sleep mode and log in.
While I don't know what "failed to get snapshots" exactly means in restic/backrest terms (perhaps it can't connect to the repo location?), my ideas as to why this is happening are:
- NAS isn't yet mounted properly by the time backrest runs its check after exiting sleep mode OR
- Some weird security rule is kicking in that won't let programs access the NAS until after I log in on Windows, and backrest is able to run before that point
Some potential approaches for fixing this:
- Add a (user configured?) arbitrary time delay for X amount of minutes before checking past backups that were missed from Sleep mode in order to allow external devices to mount in time
- If it's related to logging in, maybe backrest could somehow figure out if the user is logged in or not and hook into that as the best time to run the catch-up operations
- Have backrest check if the repo is accessible before attempting backup and redo this check every minute until it is able to backup properly, this could be also be user configured for better control. This would ensure that it doesn't just fail and give up, and would also help if someone unplugged a hard drive for example as the next time they plug it in, the backup could still run
Screenshots
Would appreciate any info regarding what exactly this error means as it would help track down the best route to fix it.
Desktop (please complete the following information):
- OS: Windows 11
- Browser: Firefox
- Backrest Version: 0.14.0
Thanks for any help regarding this issue! I really love the way this app works and would be happy to see this streamlined in some way so I can better trust that my files are being backed up without having to manually check it so often.