This question already has an answer here:

I would like to run a script at wakeup. So my laptop is sleeping, I open the lid, and the script should run immediately or within the minute after wakeup. This script should run at startup as well, as that is essentially the same situation.

How can I run a cronscript at either wakeup and startup?

marked as duplicate by Allan, Ɱark Ƭ, Scot, nohillside macos Apr 12 '18 at 8:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


You cannot run a cron task at wakeup. It is possible to run a script at wake with some third party utilities. This thread is old, but probably still relevant.

Possible to run scripts on sleep and wake?

Not the answer you're looking for? Browse other questions tagged .