Home » Questions » Computers [ Ask a new question ]

crontab to wake osx from sleep

crontab to wake osx from sleep

I have a crontab which will launch a certain program early in the morning (after I have gone to sleep) and close it again later in the morning (before I wake up). But my iMac will not execute the crontab script while it is asleep.

Asked by: Guest | Views: 24
Total answers/comments: 2
Guest [Entry]

"cron doesn't execute while the computer is asleep, so there's no way for you to have a crontab entry to wake the computer. That said you can schedule the computer to wake just a minute or two before your cron task in Preferences >> Energy Saver >> Schedule.

It's also worth pointing out that since Tiger, Apple has moved most scheduled jobs from cron and scripts like init.rc to the launchd process. It provides more detailed (but cumbersome, I think) means of control (through several plist files). It will also automatically run tasks missed because the computer was sleeping when it awakens. Take a look at Apple's Scheduling Timed Jobs page."
Guest [Entry]

You can schedule your Macintosh to wake up in the Energy Saver preference panel. See the Schedule button.