Prevent Mac sleep during backup #845
Replies: 9 comments 1 reply
-
There is a caffeine python module: https://pypi.org/project/caffeine/ |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
This would need a OS-independent base class and then OS-specific implementations again. We also can't add the |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
It's MIT licensed https://github.com/jpn--/caffeine/blob/master/LICENSE.txt, which is GPL3 compatable |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
I found these packages with a quick search: |
Beta Was this translation helpful? Give feedback.
-
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.
Beta Was this translation helpful? Give feedback.
All reactions