Cronjobs not executing on ubuntu 16.04 nc12.02

Hi Folks,
I’m having an rather strange issue that I can’t get /var/www/nextcloud.cron.php executed correctly.

I first did the standard stuff:

crontab -u www-data -e

*/15 * * * * /usr/bin/php -f /var/www/nextcloud/cron.php

that did not give me a working cronjob.

Then I did it manually:
sudo -i
sudo -u www-data php /var/www/html/nextcloud/cron.php
and cron seems to be executed; correct represented as well at the basic settings ‘background jobs’ the cron job icon turned happily green.

I then added as well the job to crontab itself using:
*/15 * * * * www-data /usr/bin/php -f /var/www/nextcloud/cron.php >/dev/null 2>&1

still cron is not executed for cron.php

What I see in this syslog is this:
Aug 21 19:15:01 nextcloud CRON[2090]: (www-data) CMD (/usr/bin/php -f /var/www/nextcloud/cron.php)
Aug 21 19:15:01 nextcloud CRON[2091]: (root) CMD (www-data /usr/bin/php -f /var/www/nextcloud/cron.php >/dev/null 2>&1)
Aug 21 19:17:01 nextcloud CRON[2096]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Aug 21 19:30:01 nextcloud CRON[2106]: (www-data) CMD (/usr/bin/php -f /var/www/nextcloud/cron.php)
Aug 21 19:30:01 nextcloud CRON[2107]: (root) CMD (www-data /usr/bin/php -f /var/www/nextcloud/cron.php >/dev/null 2>&1)
Aug 21 19:44:40 nextcloud crontab[2075]: (www-data) END EDIT (www-data)
Aug 21 19:44:48 nextcloud crontab[2167]: (root) BEGIN EDIT (www-data)
Aug 21 19:45:01 nextcloud CRON[2180]: (www-data) CMD (/usr/bin/php -f /var/www/nextcloud/cron.php)
Aug 21 19:45:01 nextcloud CRON[2182]: (root) CMD (www-data /usr/bin/php -f /var/www/nextcloud/cron.php >/dev/null 2>&1)
Aug 21 19:45:35 nextcloud crontab[2167]: (root) END EDIT (www-data)

Am I forgetting something here or am I overlooking something as I really now got lost :frowning:

thnx for helping out where anyone could…

edit: as I now had 2 cronjobs at the same time I moved back to only using the one from:
crontab -u www-data -e
I even added my path in there as well.
see now that syslog shows a single crontab output:
Aug 21 21:32:07 nextcloud crontab[3650]: (root) BEGIN EDIT (www-data)
Aug 21 21:32:21 nextcloud crontab[3650]: (root) REPLACE (www-data)
Aug 21 21:32:21 nextcloud crontab[3650]: (root) END EDIT (www-data)
Aug 21 21:32:35 nextcloud crontab[3670]: (root) BEGIN EDIT (www-data)
Aug 21 21:32:44 nextcloud crontab[3670]: (root) REPLACE (www-data)
Aug 21 21:32:44 nextcloud crontab[3670]: (root) END EDIT (www-data)
Aug 21 21:33:01 nextcloud cron[2926]: (www-data) RELOAD (crontabs/www-data)
Aug 21 21:35:01 nextcloud CRON[3787]: (www-data) CMD (www-data /usr/bin/php -f /var/www/html/nextcloud/cron.php > /tmp/cronlog.txt)
Aug 21 21:37:10 nextcloud crontab[3820]: (root) BEGIN EDIT (www-data)
Aug 21 21:37:20 nextcloud crontab[3820]: (root) END EDIT (www-data)
Aug 21 21:37:42 nextcloud crontab[3840]: (root) BEGIN EDIT (www-data)

however it still does not work and the cronlog.txt does not show any output :frowning:

any guidance anyone?

OK it got resolved… so many things changed at the last hour but the last thing I tried was changing from
This from the manual: # crontab -u www-data -e to # sudo crontab -u www-data -e

and then it worked. as such now resolved back to other bugs again.