cancel
Showing results for 
Search instead for 
Did you mean: 

Error in crontab -e

 
Highlighted
Regular Advisor

Error in crontab -e

I am trying to create a cron job and I am getting the following error:

root# crontab -e
/bin/sh: emacs: command not found
crontab: "emacs" exited with status 127

Can some one please help me in that?

Thanks for your help
4 REPLIES 4
Highlighted
Honored Contributor

Re: Error in crontab -e

hi,

your default editor is emacs, you could try tu use vi instead of emacs.

EDITOR=vi;
export EDITOR

mikap
Highlighted
Regular Advisor

Re: Error in crontab -e

I have checked. My default editor is set to vi. Still I am having this issue.

Can some one please help me?
Highlighted
Honored Contributor

Re: Error in crontab -e

Check your shell aliases & functions: perhaps the "crontab" command is aliased to something that changes the default editor for the duration of the crontab command.

Try running "which crontab": it should report the full pathname of the actual command run by the shell. If it's a shell function or alias, the command should display the function/alias definition.

If the response is the default "/usr/bin/crontab", verify that the crontab command has not been replaced with a custom script: run "file /usr/bin/crontab". If the response includes the word "text", it's most likely a script of some kind: read it to see what it actually does and where the real crontab command is hidden.

You could also invoke the crontab command with full pathname to stop shell aliases and functions from taking effect: i.e. "/usr/bin/crontab -e".

MK
MK
Highlighted
Honored Contributor

Re: Error in crontab -e

> I have checked. [...]

Perhaps so, but we can't see what you checked
or how you checked it. You may know what
you're talking about, but you may not. How
can we (non-psychics) know what's true,
unless you show us some actual commands with
their actual output?

What does "man crontab" say about how it
chooses an editor for "-e" on this system
(which you have not identified in any way)?