I've got my Mac to wake up during the night and run an rsync to back it up. This is configured through Energy Saver > Schedule.
However it seems that it's going back to sleep before it can get anything done, so I need to stop it sleeping during the execution of the bash script that rsync runs from.
I figured the best way (if it's possible) is to issue a command to set the sleep timeout to "Never" or a very long timeout before it rsyncs and then back to normal once it's complete. Is there a better solution for doing this?
Best Answer
Caffeinate
For example:
From the man page:
See
man caffeinate
for details.