<div dir="ltr">Definitely going to give the sleep thing a try.<div><br></div><div>Since I'm trying to automate this to kick off long smartctl tests at specific times, opening a separate window just for caffeinate won't be very efficient.  I've got some ideas on how to script this out.</div><div><br></div><div>I'd still love it if Apple would just allow selective span test ranges instead of just short and long tests.</div><div><br></div><div>-Ubence</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jun 29, 2018 at 5:36 AM Rainer Müller <<a href="mailto:raimue@macports.org">raimue@macports.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2018-06-29 10:03, Ryan Schmidt wrote:<br>
> <br>
> On Jun 28, 2018, at 19:43, Ubence Quevedo wrote:<br>
> <br>
>> I gave caffeinate a try, and set my system sleep time to a more reasonable timeout [30 minutes], but since smartctl isn't an interactive process [a tsr?], the system never stays awake long enough to finish a whole test.  I even added the -m option to prevent the disk from idle sleeping but that didn't help.<br>
> <br>
> Oh, right. As I recall, smartctl exits immediately, and the test occurs on the disk in the background, and you later run smartctl again to get the result.<br>
> <br>
> In that case, you can run smartctl normally, and then caffeinate a sleep command that takes at least as long as the test. For example, if the test will take 206 minutes, you could sleep for 207 minutes (12,420 seconds):<br>
> <br>
> caffeinate -i sleep 12420<br>
> <br>
> ("sleep" in this context means "wait this many seconds").<br>
<br>
You can just start caffeinate without any arguments in a separate<br>
terminal window to prevent the system from sleeping until you kill the<br>
process (with Ctrl-C).<br>
<br>
Rainer<br>
</blockquote></div>