I am trying to setup a cron on my mac, but it seems that it never finishes creating a crontab for my user. I open terminal and enter:

$ crontab -e 

Which returns this:

crontab: no crontab for jjmay - using an empty one




















~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
~                                                                               
"/tmp/crontab.rBdeP6yv1U" 0L, 0C

And then it waits there until I close out of the window, I have let it go for as long as 20min. I open another terminal window to check for the creation of my crontab and I get nothing.

$ crontab -l 
crontab: no crontab for jjmay

Any ideas on why I cannot create this, or if I can manually create my crontab so I can edit it?

link|improve this question
It's been awhile since I messed with crontab files in OS X, but my guess is that this: "/tmp/crontab.rBdeP6yv1U" 0L, 0C is indicating you're either not in the correct directory or don't have permissions to write to that directory. What is the directory that you are in when typing "crontab -e"? JDB – JDB Oct 19 '10 at 19:53
@JDB thank you. I wasn't aware I would have to be in a specific dir., I was just in my default dir when I opened terminal, just my default User directory. /Users/<my_username>/ – Jage Oct 20 '10 at 19:54
feedback

2 Answers

Closing the terminal window is not going to make the crontab save.

Since it's using vim to create the file, look up how to use VIM and go from there.

launchd is the (Apple) preferred method in 10.5 and 10.6, but you didn't ask about that, just how to get the crontab created.

link|improve this answer
feedback

The window it's showing is a vi editor. On traditional unix systems, vi is the default editor; it looks like Mac OS X has kept that tradition.

Set the EDITOR and VISUAL environment variables to the name (full path, if it's not in $PATH) of your favorite editor. E.g.

export EDITOR=emacs VISUAL=emacs
crontab -e

This setting should go into your ~/.profile (assuming that Mac OS X does read that file when you log in; if there is an OSX way of defining environment variables for a whole session, you can define them there).

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.