« Lesser Primate Committee Thinking Experiment | Main | Parking Tickets »

August 03, 2005

TechTip: Crontab

Q: Help! I am trying to edit the cron file for sys and I used "crontab -e sys" and the system just gave back an error number and then hung.

A. Nope. Actually it didn't. What you are seeing is a bit of archaeological history:
# crontab -e sys
305

You are talking to ed - not the horse, the original editor - the one that came before vi. Simply type the letter 'q':
# crontab -e sys
305
q
The crontab file was not changed.
#

To use vi (or some other editor), you need to set the EDITOR environment variable (on older systems, you can set the VISUAL variable):
# EDITOR=/usr/bin/vi
# export EDITOR

Now, running crontab will get you into vi (or whatever you specified). Note that the same variable will also fix a number of other programs (like sudo) so you may want to add it to your .profile (or equivalent).

Posted by Ozguru at August 3, 2005 06:00 AM

Comments

I bow down to you - the man with two (or even three) brains. Was this post written in Strine or Intergalactic Standard?

Posted by: Cabarfeidh [TypeKey Profile Page] at August 4, 2005 12:58 AM

Thanks for the complements. I think the post was primarily written in Unix. One of the lesser known geek languages. Unfortunately I don't think babblefish can correctly translate such gibberish into English :-(

Posted by: Ozguru at August 4, 2005 07:57 AM