计划任务模块

计划任务
模块ID 2300
用户手册 本页
开发文档 Module Scheduled Jobs (developer)

简介

计划任务模块是一个核心的 Dolibarr 模块。它是可选的,是模块列表中的系统组的一部分。

本模块的主要作用是管理按计划执行的作业任务(别名 cron 或 chrono table)。

安装

该模块包含在 Dolibarr 发行版中,因此无需安装。

配置

要使用此模块,必须首先使用管理员帐户通过菜单选项 "主页 - 设置 - 模块"启用它:

选择列出模块的选项卡。然后点击 "激活"。。

模块现在已激活。

如果在该模块的行尾出现一个齿轮图标 ,则单击它以访问特定于模块的设置页面。


模块配置

唯一可以更改的参数是 URL 上用于启动 cron 作业的安全密钥。

如下链接到:

模块的外部激活

本模块需要每隔 5 分钟从外部激活一次。

根据 Dolibarr 的运行环境,需要遵循的步骤是不同的。

Unix Environment

On Unix environment you should use the crontab entry to run the command line each 5 minutes

Windows Environment

On Windows, you have to create a new task in the Windows Task Scheduler.

  • General: don't forget to check "Run with maximum permissions".
  • Trigger: Choose according to the use of your PC
  • Action:

Select "Start a program". Then put in Program/Script: C:\wamp64\bin\php7.3.12\php.exe And in Add arguments: -f C:\wamp64\wwww\dolibarr\scripts\cron\cron_run_jobs.php xxxxxxxxxxxxxxxx admin

With 'xxxxxxxxxxxxxxxx' is the security key that you will find in the parameters of the scheduled jobs module, and 'admin' is the name of your session.

The path indicated may be different depending on the installation and software version. This task will execute a command in windows to execute the php, then launch the planned work in progress of dolibarr

Dolibarr available on Internet

You can use external services like :

Manage the Scheduled jobs

In Home - Admin tools - Scheduled jobs you will find the list of active jobs and the last activation time.

You can also create new jobs.