Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
The old cron still exists in OS X and the new tool is called Launchd. If your looking for something that handles completion dependancies, I'm not sure either would handle that.
 
The old cron still exists in OS X and the new tool is called Launchd. If your looking for something that handles completion dependancies, I'm not sure either would handle that.

LOL. I recall the OP and launchd are old friends, or should I say enemies.
 
But I am looking the scheduler in different way. With that frame work I should be able to allocate some tasks and make them to run

- Weekly once
- Twice in a week

like that I want to do. Is there any option available in Objective-C ?
 
launchd offers these options, check on Lingon for help on creating xml templates you can edit.
 
OK., so basically I want to have all the below options in my scheduler

Argument 1: Minute (0 - 59)
Argument 2: Hour (0 - 23)
Argument 3: Day of Month (1 - 31)
Argument 4: Month (1-12)
Argument 5: Day of Week (0 - 6) Sunday = 0
Argument 6: Command


I want to trigger Objective-C code from this framework. Is there any good example for me to understand ?
 
OK., so basically I want to have all the below options in my scheduler

Argument 1: Minute (0 - 59)
Argument 2: Hour (0 - 23)
Argument 3: Day of Month (1 - 31)
Argument 4: Month (1-12)
Argument 5: Day of Week (0 - 6) Sunday = 0
Argument 6: Command


I want to trigger Objective-C code from this framework. Is there any good example for me to understand ?

Cron in not a framework. It's a daemon. There's an accompanying crontab program that can used to install user crontabs (cron tables).

If you want to have something happen regardless of the logged in user, or even if no user is logged in but the computer is still on, then you'd add a line to /etc/crontab with arguments you copied and pasted above.

If you want to have something happen under a particular user account (necessary if what you're launching needs to present a UI), then you create a crontab file somewhere and "install" it using the crontab program.

The 6th argument is a command. Here you'd specify your program to execute, presumably with command line args so it does something specific.


For more info, open Terminal and run the following commands.

man 8 cron
man 5 crontab
man 1 crontab
 
Hi

I want to have the scheduler with in my application. Cron is more like at system level. I want to add Cron items from the application. Is it possible?

Thanks
Siva
 
Hi

I want to have the scheduler with in my application. Cron is more like at system level. I want to add Cron items from the application. Is it possible?

Thanks
Siva

Do you want it to run only when your application is open?

As to adding to cron via the Application it's possible but you should use launchd instead because Apple might deprecate cron going forwards.
 
Is there any way for me to use NSTimer and build similar setup? Only thing I need all options which are available in cron like WeekDays, 30 mns once, like that.
 
Yes you could, don't know if NSTimer is the best option but at least you should be able to spin of a new thread and keep the task viable as long as you application is open.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.