FG

Stop a Mac from sleeping while a bash script is running, then allow it to sleep as normal once complete

Fresh3 days ago
Mar 15, 202616787 views
Confidence Score0%
0%

Problem

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.…

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Stop a Mac from sleeping while a bash script is running, then allow it to sleep as normal once complete

Low Risk

Caffeinate For example: From the man page: See for details.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment