Discuz! How to use scheduled tasks to run programs automatically in the forum
Source: Internet
Author: User
The scheduled task is Discuz! Provides a function that enables the system to automatically execute certain tasks (such as the number of daily subscriptions, tag updates, monthly theme cleanup, and automatic item replenishment) at the specified time, when necessary, you can also easily use it to expand site functions. Operation path: [background] [tools] [scheduled tasks] 1. scheduled tasks are Discuz! Provides a function that enables the system to automatically execute certain tasks (such as the number of daily subscriptions, tag updates, monthly theme cleanup, and automatic item replenishment) at the specified time, when necessary, you can also easily use it to expand site functions.
Operation path: [background] => [tools] => [schedule tasks]
I. Editing settings of scheduled tasks The system has 17 built-in scheduled tasks, which are more efficient than clearing expired dynamic scheduled tasks. if you modify a scheduled task, you can click "edit" next to the scheduled task name.
Series"To go to the settings page,
Weekly: set the number of weeks to execute this task. "*" is unlimited. this setting overwrites the following "monthly" setting.
Monthly: set the day of each month to execute this task. "*" is unlimited.
Hour: specifies the hour when the task is executed. "*" is unlimited.
Minutes: specifies the minutes for the task to be executed. up to 12 minute values can be set. Separate multiple values with commas.
Task script: Set the file name of the execution program for this task. do not include the path. The program script is stored in the source/include/cron/directory.
Note: Unless you are familiar with Discuz! Otherwise, we strongly recommend that you do not modify the default settings. If you need to modify the settings, record the original settings before modification. improper settings may cause site unexpected errors. For example, the scheduled task is executed at every day.
The home page of the scheduler page also displays the availability, type, last execution time, and next execution time of the scheduler.
2. add a scheduled task 1. write the program for the scheduled task and upload it to/source/include/cron/under the site directory.
2. backend => tool => scheduler task "add:" and then fill in the scheduler task name, as shown in:
After the task is submitted and saved, edit the scheduled task,
3. fill in the file name uploaded to/source/include/cron/and submit the file.
4. go to the scheduled task list and check the "available" option for the selected scheduled task,
Custom scheduled tasks can be deleted, but built-in scheduled tasks cannot be deleted.
III. execution of scheduled tasks When a scheduled task is executed, the scheduled task is executed if someone accesses the site. If no one accesses the site at that time, the scheduled task is executed until someone accesses the site.
If the scheduled task of the site is not executed normally occasionally, you can manually execute the scheduled task and click execute next to the scheduled task. the scheduled task is executed immediately,
Note::
1. unlike other functions, scheduled tasks are set and displayed based on the default time difference of the site system, the displayed or set time value is not changed based on the time difference setting of a user or administrator.
2. scheduled tasks are a feature closely related to the system's core. Improper configuration may cause potential risks of website functions. in severe cases, the site may fail to run normally, therefore, you must add or modify the task project only when you have a good understanding of the features of scheduled tasks and know what you are doing and what the consequences are.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.