I have a crontab job scheduled to run every hour. I like to sleep and I also enjoy giving my macbook the same privileges. Unfortunately, cron does not execute when the system is asleep. Is there a way to do the following:
- Check if computer is already asleep.
- If asleep, wake up computer.
- Wait for crontab job to finish.
- Go back to sleep if computer was previously asleep.
I understand I can use pmset to schedule wake/sleep for every hour, but I want to selectively put the computer back to sleep (conditional on whether or not it was asleep before the wake routine started running).