| 1 |
Web Cron plugin |
| 2 |
=============== |
| 3 |
|
| 4 |
This plugin can be used to replace cron tasks by API calls. |
| 5 |
|
| 6 |
Configuration |
| 7 |
------------- |
| 8 |
To enable Web Cron: |
| 9 |
Go in Manager, ``General Parameters`` » ``Plugins`` » ``Web Cron``. |
| 10 |
You must set a shared secret. |
| 11 |
|
| 12 |
Usage |
| 13 |
----- |
| 14 |
|
| 15 |
When enabled, portal exposes ``/webcron/purge`` and ``/webcron/localpurge`` API. |
| 16 |
GET *(or POST)* parameters: |
| 17 |
|
| 18 |
============= ======== ============================================================ |
| 19 |
GET Parameter Need Value |
| 20 |
============= ======== ============================================================ |
| 21 |
``secret`` required Same value as the shared secret given to the manager |
| 22 |
============= ======== ============================================================ |
| 23 |
|
| 24 |
Response |
| 25 |
-------- |
| 26 |
|
| 27 |
The plugin will respond to the HTTP request with: |
| 28 |
|
| 29 |
* HTTP code 500 if something went wrong |
| 30 |
* HTTP code 200 and the following JSON content if everything went right |
| 31 |
|
| 32 |
.. code:: json |
| 33 |
|
| 34 |
{"result":1,"err":0} |
| 35 |
|
| 36 |
.. versionadded:: 2.22.0 |
| 37 |
|
| 38 |
Example |
| 39 |
~~~~~~~ |
| 40 |
|
| 41 |
- Clean central database: |
| 42 |
``curl -XPOST --data-urlencode 'secret=qwerty' https://auth.example.com/webcron/purge`` |
| 43 |
- Clean local cache: |
| 44 |
``curl -XPOST --data-urlencode 'secret=qwerty' https://auth.example.com/webcron/localpurge`` |