Hi,
i recognized, that cron is suddenly not working anymore.
I have the following entry in âsudo crontab -u www-data -eâ:
*/15 * * * * php -f /var/www/nextcloud/cron.php
Service cron status is showing me âactiveâ and the path to cron.php is correct.
Maybe something happend during trying to install php 7.4? But now PHP 7.2. is running again and i removed PHP 7.4.
In the syslog i can see these entries:
Mar 10 09:00:01 wolke-NUC CRON[8661]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)
Mar 10 09:00:01 wolke-NUC CRON[8659]: (CRON) info (No MTA installed, discarding output)
Ubuntu 18.04.
NC 18.0.1
PHP 7.2.24
Can you change it in:
*/15 * * * * php -f /var/www/nextcloud/occ system:cron
It is not working, i tried both. I can see in the log cron has done the job ? but nextcloud is telling me, that it has not worked:
Mar 10 09:20:01 wolke-NUC CRON[9855]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)
Mar 10 09:20:01 wolke-NUC CRON[9856]: (www-data) CMD (php -f /var/www/nextcloud/occ system:cron)
Mar 10 09:20:01 wolke-NUC CRON[9846]: (CRON) info (No MTA installed, discarding output)
What is the setting of you cron in the settings?
is your emailsetup working correctly?
I am not sure if you mean this settings?
m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
No, i donât use this. So the error is fine. Or could it help my at finding the issue?
cron complains that there is no MTA (message transfer agent) set - so it could help, maybe
Can you put this on the end of youre cron:
>> /dev/null 2>&1
Do you put this at the start: >>
Yes, sure!
Would it be possible, to do a clean reinstall from cron? Maybe this ârepairsâ the issue?
Try to do your crontab command âphp -f /var/www/nextcloud/cron.phpâ in a terminal. Probably it will tell you, that it is trying to use a php-version which isnât to be found.
If i do that, i get now answer - the terminal is jumping in the next line and waiting for a new command.
But it seems not to work:
The full command is:
sudo -u www-data php -f /var/www/nextcloud/cron.php
Yes, but it is not working. 
And if you do something like
sudo -u www-data php -f /var/www/nextcloud/cron.php 1,2>/home/YOURHOMEDIR/cronphp.txt
is there some output in cronphp.txt ?
Also, ich werde jetzt etwas weiter ausholen. Ich habe eine Àhnliche Konfiguration mit Ubuntu 18.04.4, NC16.0.9 und PHP7.3.
Wenn ich den crontab-Eintrag im Terminal ausfĂŒhre dann wird bei mir das bei den Grundeinstellungen->Hintergrundauftrag auch sofort angezeigt.
Ich hatte versuchsweise mal PHP7.4 installiert, und diese Installation dann nicht vollstĂ€ndig rĂŒckgĂ€ngig gemacht. Danach bekam ich die gleiche Meldung in Grundeinstellungen->Hintergrundauftrag wie Du. Als ich dann den crontab-Eintrag im Terminal ausfĂŒhrte bekam ich dann aber einen Hinweis direkt im Terminal, daĂ versucht wird mit einem nicht vorhandenen PHP 7.4 zu arbeiten.
Das alles scheint bei Dir nicht der Fall zu sein. Kann es sein, daĂ Du zwei NC-Installationen hast und Dir dabei etwas durcheinander geraten ist?
Danke fĂŒr deine BemĂŒhungen!
Also ich bin mir ziemlich sicher, dass es was mit PHP zu tun hat. Weil, sofern ich es vorher nicht ĂŒbersehen habe, ist der Fehler bei mir auch erst aufgetreten, nachdem ich PHP 7.4. versucht habe zu installieren. Ich hab danach PHP7.4. mit purge wieder entfernt und 7.2. in apache wieder aktiviert.
Ich hab keine 2 NC Installationen ⊠ich hab am Server nur ein NC und eine Collabora (mittels Docker).
Gibt es noch ein Log File, welches mir ev. helfen könnte?
Danke und Lg!
Was sagt ein âphp -vâ direkt in der Konsole aus?
Auch könntest du schauen, wie lange die cron.php lÀuft wenn du diese manuell aufrufst?
*/15 * * * * php -f /var/www/nextcloud/cron.php
Bei einigen Kunden, die sehr groĂe NC Instanzen haben, lĂ€uft der Cron lĂ€nger als 15 Minuten sodass die AusfĂŒhrung angepasst werden muss solange der Cron lĂ€uft.