Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying the Cron facility in Mac OS X Lion, but it does't seem to work.

The crontab looks like this:

MacBook-Air-de-Vincent:run vincentle$ crontab -l
* * * * * (echo 'plop')
MacBook-Air-de-Vincent:run vincentle$ 

I would expect to see a "plop" written in the terminal every minute but I do not.

Why do I not see this?

share|improve this question

migrated from Mar 10 '12 at 14:27

This question came from our site for professional and enthusiast programmers.

Why would you expect Cron to write to your terminal? You've provided a MAILTO. Have you checked your inbox? – Johnsyweb Mar 10 '12 at 10:52
As an aside, the parentheses around the command line are superfluous. – tripleee Mar 10 '12 at 11:08
For what I've read, MAILTO is supposed to send debug email. – user777466 Mar 10 '12 at 14:10

fwiw, cron is deprecated in Lion.

You should look to switch from cron to launchctl.

share|improve this answer
Please give an example of how to achieve the same using launchctl. – slhck Mar 10 '12 at 14:54
Please specify the official source for cron deprecation. – Daniel Beck Jul 14 '12 at 14:55
Be sure to read past the initial blurb, to the section, "Timed jobs using cron".… – Snips Jul 15 '12 at 15:58
@DanielBeck deprecated is such an ugly word. They simply added something else, left cron there, favor the new thing then call it 'deprecated'. Using on cron on Mavericks now. Deprecated? Not yet. Expect it to be there at least a few more foreseeable releases? Yes. See here for answer to your question That article is from 2005 and we still have cron – Mike Mügge Oct 6 '14 at 16:46
@Michael.M: Are you sure you wanted to respond to me? – Daniel Beck Oct 6 '14 at 16:49

Cron is deprecated however crontab is not. Run man crontab and that'll give you what you want to know.

share|improve this answer
Am I confused or is he already using crontab? – Tanner Faulkner Oct 24 '12 at 19:56

Besides whether or not cron is deprecated, this would not do what you want, not even in Linux.

Cron runs as a background process. The specific type is called a 'daemon' (pronounced demon). As such it has no terminal, and no terminal to write to. Its stdout and stderr are hooked to mail. Normally, you'd drop to your local inbox on your computer, but you've supplied a MAILTO setting, which redirects mail to that email address. This setup should send an email consisting solely of 'plop' to, every minute. All output goes to this mail, not just debugging output.

For testing, I usually do a touch file someplace in /tmp. A cronjob of date > /tmp/testdate.txt or equivalent will show you if and how often your cron fires.

share|improve this answer

You must log in to answer this question.