Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.29k stars 2.74k forks source link

Cron job does not work on win10 systems #22329

Closed scaleo-hds closed 1 year ago

scaleo-hds commented 2 years ago

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

hregis commented 2 years ago

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

scaleo-hds commented 2 years ago

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

hregis commented 2 years ago

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

scaleo-hds commented 2 years ago

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 ?

hregis commented 2 years ago

@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!

scaleo-hds commented 2 years ago

What's you intention now?

trekmorris commented 2 years ago

@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 . ) .

scaleo-hds commented 2 years ago

@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.

trekmorris commented 2 years ago

@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 .

ksar-ksar commented 2 years ago

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.

scaleo-hds commented 1 year ago

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.

ksar-ksar commented 1 year ago

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

trekmorris commented 1 year ago

@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