2

I'm trying to run an app from crontab at 3 in the morning. My 2010 MacBook Pro running OS X Lion 10.7.5 is usually turned off at this time of the night, so I'm setting Energy Saver's scheduled wake up at 2.59 and then scheduled sleep at 3.02. But the cron job still doesn't run, because my computer goes back to sleep roughly 20 seconds after being woken up by the wake scheduler.

The reason is obviously the lid being closed. Is there any way around it to preserve the lid-sleep functionality but to wait a couple of minutes before going right back to sleep so that the cron job has time to run?

I know cron is deprecated but I'm not looking for solutions with launchd and anachron and such, if it's possible to solve without these.

Also it would be nice to have a solution that works for OS X Mavericks as well because I'm going to upgrade soon.

If there's an app for this with a proper GUI that's what I'd prefer. Any ideas on how I can resolve this?

  • Have you tried caffeinate? – napcae Nov 5 '13 at 12:41
  • 2
    it's not a duplicate. in fact it's totally different. I explicitly said I want to preserve the lid-sleep functionality :-) Thanks – limehouse Nov 5 '13 at 13:11
  • I don't seem to have caffeinate on my default 10.7.5 osx install. – limehouse Nov 5 '13 at 13:12
  • 2
    afaik caffeinate is available with 10.8. And you can you caffeinate -i make. The description is caffeinate forks a process, execs "make" in it, and holds an assertion that prevents idle sleep as long as that process is running – napcae Nov 5 '13 at 13:18

You must log in to answer this question.

Browse other questions tagged .