I upgraded to ownCloud 10.3 and found an error in my dashboard of “Last cron job execution: 5 days ago. Something seems wrong.” This was under Admin – General in the ownCloud Admin portal.
Indeed it was. Digging through the docs I could see the new command was “occ system:cron” but I couldn’t find the exact command in the docs. I poked around and was successful in running this:
Console has to be executed with the user that owns the file config/config.php
Current user: root
Owner of config.php: www-data
Try adding 'sudo -u www-data ' to the beginning of the command (without the single quotes)
root@server:~# sudo -u www-data /usr/bin/php /var/www/owncloud/occ system:cron
My error went away and I now found “Last cron job execution: 6 minutes ago.” in the dashboard.
Now to add to crontab.
- (From console) “crontab -u www-data -e“
- I removed my existing “* * * * * /usr/bin/php -f /var/www/cloud/cron.php” and replaced it with “* * * * * /usr/bin/php /var/www/owncloud/occ system:cron“
- Write out and voila!
- Checked the ownCloud admin settings under “General” and noticed that the Cron job executed as soon as I wrote out (saved changes) to Crontab. All is well.