1753773 Members
5262 Online
108799 Solutions
New Discussion юеВ

Re: Error in crontab -e

 
Waqar Razi
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
Michal Kapalka (mikap)
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
Waqar Razi
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?
Matti_Kurkela
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
Steven Schweda
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)?