terminal – Cron job running while macbook lid is closed?


I have been using cron to run a script every morning at 5am daily (the script sends me an email with some data).

In the past, I have always had to keep my laptop lid open and awake for the cron job to execute (send me the email). I use the ‘caffeinate' command to keep my laptop awake.

This past week my laptop lid has been closed at 5am, however, the cron job has executed twice.

Does anyone know how the cron job is running even though my laptop lid is closed?

I haven't terminated the ‘caffeinate' process while my laptop has been closed. So perhaps this process is still doing something with the lid closed..? But if that's the case, why would the cron job execute only 2 days of the past week instead of every day?

Author: Subham

Leave a Reply

Your email address will not be published. Required fields are marked *