[launchd-dev] launchd support ranges for StartCalendarInterval?

Dave Zarzycki zarzycki at apple.com
Wed Jan 16 08:39:24 PST 2008


Yes, you can do this. Have StartCalendarInterval be an array of  
dictionaries instead of just a dictionary within the configuration  
file. Having said that, it would be nice if launchd natively supported  
some of the common calendar expressions such as  
{first,second,third,forth,last,second-to-last}  
{mon,tue,wed,thr,fri,sat,sun}. Doing so would save people the trouble  
of figuring out the ranges.

Feel free to file an enhancement request,

davez

P.S. -- I've occasionally wanted, just for giggles, to have launchd to  
support other time intervals such as "only during leap years" or the  
ability to schedule jobs based on the phase of the moon, or the  
solstices/equinoxes. I've even considered adding planetary alignment  
to the schema. :-P



On Jan 15, 2008, at 4:33 PM, Richard Glaser wrote:

> FYI:
>
> Sorry, for this slightly off-topic..
>
> Does launchd does support ranges say for "Days" in the  
> StartCalendarInterval?
>
> For example, with cron if I wanted to run a script on the first &  
> third Sunday of each month at 4 AM. I could use this code with a  
> range...
>
> # minute		hour	mday		month	wday	who		command
> 0			4		1-7,15-21	*		0		root		/path/to/script1
>
> Then I could run another script the second & fourth Sunday of each  
> month at 4 AM...
>
> # minute		hour	mday		month	wday	who		command
> 0			4		8-14,22-31	*		0		root		/path/to/script2
>
> Is this possible with launchd?
>
> Thanks:
>
> Richard Glaser
> University of Utah - Student Computing Labs
> richard at scl.utah.edu
> 801-585-8016
>
> _______________________________________________
> launchd-dev mailing list
> launchd-dev at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo/launchd-dev



More information about the launchd-dev mailing list