Prevent Mac sleep during backup #845
Replies: 10 comments 1 reply
|
There is a caffeine python module: https://pypi.org/project/caffeine/ |
|
Yes, but would it be ok to simply make this the default behaviour (that sleep is not allowed while the borg command runs)? For me personally this would be perfectly fine. If no configuration is required, this appears to be relatively easy to implement. |
|
This would need a OS-independent base class and then OS-specific implementations again. We also can't add the |
|
I have in the meantime also explored if the problem can be solved by using pmset as pre-backup and post-backup shell commands to disable sleep and then reenable. However, the problem with that is that it would have to be run as root. |
|
It's MIT licensed https://github.com/jpn--/caffeine/blob/master/LICENSE.txt, which is GPL3 compatable |
|
My preliminary fix now is to run "caffeinate&" as pre-borg shell command, and "killall caffeinate" as post-borg shell command. A bit dirty, since it messes with other caffeinate commands in case there are any. But seems to work. The built-in solution discussed above would still be better, of course. |
https://github.com/jpn--/caffeine/blob/master/LICENSE.txt shows a MIT license, and the name in the license file matches the author of the repository the code itself traces its origin back to another repository, which also indicates it should be considered MIT licensed - https://github.com/pudquick/pypmset so I think you would be in the clear to copy this code. |
|
Is there been any way to fix this properly yet? On my Mac, sometimes the backups run during the night, sometimes not, and sometimes it just hangs in the morning, never recovering until I manually stop and restart the backup. |
|
I found these packages with a quick search: |
Uh oh!
There was an error while loading. Please reload this page.
Mac falls asleep during backup, resulting in low level errors.
It would be great to have a recommended way to prevent this. Ideally a setting in Vorta.
I have also considered whether this could be achieved by putting caffeinate in the shell commands to run before backup, but from my understanding this would not work, since caffeinate never terminates, it just keeps the Mac from sleeping while it runs.
Of course sleep can be prevented altogether which fixes the problem but is not very environment friendly.
All reactions