Recently a user on one of our systems (linux Ubuntu, but any *nix would be the same) had a crontab file missing a terminating newline.

It is common for *nix configuration files to require that terminating newline, cron being no different. However, no warning is provided when adding a file with no newline, and the command is never executed.

So, two fixes identify themselves.

  1. Run a cron process to check for these files.
  2. Provide a friendlier front end to cron.

The second is what this question is about. Either something to check the syntax before entering the file, or to front the whole entry process, which is a bit arcane anyway.

For this particular machine a command-line tool would be needed, since it is located at a data centre, and an X environment is not installed.

  • Part of the problem might be the truly ancient version of cron installed on the (Ubuntu) machine - Vixie cron from 1993. My Fedora has a 2007 version, which no longer has a comment in the manual about missing EOL being a bug (which the 1993 one does).
    – Peter
    Sep 24, 2009 at 1:18
  • 2
    Does that mean you're also editing the crontab as a regular file rather than using "crontab -e"? I assume you have a good reason to continue using the truly ancient version. Sep 24, 2009 at 20:48

4 Answers 4


I like the cron interface in webmin.


I've always found that the syntax coloring in vim was enough to do this for me. I haven't run into the newline problem simply because I've trained myself to be automatic with it, like driving is, so you get those experiences where you drive while thinking about something absorbing and you get out of the car and wonder to yourself "How did I get here? I don't remember the trip at all!" --- "Damn, where did all these newlines come from?"


There is now CronSandbox.

This is a 'sandbox', somewhere safe to explore crontab commands. Enter the timing values, CronSandbox validates the syntax and delivers the future dates and times the job would execute.


I changed my default editor to emacs, which asks if you want to end the buffer with a newline on exit :)

setenv EDITOR <editor>

in your .bashrc (or appropriate) should handle that solution :)

To answer part two of your question, you can also just drop scripts in the cron.<period> directories in /etc

  • Yes, me too. In fact I thought this user did also, so I was surprised he had a missing newline. But since there are a few users, I thought maybe there was a text-based tool, like the gnome graphical one someone suggested, but that answer seems to be gone now. Thanks.
    – Peter
    Sep 24, 2009 at 1:08

Not the answer you're looking for? Browse other questions tagged .