dolibarr icon indicating copy to clipboard operation
dolibarr copied to clipboard

Cron job does not work on win10 systems

Open scaleo-hds opened this issue 1 year ago • 8 comments

Bug

V 15.0.3 on Win10 : Activation of cron job is not working within the module setup configuration. If security key is generated the test fails due to a new browser tab open with message "wrong security key. The cronjob for making backups does not work, but no job works fine. If I active the job by hand, a backup is made, but not automatically.

Environment Version

15.0.3

Environment OS

windows 10

Environment Web server

standard windwos installation package

Environment PHP

No response

Environment Database

maria

Environment URL(s)

No response

Expected and actual behavior

No response

Steps to reproduce the behavior

No response

Attached files

No response

scaleo-hds avatar Sep 19 '22 20:09 scaleo-hds

http://www.finalclap.com/faq/359-php-tache-planifiee-windows-cron

hregis avatar Sep 19 '22 20:09 hregis

??? Dolibarr has it's own php and must work with it

scaleo-hds avatar Sep 19 '22 20:09 scaleo-hds

@scaleo-hds cron module of Dolibarr works with cron service of Linux. For Windows you can use Scheduled Task to execute dolibarr cron.

hregis avatar Sep 20 '22 07:09 hregis

really? This answer sounds like: "for windows, please use SAP not dolibarr". A smooth work on dolibarr would be an integrated cron service OS-independent.

Lot of people have problems with this, see https://www.dolibarr.org/forum/t/help-with-scheduled-jobs/19982 and nobody has a solution. How can I combine the dolibarr cron with windows ?

scaleo-hds avatar Sep 20 '22 08:09 scaleo-hds

@scaleo-hds anyway Apache and Mysql were not made for Windows, Dolibarr will be much faster on Linux, the version installable on Windows is really only made for testing!

hregis avatar Sep 20 '22 08:09 hregis

What's you intention now?

scaleo-hds avatar Sep 20 '22 08:09 scaleo-hds

@scaleo-hds

I think if you following the my steps in https://www.dolibarr.org/forum/t/help-with-scheduled-jobs/19982 and you can make the cron job success . Actually , i install dolibarr by dolibarr windows version several times , and it may can add some windows command in that package to auto add dolibarr cron job in task . but i think the dolibarr team may not think that is priority issue ( Or thay think is not a issue . ) .

trekmorris avatar Sep 21 '22 13:09 trekmorris

@trekmorris I am really disappointed and I see that most topics don't want to be improved. Most user are worry about those inoperable modules. In the forum job 19982 you have refered, the user at the end uses a third party tool. Is that a good solution? In my opinion writing command lines are only a way to go for engineers. In comand line you have to think about slashes/backslashes, separators and whitespaces, beeing in the right path ......and thousand other......... there is such a high potential of making failures, this is absolutely not suitable for users with normal technical experience. For me this is a bug = inoperable function and should be fixed.

scaleo-hds avatar Sep 21 '22 15:09 scaleo-hds

@scaleo-hds

I am not sure why that user use a third party tools . Because i install dolibarr in windows system several times , and cron job works fine by my steps . Dolibarr is a open source software base on php environment , so if you want to use this you will need to know some knowledge of apache server and php setting . Otherwise , i think dolibarr is not a good solution for you .

But as what i say , for auto-setting cron job in dolibarr windows package is a good idea , and this should be a feature request . By the way , as my experience , it still not a good idea to use dolibarr in windows . That is because windows is not using utf 8 . And that will make some issues .

trekmorris avatar Sep 22 '22 12:09 trekmorris

Hello,

Most of the tools are like that, cron needs to be called by external task (Cron in Linux or task manager in Windows). Exemple from wordpress : https://developer.wordpress.org/plugins/cron/hooking-wp-cron-into-the-system-task-scheduler/ As previously mentioned, WP-Cron does not run continuously, which can be an issue if there are critical tasks that must run on time. There is an easy solution for this. Simply set up your system’s task scheduler to run on the intervals you desire (or at the specific time needed). The easiest solution is to use a tool to make a web request to the wp-cron.php file.

It's the same for Dolibarr.

ksar-ksar avatar Sep 22 '22 12:09 ksar-ksar

I capitulate. For me it is a bug and remains a bug ... but all the cracks here do not have problems with it. Then it's OK. The forum shows me a totally other world. I wait til you arrieve the real world.

scaleo-hds avatar Sep 26 '22 15:09 scaleo-hds

This is not what "we don't want to do" It's just that there is no other way to do it....

ksar-ksar avatar Sep 26 '22 15:09 ksar-ksar

@ksar-ksar

Although scaleo-hds close this article , but i still think it would be possible to make a doliamp with can set default cron job in windows . Because this version will install Dolibarr+Mysql+Apache+PHP together , so that means when pack this version , you just add one more scripts to execute , and just need to add a command to execute cronjob.php per five minute in windows task scheduler as below link . https://www.windowscentral.com/how-create-task-using-task-scheduler-command-prompt

trekmorris avatar Sep 27 '22 00:09 trekmorris