Difference between revisions of "计划任务模块"

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search
 
Line 35: Line 35:
  
 
*菜单 '''“主页 - 管理工具 - 计划任务”''' 用于查看和编辑计划任务。
 
*菜单 '''“主页 - 管理工具 - 计划任务”''' 用于查看和编辑计划任务。
*用于检查和启动合格 cron 作业的 URL:   http://mydolibarradress/htdocs/public/cron/cron_run_jobs.php?securitykey=xxxxxxxxxxxxxxxxxxxxxxxx&userlogin=admin
+
*用于检查和启动合格 cron 作业的 URL:
  
*通过作业 ID 检查和启动特定作业的 URL: http://mydolibarradress/htdocs/public/cron/cron_run_jobs.php?securitykey=xxxxxxxxxxxxxxxxxxxxxxxx&userlogin=admin&id=cronjobid
+
http://mydolibarradress/htdocs/public/cron/cron_run_jobs.php?securitykey=xxxxxxxxxxxxxxxxxxxxxxxx&userlogin=admin
 +
 
 +
*通过作业 ID 检查和启动特定作业的 URL:
 +
 
 +
http://mydolibarradress/htdocs/public/cron/cron_run_jobs.php?securitykey=xxxxxxxxxxxxxxxxxxxxxxxx&userlogin=admin&id=cronjobid
  
 
==模块的外部激活==
 
==模块的外部激活==
Line 44: Line 48:
 
根据 Dolibarr 的运行环境,需要遵循的步骤是不同的。
 
根据 Dolibarr 的运行环境,需要遵循的步骤是不同的。
  
===Unix Environment===
+
===Unix 环境===
On Unix environment you should use the crontab entry to run the command line each 5 minutes
+
Unix 环境中,您应该使用 crontab 条目每 5 分钟运行一次命令行。
 +
 
 +
===Windows 环境===
 +
在 Windows 中,您必须在 Windows 的任务计划程序中创建新任务。
 +
 
 +
*'''常规:''' 不要忘记选中“以最大权限运行”。
 +
*'''触发器:''' 根据您的PC使用情况选择。
 +
*'''操作:'''
 +
 
 +
选择“启动程序”。
  
===Windows Environment===
+
然后输入程序/脚本:C:\wamp64\bin\php7.3.12\php.exe
On Windows, you have to create a new task in the Windows Task Scheduler.
 
  
*'''General''': don't forget to check "Run with maximum permissions".
+
并添加参数:-f C:\wamp64\wwww\dolibarr\scripts\cron\cron_run_jobs.php xxxxxxxxxxxxxxxx admin
*'''Trigger''': Choose according to the use of your PC
 
*'''Action''':
 
  
Select "Start a program".
+
参数中的 ‘xxxxxxxxxxxxxxxx’ 是您在计划任务模块管理设置中配置的参数 - 安全密钥,‘admin’是您的会话名称。
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.
+
此 Windows 任务将以执行 windows 命令的方式来执行 php.exe,php 启动 dolibarr 进程中的已计划任务。
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===
+
===Dolibarr 可用的互联网计划任务服务器===
You can use external services like :
+
您还可以使用外部的服务,例如:
  
 
*https://webcron.dolizen.fr/
 
*https://webcron.dolizen.fr/
 
*https://cron-job.org/en/
 
*https://cron-job.org/en/
  
=Manage the Scheduled jobs=
+
=管理计划任务=
 
[[File:Module Schedule Job List EN.png|thumb]]
 
[[File:Module Schedule Job List EN.png|thumb]]
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.
+
您也可以创建新的计划任务。

Latest revision as of 02:31, 6 September 2023

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

简介

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

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

安装

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

配置

Scheduled Jobs Module Activation EN.png

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

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

模块现在已激活。

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


模块配置

Module Scheduled Job setup EN.png

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

如下链接到:

  • 菜单 “主页 - 管理工具 - 计划任务” 用于查看和编辑计划任务。
  • 用于检查和启动合格 cron 作业的 URL:

http://mydolibarradress/htdocs/public/cron/cron_run_jobs.php?securitykey=xxxxxxxxxxxxxxxxxxxxxxxx&userlogin=admin

  • 通过作业 ID 检查和启动特定作业的 URL:

http://mydolibarradress/htdocs/public/cron/cron_run_jobs.php?securitykey=xxxxxxxxxxxxxxxxxxxxxxxx&userlogin=admin&id=cronjobid

模块的外部激活

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

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

Unix 环境

在 Unix 环境中,您应该使用 crontab 条目每 5 分钟运行一次命令行。

Windows 环境

在 Windows 中,您必须在 Windows 的任务计划程序中创建新任务。

  • 常规: 不要忘记选中“以最大权限运行”。
  • 触发器: 根据您的PC使用情况选择。
  • 操作:

选择“启动程序”。

然后输入程序/脚本:C:\wamp64\bin\php7.3.12\php.exe

并添加参数:-f C:\wamp64\wwww\dolibarr\scripts\cron\cron_run_jobs.php xxxxxxxxxxxxxxxx admin

参数中的 ‘xxxxxxxxxxxxxxxx’ 是您在计划任务模块管理设置中配置的参数 - 安全密钥,‘admin’是您的会话名称。

参数中指示的路径可能会因系统安装目录和软件版本的不同而不同。

此 Windows 任务将以执行 windows 命令的方式来执行 php.exe,php 启动 dolibarr 进程中的已计划任务。

Dolibarr 可用的互联网计划任务服务器

您还可以使用外部的服务,例如:

管理计划任务

Module Schedule Job List EN.png

使用菜单 主页 - 管理工具 - 计划任务 ,您可以查看已激活的任务和其上次执行的时间。

您也可以创建新的计划任务。