Cron and Web cron not working

Cron is not working on my server. I have this issue on every server I install nextcloud on and on every linux distro. AJAX is working though. I have gone through many post and nothing fixed my issue. The only thing that did work was when I installed nextcloud with snap but I want to use nextcloud on apache2 so I can have multiple websites but you can’t run snap nextcloud and apache2 on the same port of course. Last job execution ran 11 minutes ago. Something seems wrong Can someone help me with this? Thanks.

that doesn’t neccessarily mean that cron isn’t working at all. But NC 17+ demand cron to run every 5 minutes rather that every 15 min (which was the default setting before).

so all you need to do is searching for how you could alter your cron settings within snap.

I’m not using snap, i’m using apache2. But snap is the only one that cron runs every 5 minutes.

sorry i got that wrong…

the forum knows how doing that though it’s no nc-specific problem

This solved my problem-

crontab -u www-data -e

Then add this line-
*/5 * * * * php -f /var/www/nextcloud/cron.php

1 Like

My crontab line looks like this:

*/5 * * * * /usr/bin/php7.3 -f /var/lib/docker/volumes/pi_nextcloud/_data/cron.php

and also runs without error at the cmdline.

But nc is still reporting " Background jobs.
Some jobs haven’t been executed since 8 days ago. Please consider increasing the execution frequency."

My permissions look right:

drwxrwxr-x  2 www-data www-data  4096 May  2 13:28 config
-rwxrwxrwx 1 www-data www-data 1022 Apr 28 16:24 config/config.php

I have set /etc/default/cron to log jobs with exit status != 0
but am getting no errors reported.

Is there something else I am missing?

EDIT My PHP Version: 7.4.16, Raspbian 10 on a RPi2, Nextcloud Version 21.0.1 on docker.

Seems like an Ajax cron job will run but not via cron service.