Hello!
I have problem to setup cron jobs on my Nextcloud. I read the doc, read topics here and called my Webhoster but I can’t get out of it…
Nextcloud version : 25.0.4
Operating system and version : linux
Apache or nginx version : Apache 2.4.55
PHP version (eg, 7.4): 8.1 On cPanel I used the utility PHP Selector to upgrade to 8.1 because the native PHP version is 7.3.33. However when looking to the server info it’s still 7.3 which appears…
The issue you are facing: Error message on my Nextcloud Background jobs page telling : The task last ran for an hour ago. Something seems to be malfunctioning.
It’s suppose to run every 5 min since I selected Cron.
Is this the first time you’ve seen this error? : No
Steps to replicate it:
- I followed Nextcloud Doc and added this command : /5 * * * php -f /public_html/nextcloud/cron.php
I used the cPanel utility Cron Jobs to add it. Because I don’t have permission to use -u on Terminal (my Webhoster don’t allow it…) However my Webhoster confirm me that the server call/execute the cron file correctly each 5 min :
Mar 14 19:00:01 world-211 CROND[6421]: (user) CMD (php -f public_html/nextcloud/cron.php)
Mar 14 19:05:01 world-211 CROND[10326]: (user) CMD (php -f public_html/nextcloud/cron.php)
Mar 14 19:10:02 world-211 CROND[13986]: (user) CMD (php -f public_html/nextcloud/cron.php)
Mar 14 19:15:02 world-211 CROND[17549]: (user) CMD (php -f public_html/nextcloud/cron.php)
Mar 14 19:20:01 world-211 CROND[21209]: (user) CMD (php -f public_html/nextcloud/cron.php)
Mar 14 19:25:01 world-211 CROND[25170]: (user) CMD (php -f public_html/nextcloud/cron.php)
But the Nextcloud error message is still there.
-
My Webhoster noticed that shell_exec was in PHP disable_functions while it’s needed for Nextcloud. So I made it enable.
Nextcloud error message is still there.
My Webhoster told me they don’t see error message on the server side, so they stop to help me with it… -
I appended
--define apc.enable_cli=1
to the cron command : /5 * * * php -f /public_html/nextcloud/cron.php --define apc.enable_cli=1
Nextcloud error message is still there. -
I tried : /5 * * * php-cli -f /public_html/nextcloud/cron.php --define apc.enable_cli=1
Nextcloud error message is still there.
The output of your config.php file in /path/to/nextcloud
(make sure you remove any identifiable information!):
<?php
$CONFIG = array (
'instanceid' => ,
'passwordsalt' =>
'secret' => ,
'trusted_domains' =>
array (
0 => my domain,
),
'datadirectory' => '/home/user/nextclouddata',
'dbtype' => 'mysql',
'version' => '25.0.4.1',
'overwrite.cli.url' => 'https://my domain/nextcloud',
'dbname' => 'user_next563',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'user_next563',
'dbpassword' =>',
'installed' => true,
'theme' => '',
'loglevel' => 2,
'maintenance' => false,
'updater.release.channel' => 'stable',
'memcache.local' => '\\OC\\Memcache\\APCu',
);
Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.
There is no error in the log file since I selected Cron in Nextcloud…