CRON on WHM/cPanel

I had been having problems getting CRON to work since ownCloud 10.4. At that point,

*/15 * * * * /usr/bin/php -f “/home/my-domain/public_html/my-cloud/cron.php” >/dev/null 2>&1

didn’t work anymore but neither did the recommendations in https://doc.owncloud.com/server/admin_manual/configuration/server/background_jobs_configuration.html nor any ownCloud Forum suggestion. Moreover, I was not alone.

I have finally gotten CRON to work and would like to share my solution for people who have a similar problem and environment.

Current environment (2020/08):

A dedicated Server with 5 non-federated ownCloud installations spread over 4 domains (all installations are subdomains).

Apache 2.4.46

Centos 7.8

cPanel 90.0.5

PHP 7.4.9 w/PHP-FPM

APCu 5.1.18 w/backward compatibility

Working cPanel CRON entry:

*/15 * * * *
/opt/cpanel/ea-php74/root/bin/php /home/my-domain/public_html/my-cloud/occ system:cron >/dev/null 2>&1

Simply replace the PHP version, my-domain, and my-cloud with your respective values. I hope this is helpful to someone.

2 Likes

Very Good!
Thank you very much!