How can I prevent sleep in OSX Recovery mode?

I'm doing a disk backup in OSX Recovery Mode and it sleeps. In sleep mode, the backup stops dead. Hot corners do nothing. Sleep seems to kick in after 30 seconds - unsupportable for backing up 850 GB over USB 2.0 (sigh).

I found articles about OSX's "caffeinate" command, but it's too late - I'm 1/3 through the backup.

Can't I keep my Mac running while it's doing this actual intended important work in Recovery Mode?


Solution 1:

If you're already in Recovery Mode doing some operation you don't want to interrupt, you can try this trick to run caffeinate.

Go to the Wi-Fi icon on the menu bar and pull it down. Select "Join Other Network..."

The "Find and join a Wi-Fi network" dialog will be there, but look at the application title. It's "macOS Utilities." Go to the Utilities menu and select "Terminal".

In the terminal, issue the command caffeinate. When your operation is done, control-C out of it.

If it bothers you that the display sleeps and you don't really trust that the operation is still going, you can issue a stronger version:

caffeinate -dismut 65500

This is sort of like 'sleeplessness with prejudice.' With the -u flag you get an implicit -t 5, which stops caffeine after five seconds. So I overrode this by adding '-t 65500' which makes the caffeinate command last about 18 hours.

Finally, because I'm really, REALLY paranoid, I actually put caffeinate in the background and run a shell loop with ps -ef running every 75 seconds.