Scheduled jobs not running


yes i used the search function first but only found this one wich dont fits in my problem

i cant get the scheduled jobs module running. The Jobs are running once when i start them via ``/public/cron/cron_job_run.php/securitykey=xxxx/

I tried to copy the line */5 * * * * pathtoscript/scripts/cron/cron_run_jobs.php XXXXXXXXXXXXXX [user] > /var/documents/cron_run_jobs.php.log from the note field but this path dont exists on my server so i modified it to /var/www/html/public/cron/cron_run_jobs.php
I also tried to execute it with various users > root, www-data, global crontab

Can anyone please tell me how my crontab should look like?

If i execute the cron_run_jobs.php via CLI it says:

This page can’t be used as a CLI script. For the CLI version of script, launch cron_run_job.php available into scripts/cron/ directory.

I also can not find a directory /scripts/cron/

Can you please tell me what I am doing wrong.

Best Regards
Daniel Wagner


You missed to install the script directory

I saved the scripts folder in my dolibarr_main_document_root = /var/www/html/

Now if i try to start it manual the following message appears:

root@h2874304:~# sudo -u www-data php /var/www/html/scripts/cron/cron_run_jobs.php
PHP Warning: require_once(/var/www/html/scripts/cron/…/…/htdocs/ failed to open stream: No such file or directory in /var/www/html/scripts/cron/cron_run_jobs.php on line 45
PHP Fatal error: require_once(): Failed opening required ‘/var/www/html/scripts/cron/…/…/htdocs/’ (include_path=’.:/usr/share/php’) in /var/www/html/scripts/cron/cron_run_jobs.php on line 45

Is there still missing more stuff?

1 Like

The script can find the dolibarr…

You should respect the dolibarr folders (script, htdocs, documents) or adapt the path of line 45 :

1 Like

Thank you for your help. I figured out that my scripts directory was missing and after restoring it and defining the correct path to the it is working now