Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running RHEL 5.6. I type

$ crontab -e

and all I see is


I am, however, able to edit a file (let's say I call it crontab.in) and then type

$ crontab crontab.in
$ crontab -l

and see that it works that way and the entry I placed in crontab.in will run when it should.

So why is crontab -e not working for me?

share|improve this question
Does crontab -l work? What's $EDITOR set to? – Dennis Kaarsemaker Jan 18 '13 at 20:40
the editor needed a tmp file in /tmp dir may be permission question? and also do you start cronotab as sudoer $ or as root # ? – Yurij73 Jan 18 '13 at 20:57
crontab -l does work (as I indicated). I did try setting EDITOR. I have permissions to /tmp (touch /tmp/foo works for example). I do not have root privs on the server, so I do not start crond myself. It is, however, running as root. – Keith Wolters Jan 18 '13 at 21:19
I don't know, but personally I prefer crontab <filename> anyway; it avoids losing information if I make a mistake while editing. (I keep my crontab in a version control system.) – Keith Thompson Jan 18 '13 at 22:20
What exactly is $EDITOR set to? Do you have free space in /tmp (try df /tmp)? – Keith Thompson Jan 18 '13 at 22:22
up vote 1 down vote accepted

Use strace to find out what is going on.

Instead of crontab -e type strace crontab -e. That should give a (quite long) list all system calls of the running command. Near the end you should find some kind of error indicating what is wrong. (Often it is an open of a file on which you don't have the needed permissions.)

share|improve this answer
Looks like I cannot write to my own crontab in /var/spool/cron. – Keith Wolters Jan 22 '13 at 14:37
Oh, this is because of strace itself. Your crontab file is only accessible by root. Therefore the crontab binary is SUID, i.e. runs with root as effective user id. Now when strace starts the binary is is not possible to set the uid and you will not be able to access your file. - Seems like strace will not help you in your case. – michas Jan 22 '13 at 14:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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