You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: admin-guide/en/deploy-jobs.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,24 +58,24 @@ stdout_logfile=<log-file>
58
58
59
59
Replace the following variables in the configuration above with the correct paths in your system:
60
60
61
-
| Variable | Description |
62
-
|---|---|
63
-
|`<path-to-php>`| Absolute path on the server to the CLI PHP executable. This can be found on most Linux servers by running `which php`. |
64
-
|`<root>`| Absolute path to the root directory of the application (OJS, OMP, OPS). |
65
-
|`<log-file>`| Absolute path to a log file. If hosting in a cloud environment, you may want to [direct logs to stdout](https://stackoverflow.com/a/26897648/1723499). |
|`<path-to-php>`| Absolute path on the server to the CLI PHP executable. This can be found on most Linux servers by running `which php`. |
64
+
|`<root>`| Absolute path to the root directory of the application (OJS, OMP, OPS).|
65
+
|`<log-file>`| Absolute path to a log file. If hosting in a cloud environment, you may want to [direct logs to stdout](https://stackoverflow.com/a/26897648/1723499). |
66
66
67
67
> Take note that workers are long-running processes that load the application in memory. As a result, any changes when workers are running will not reflect instantly without restarting the worker.
68
68
{:.notice}
69
69
70
-
Restart Worker.
70
+
To restart the worker:
71
71
72
72
```
73
73
php lib/pkp/tools/jobs.php restart
74
74
```
75
75
76
76
The above command will quit the workers gracefully what is workers will get to complete the current job execution and then quit. Then the Supervisor will restart the workers.
77
77
78
-
Restart Supervisor.
78
+
To restart Supervisor:
79
79
80
80
```
81
81
sudo service supervisor restart
@@ -87,10 +87,10 @@ You may need to run the following command to apply the configuration changes.
87
87
supervisorctl reread
88
88
```
89
89
90
-
> **Warning:** We strongly recommend restarting the Worker rather than Supervisor to reflect and consider the new changes pushed to production. Restarting Supervisor suddenly will cause the workers to quit abruptly and if the workers are in the middle of processing a job, it will not get the chance to complete the job which may cause undesired.
90
+
> **Warning:** We strongly recommend restarting the Worker rather than Supervisor to reflect and consider the new changes pushed to production. Restarting Supervisor suddenly will cause the workers to quit abruptly, and if the workers are in the middle of processing a job, they will not complete the job which may cause undesired effects.
91
91
{:.warning}
92
92
93
-
To configure Supervisor on other systems, or to learn more about monitoring processes, read the [Supervisor documentation](http://supervisord.org/index.html).
93
+
To configure Supervisor on other systems or to learn more about monitoring processes, read the [Supervisor documentation](http://supervisord.org/index.html).
94
94
95
95
Once you have set up the worker, turn the default job runner off in `config.inc.php`:
96
96
@@ -110,7 +110,7 @@ php lib/pkp/tools/jobs.php run
110
110
111
111
A cron job configured to run the following command will process only one job.
Copy file name to clipboardExpand all lines: admin-guide/en/deploy-sandbox.md
+6-7Lines changed: 6 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ Beginning with OJS, OMP, and OPS 3.4.0-4, there is a sandbox mode that can be en
19
19
To enable the sandbox mode for an installation, edit `config.inc.php` and find the `sandbox` setting in the `[general]` section. Setting it to `On` will have following impacts:
20
20
21
21
- The email `default` driver will be set to `log`. As a result, all emails will be routed to the server's error log and no emails will be delivered.
22
-
- Scheduled tasks that run at regular intervals to send out reminder emails, deposit data with third-party services, and perform other tasks will be disabled. This will also disable schedule task execution via `Acron` plugin.
22
+
- Scheduled tasks that run at regular intervals to send out reminder emails, deposit data with third-party services, and perform other tasks will be disabled.
23
23
- Job execution will be disabled. However, jobs will continue to be dispatched to the queue as usual.
24
24
-`Crossref` and `Datacite` deposits will be disabled.
25
25
- The application will not have any interaction with the ORCID service.
@@ -46,22 +46,21 @@ default = log
46
46
47
47
Scheduled tasks are run at regular intervals to send out reminder emails, deposit data with third-party services, and perform other tasks. They may be triggered in a couple different ways, depending how you configured them.
48
48
49
-
If you have a **cron job** set up to run the following command, delete that cron job.
49
+
To disable the built-in task runner, find and edit the following setting in the `[schedule]` section of `config.inc.php`.
50
50
51
51
```
52
-
php tools/runScheduledTasks.php
52
+
task_runner = Off
53
53
```
54
54
55
-
If you have the**acron plugin**installed, remove it by running the following command in the root directory of the application.
55
+
If you have a**cron job**set up to run the following command, delete that cron job.
56
56
57
57
```
58
-
rm -rf plugins/generic/acron
59
-
rm -rf lib/pkp/plugins/generic/acron
58
+
php tools/runScheduledTasks.php
60
59
```
61
60
62
61
### Disable jobs
63
62
64
-
Stop the job runner in order to prevent pending jobs like data deposits from being run. Turn the built-in job runner off in `config.inc.php`.
63
+
Stop the job runner to prevent pending jobs like data deposits from being run. Turn the built-in job runner off in `config.inc.php`.
description: Options to configure scheduled tasks with Open Journal Systems (OJS), Open Monograph Press (OPS) or Open Preprint Systems (OPS).
4
+
book: admin-guide
5
+
version: 3.5
6
+
---
7
+
8
+
# Scheduled Tasks
9
+
10
+
Scheduled tasks are used to perform periodic tasks or [jobs](./deploy-jobs) on a schedule, such as [processing statistics](./statistics), removing expired data, sending emails, or exporting data to third-party services (e.g. registering DOIs or exporting articles to DOAJ).
11
+
12
+
To see available options, run:
13
+
14
+
```
15
+
php lib/pkp/tools/scheduler.php usage
16
+
```
17
+
18
+
To see all registered scheduled tasks, run:
19
+
20
+
```
21
+
php lib/pkp/tools/scheduler.php list
22
+
```
23
+
24
+
To run all pending scheduled tasks, run:
25
+
26
+
```
27
+
php lib/pkp/tools/scheduler.php run
28
+
```
29
+
30
+
To run a single specific scheduled task, which is particularly useful for development purposes, run:
31
+
32
+
```
33
+
php lib/pkp/tools/scheduler.php test
34
+
```
35
+
36
+
## Log Files
37
+
38
+
Scheduled task logs are located in files directory under `<files_dir>/scheduledTaskLogs`.
39
+
40
+
## Configuration
41
+
42
+
### Scheduled Task Runner
43
+
44
+
In 3.5 and later, the Acron plugin has been removed and a built-in task runner has been introduced.
45
+
46
+
To enable the built-in task runner, set the following in the `[schedule]` section in `config.inc.php`:
47
+
48
+
```
49
+
task_runner = On
50
+
```
51
+
52
+
To adjust the interval at which the built-in task runner runs, adjust the following setting in `config.inc.php`. A smaller value may negatively impact application performance.
53
+
54
+
```
55
+
task_runner_interval = 60
56
+
```
57
+
58
+
The built-in task runner may not be suitable for high-volume sites; in this case, we recommend using your operating system's task scheduler instead. The following is a sample crontab entry for *nix operating systems:
To receive an email notification only when a scheduled task fails, set the following in `config.inc.php`. Otherwise, all tasks will generate a notification.
67
+
68
+
```
69
+
scheduled_tasks_report_error_only = On
70
+
```
71
+
72
+
---
73
+
74
+
Next, learn about how to improve performance with the [job runner](./deploy-jobs).
0 commit comments