Open TimH54 opened 2 years ago
I am absolutly not familiar with windows-things.. i just start to dig into restic on windows.. but maybe this helps? https://winsourcecode.blogspot.com/2020/05/keepdisplayon-runs-program-preventing.html
Personally, this isn't behavior that I would want, but I can understand why you may want it. There was a feature request a while back to add the ability to run some pre- and post- backup actions to the script. If you found a way to tell Windows not to go to sleep in one script, and tell it that it's okay to go to sleep via another script, and then you could just call those two scripts from the backup, would that help you achieve your goal?
MS Powertoys contains a tool that could be used for this: https://learn.microsoft.com/en-us/windows/powertoys/awake#command-line-interface-cli.
The implementation pretty much does the same that has been linked above (Win32 SetThreadExecutionState API).
I have had my machine going to standby while a backup job was running. It got interrupted. Is there some way for the scripts to prevent standby while the job is still running?