Cron Misconfiguration

Hmm not sure then… The permissions of the cron.php are different than mine:

Mine are 644 (rw-r–r–) Maybe you could try to change that…

You could also check the syslog for cron errors…

cat /var/log/syslog | grep crontab

Other than that I’m out of ideas…

Hmm no change on permission change.

syslog output
Nov 22 08:14:16 nextcloud crontab[21348]: (root) LIST (www-data)
Nov 22 08:14:55 nextcloud crontab[21368]: (root) BEGIN EDIT (www-data)
Nov 22 08:15:19 nextcloud crontab[21368]: (root) REPLACE (www-data)
Nov 22 08:15:19 nextcloud crontab[21368]: (root) END EDIT (www-data)
Nov 22 08:15:22 nextcloud crontab[21388]: (root) LIST (www-data)
Nov 22 08:16:01 nextcloud cron[923]: (www-data) RELOAD (crontabs/www-data)
Nov 22 08:26:15 nextcloud crontab[21966]: (root) BEGIN EDIT (www-data)
Nov 22 08:26:29 nextcloud crontab[21966]: (root) REPLACE (www-data)
Nov 22 08:26:29 nextcloud crontab[21966]: (root) END EDIT (www-data)
Nov 22 08:27:01 nextcloud cron[923]: (www-data) RELOAD (crontabs/www-data)
Nov 22 08:29:01 nextcloud crontab[22097]: (root) LIST (www-data)

Sorry not sure then… Maybe you can also search through the issues on GitHub and similar threads in the forums. Lately I noticed an accumulation of users who seem to have issues with cornjobs on NC25. So far I have only updated my test instance to NC25, and cron continued to work, without any issues…

Do you think this could be my issue?

root@*****:~# su www-data -c php -f /var/www/nextcloud/cron.php
This account is currently not available.

www-data crontab contents for context:
image

No, that’s normal because www-data doesn’t have an interactive shell. You need to preserve the environment of the current user with the -p option…

su -p -c "php -f /var/www/nextcloud/cron.php" www-data

or you could just use sudo instead of su:

sudo -u www-data php -f /var/www/nextcloud/cron.php
1 Like

Thanks! that helped me able to test the command!

this is how i need my command:
*/5 * * * * php --define apc.enable_cli=1 -f /var/www/nextcloud/cron.php

i was doing this before as it says to append it to the command. So novice here was putting --define apc.enable_cli=1 after the file path like this

*/5 * * * * php -f /var/www/nextcloud/cron.php --define apc.enable_cli=1
and also tried this one that didnt work
*/5 * * * * php -f --define apc.enable_cli=1 /var/www/nextcloud/cron.php

but these are clearly all lack of linux knowledge as the issue!