resticprofile
resticprofile copied to clipboard
run-before background job
Maybe I'm approaching this the wrong way, but I have a client machine running a backup that tends to go to sleep too soon... It's a Mac which has a "caffeinate" command available that will keep it awake.
There are a couple of options to run it... either run it in a separate task or have it call the job it's waiting on.
There doesn't seem to be a way to "wrap" a resticprofile backup command with a "caffeinate" command, so I figured I would just run "caffeinate &" as a run-before - except it doesn't seem to actually background the job, it waits for it to finish (never).
I would then clean up with a "killall caffeinate" which is the documented method.
ls there a way to have a run-before job background?
Hi,
As opposed to run something in the background, we could instead allow wrapping the restic command in another one. Typically resticprofile could call caffeinate -i restic ...
instead of restic
directly. That would work, and should just be a small addition to the config
Works for me... trying to come up with the most "versatile" way of doing it, since I'm sure somebody else will try to do something different :-)
As it is a very specific use case, I think I'm going to introduce a new global prevent-sleep
flag.
It will be using caffeinate on macOS, some kernel32 API on Windows and I need to look if there's a way to do that on Linux (not sure yet, all my Linux machines are always-on so I never had the problem)
I like that… looks like systemd supports some options:
https://askubuntu.com/questions/577862/how-to-temporarily-disable-sleep-and-hibernate-from-the-command-line