I replaced exec cron
with exec cron -L 15
the run sudo service cron reload
, sudo service cron restart
but nothing changed. Cron doesn't log the end of jobs and doesn't log failed jobs. I hade no problem in Ubuntu 14.04, but now I have this problem in Ubuntu 16.04. What do I do wrong?
Step by Step:First I changed /etc/init/cron.conf:
sudo sed -i 's|exec cron$|exec cron -L15|' /etc/init/cron.conf && sudo restart cron && cat /etc/init/cron.conf
So now it is
$ cat /etc/init/cron.conf# cron - regular background program processing daemon## cron is a standard UNIX program that runs user-specified programs at# periodic scheduled timesdescription "regular background program processing daemon"start on runlevel [2345]stop on runlevel [!2345]expect forkrespawnexec cron -L 15
I made the same config in my Ubuntu 16.04 as well as on Ubuntu 14.04 on the another PC.
The Cron log in Ubuntu 14.04 is the following:
$ grep CRON /var/log/syslogAug 26 16:05:01 y1404 CRON[6825]: (y) CMD (foo # JOB_ID_1)Aug 26 16:05:01 y1404 CRON[6824]: (CRON) error (grandchild #6825 failed with exit status 127)
So you can see the second line with error notification about nonexistent command foo
. But in Ubuntu 16.04 there is no error notification in the log:
Aug 26 16:25:01 my CRON[7259]: (y) CMD (foo # JOB_ID_129)