I was actually hoping you provide some additional information as well and not only answers to my questions.
Anyway, more questions:
Did you create the cron job for the www-data user?
Which command did you use to open the cron editor?
Which command line did you enter as cron job?
Did you try to run that command line manually (as user www-data) and did it finish successfully?
Are there any error messages in the journal/ system logs regarding the cron execution?
Do other cron jobs run successfully or is cron not implemented correctly?
Update
Sorry, I assumed cron job, but you configured a service. Please check if the service is running and triggered successfully then. Logs are required nonetheless. We need the information what exactly fails.
hi Schmu, what did was follow the Admin guide on the cron jobs and created them as stated there.
i did this same steps for NC13 and those were working normally.
i just tried the following:
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to start ‘nextcloudcron.timer’.
Multiple identities can be used for authentication:
, (pi)
root
Choose identity to authenticate as (1-2): 2
Password:
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATION FAILED ===
Failed to start nextcloudcron.timer: Access denied
See system logs and ‘systemctl status nextcloudcron.timer’ for details.
root@rpi3-cloud:/home/pi# sudo -u www-data systemctl enable nextcloudcron.timer
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-unit-files ===
Authentication is required to manage system service or unit files.
Multiple identities can be used for authentication:
, (pi)
root
Choose identity to authenticate as (1-2): 2
Password:
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATION FAILED ===
Failed to enable unit: Access denied
root@rpi3-cloud:/home/pi#
also i did this:
root@rpi3-cloud:/home/pi# sudo -u www-data php -f /var/www/html/nextcloud/cron.php
root@rpi3-cloud:/home/pi# sudo -u www-data php -l /var/www/html/nextcloud/cron.php
No syntax errors detected in /var/www/html/nextcloud/cron.php
root@rpi3-cloud:/home/pi#
Also, after running systemctl start nextcloudcron.timer and systemctl enable nextcloudcron.timer as root i dont get any error messages
this is what i get after running systemctl status nextcloudcron.timer
root@rpi3-cloud:/home/pi# systemctl status nextcloudcron.timer
● nextcloudcron.timer - Run Nextcloud cron.php every 15 minutes
Loaded: loaded (/etc/systemd/system/nextcloudcron.timer; enabled; vendor preset: enabled)
Active: active (waiting) since Sat 2018-10-20 23:44:26 CDT; 1 day 11h ago
Oct 20 23:44:26 rpi3-cloud systemd[1]: Started Run Nextcloud cron.php every 15 minutes.
but i dont see it running every 15 minutes. currently its been more than 30 minutes and not running
I have same issue with cron.php job. So I worked out that by default nextcloud installation ships with wrong owner permissions for cron.php It must have execute by owner.
That sounds strange. At least with NC13 there’s no need for cron.php to be executable. Php engine executes it (php -f). Is it possible that your php command is not found when crontab executes it?
Did you try /path/to/php -f instead of just php -f?
Or call php-cli instead of php.
There should not be anything executable which are not really meant to be executable.
I’ve been having this problem too. I’ve started of with the example docker-compose NC installation that has a dedicated “cron” appliance. Although crond printed a convincing message every minute or so, the web interface displayed a warning that the last cron job was not executed lately enough.
I did a little bit of digging. Turns out that:
Cron modifies the config file with the last run timestamp, so it needs read/write access to the NC filesystem. Currently, the example docker-compose.yml ships with a read-only permission only.
It’s necessary to chmod +x cron.php. I don’t know why. I admit, it’s a bit dubious since the file in question isn’t executed directly but rather interpreted with PHP. However, adding the execute permission has made all the difference for me.
Now, crond still prints a series of log messages every minute or so, but there is more lines and the web interface is not showing the “no cron” warning anymore.
I am having the same issue. What do you do when you’ve installed Nextcloud via Snap and the filesystem (including cron.php) is read-only so you can’t set cron.php to +x?