Archive

Archive for October, 2009

Mac OS X Terminal error “crontab: temp file must be edited in place”

October 19th, 2009

After scouring the web finding all kinds of “reasons” why I was getting this error and trying all kinds of solutions primarily dealing with .vimrc and .bash_profile configuration changes (including re-setting environment variables — NONE of which helped in my situation), I finally found a VERY simple solution.  Too bad it isn’t commonly referred to on the ‘net.  Basically it involves simply creating a text file of your crontabs and then “installing” them (the cron jobs that you want to schedule) to your crontab each time you update the text file.

If you have existing jobs scheduled, simply type the following in Terminal.app

crontab -l > crontab.txt

This will provide you with an editable list of your current cron jobs.  Then simply edit your “crontab.txt” file to make the changes you want.  If you didn’t already have existing jobs scheduled, create a new text file with an easy name like “crontab.txt”.  To install the modified “crontab.txt” file as your new crontab, simply type the following in Terminal.app

crontab crontab.txt

Special thanks to ThegGeekStuff.com’s point #15 on crontab use.  I didn’t find this information anywhere else.

Computer Science, Mac OS X 10.4