Why did my crontab not trigger?

Have you added an empty line after your cronjob?


There are implementations of cron (not all of them, and I don't remember which offhand, but I've encountered one under Linux) that check for updated crontab files every minute on the minute, and do not consider new entries until the next minute. Therefore, a crontab can take up to two minutes to fire up for the first time. This may be what you observed.


I had the same problem - a working crontab suddenly stopped after I added a new entry at the end. It turned out that I had forgotten to put a newline after that last line.

I found out by issuing the command

cat /var/log/syslog | grep crontab

and the output showed the problem:

Jul  2 08:16:01 shiva cron[1254]: (*system*) RELOAD (/etc/crontab)
Jul  2 08:16:01 shiva cron[1254]: (*system*) ERROR (Missing newline before EOF, this crontab file will be ignored)

Adding the newline and saving fixed the problem.

Tags:

Cron