Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to schedule the execution of a .sh script on max OSX 10.8.2

I am using crontab and am getting an odd bug. If i am at the computer and set the task so that it executes in the next few minutes, it starts up as desired, however if i set it for sleeping time (as i wish to), it does not run.

My crontab file looks like this:

1  6  *  *  *  /Users/me/bash/

Is there some setting i need to flip so that these tasks execute even when the computer has not been interacted with for a time (i presume it's hibernating or some such)?

share|improve this question
up vote 2 down vote accepted

cron doesn't run when the computer is off or asleep. Use a LaunchDaemon instead, and use the StartCalendarInterval key to trigger it:

share|improve this answer
+1, thanks. This would be my first LaunchDaemon, could you possibly showmthe entire xml? Would be a massive help to me. Thanks. – ricardo Mar 13 '13 at 7:12
figured it out. thanks. – ricardo Mar 13 '13 at 10:52
I found this a bit tricky, so i made a tutorial on my blog – ricardo Mar 14 '13 at 8:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.