Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

grapes911

Moderator emeritu
Original poster
Jul 28, 2003
6,995
10
Citizens Bank Park
I'm been a big fan of making custom cron files for years in both Linux and OS X. As many of you know, Tiger replaced cron and some other things with launchd. I can't figure out how to add/edit/delete scheduled events. I've googled launchd and I haven't found a good manual on launchd that I've got to work. Even 'man launchd' sucks. Anyone have any knowledge on this?
 
Have you tried the info command yet? Maybe "info launchd" will give some better advice. Sometimes I've found the info pages better than the man pages for a command.
 
Flying Llama said:
So no more cron? So should we stop calling them cron scripts and start calling them launchd scripts? Aww man...
cron is still there!

crontab -e and vi don't get along, though. Set VISUAL to something else (pico is good enough if you don't feel like installing something better).
 
iMeowbot said:
cron is still there!

crontab -e and vi don't get along, though. Set VISUAL to something else (pico is good enough if you don't feel like installing something better).

I get this (below). Are you telling me that if I put jobs in here they will still run?
 

Attachments

  • Picture 1.png
    Picture 1.png
    8.8 KB · Views: 121
iMeowbot said:
cron is still there!

crontab -e and vi don't get along, though. Set VISUAL to something else (pico is good enough if you don't feel like installing something better).

Few, good to hear!

llama
 
It's probably worth noting that launchd is still somewhat broken (as of 10.4.1). I'm too lazy to go find the references, but poke around some of Apple's developer docs and you'll find a number of mentions of this fact.
 
grapes911 said:
I get this (below). Are you telling me that if I put jobs in here they will still run?

They should.

You can verify that the cron daemon is running with ps ax | grep cron

To check that it really works, try adding this line to your crontab:

* * * * * /usr/bin/say Meow

... that should cause your Mac to meow once a minute.
 
iMeowbot said:
They should.

You can verify that the cron daemon is running with ps ax | grep cron

To check that it really works, try adding this line to your crontab:

* * * * * /usr/bin/say Meow

... that should cause your Mac to meow once a minute.
Yup, still works. I tested it out after you said it was still there. I got it to work. I still want to learn Launchd though. (call me a geek :p )


Flying Llama said:
So what would be the advantage of switching to launchd?
Launchd takes the place of every daemon. Here is a good article that describes launchd and its advantages.
 
Flying Llama said:
So what would be the advantage of switching to launchd?

For one-shot tasks like running a timed event, probably not much. But the way launchd was explained to me (by a developer whom I trust enough to paraphrase :)) launchd provides system-level services which can be started, stopped, communicated with while running, etc. Something similar to services in Windows 2K/XP where (for example) you can run VNC as a service so you can login remotely even when no user is currently logged into the system. Launchd as I understood it is a similar thing but done UNIX-like.

And yeah, I could be way off base here, but that's what I understood it to mean.
 
freiheit said:
For one-shot tasks like running a timed event, probably not much. But the way launchd was explained to me (by a developer whom I trust enough to paraphrase :)) launchd provides system-level services which can be started, stopped, communicated with while running, etc. Something similar to services in Windows 2K/XP where (for example) you can run VNC as a service so you can login remotely even when no user is currently logged into the system. Launchd as I understood it is a similar thing but done UNIX-like.

And yeah, I could be way off base here, but that's what I understood it to mean.

Ah yes, launchd was definately a smart move, good job Apple!
And thanks freiheit and grapes911 for the help.

llama :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.