November 22, 2011

Crontab: premature EOF

If you get crontab error like this:

$ crontab -e
no crontab for flexman - using an empty one
crontab: installing new crontab
"/tmp/crontab.XXXXyiIUqY":1: premature EOF
errors in crontab file, can't install.
Do you want to retry the same edit? n
crontab: edits left in /tmp/crontab.XXXXyiIUqY

you cannt solve using crontab -e "userid" but you need to enter the carriage return at the end of the line.
cron is actually looking for end of the line after each cron.

Small things took me 10mins to identify the issue