Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have systems running Mac OS X 10.5.8 and 10.6.8 that I would like to schedule some cron jobs for with the Cronnix GUI application.

I prefer those computers be asleep until the scheduled jobs start. I know the Energy Saver System Preferences pane lets me schedule daily wake up times for the computer, but my cron jobs run at different times in the day.

Is there a way to set up more than one wake up time per day on these Macs? I prefer a GUI based approach but any ideas you have would be great, thanks!

share|improve this question

3 Answers 3

up vote 10 down vote accepted

Sorry, I only know command-line tools to do the job.

You can use pmset for that (like in pmset schedule wake "02/12/2012 12:42:00").

More explanations here and, of course, man pmset.

Setting Multiple "Power On" & Power Off" Events

Currently, it appears that pmset will NOT allow you to set more than one pair of "power on" & "power off" events when using a repeating schedule.

For example...

# pmset repeat shutdown MTWRFSU 02:00:00 wakeorpoweron MTWRFSU 06:45:00

The above command would set a repeating schedule that would shutdown the Mac nightly at 2 AM in the morning and startup daily at 6:45 AM.

But, if you want to set multiple "power on" & "power off" events, you could specify a specific date/time and with a little scripting you could setup a schedule for a month.

# pmset schedule wakeorpoweron "06/07/2007 07:00:00"
# pmset schedule shutdown "06/07/2007 22:00:00"
# pmset schedule wakeorpoweron "06/07/2007 00:00:00"
# pmset schedule shutdown "06/07/2007 01:00:00"
share|improve this answer

This article, How to Power On Your Mac at a Specific Date and Time, shows how to schedule your Mac to power on using Energy Saver, pmset, and Power Manager.

The most capable method is with Power Manager; it can schedule the multiple power on and wake up events you need using the Graphical User Interface (GUI).

Power Manager supports Mac OS X 10.6 and later, but the previous version is still available and supports Mac OS X 10.4 - 10.7 for PPC and Intel.

Disclosure: I work for the company who makes Power Manager.

enter image description here

share|improve this answer

You can use cron to change the wake up time using pmset. E.g., say you want to run script1 at 1 am and script2 at 3 am. In root's crontab:

0 1 * * * /path/to/script1
0 1 * * * pmset repeat shutdown MTWRFSU 01:01:00 wakeorpoweron MTWRFSU 02:59:00

0 3 * * * /path/to/script2
0 3 * * * pmset repeat shutdown MTWRFSU 03:01:00 wakeorpoweron MTWRFSU 00:59:00

When script1 is run, cron runs pmset to shutdown in 1 min and wake up when it is time to run script2. Likewise when script2 is run, it sets back up for script1.

Chaining your cron jobs this way would be equivalent to using multiple wake up times.

share|improve this answer
    
How does one edit the root's crontab? –  martineau Jan 29 at 18:04
1  
@martineau sudo crontab –  user66309 Feb 1 at 7:34

Your Answer

 
discard

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.