Crontab Won't Save ("no crontab for user")
crontab -e opens a temporary copy of your crontab; your changes are only installed when you save and exit the editor cleanly. If crontab -l shows nothing or you see "no crontab for user", the file was never written. The usual causes are exiting without saving, an editor that could not write the temp file, or a missing trailing newline that makes cron discard the last line.
Install the crontab correctly
- Run
crontab -e(never edit files under/var/spool/cronby hand). - Add your line, then save and exit. In nano:
Ctrl+O, Enter,Ctrl+X. In vim::wq. - You should see
crontab: installing new crontab. If not, it was not saved. - Verify with
crontab -l.
Common blockers
- "no crontab for user": normal on first use — it just means none exists yet. Add a line and save.
- Temp file can't be written: a full disk or unwritable
/tmpmakes the editor fail silently. Checkdf -h. - Trailing newline: the last line must end with a newline or cron ignores it.
crontab -eadds one; pasted content sometimes does not. - Wrong user: a job saved as your user won't run as root. Use
sudo crontab -efor the root crontab.
FAQ
Why does crontab -l say "no crontab for user"?
No crontab has been installed for that user yet. It is not an error — run crontab -e, add a line, save and exit, then check crontab -l again.
I saved in the editor but the job still isn't there.
Confirm you saw 'installing new crontab' on exit. If /tmp or the disk is full the editor can fail to write. Check df -h and try again.
Do I need a trailing newline in the crontab?
Yes. The final line must end with a newline or cron silently ignores it. crontab -e adds it automatically; hand-pasted lines often miss it.