Loading...
 
Skip to main content

History: Scheduler

Source of version: 19 (current)

Copy to clipboard
            ! {{page}}
Scheduler for Tiki (cron jobs)
An internal scheduler was added in ((Tiki17)), so that only one cron job needs to be defined in the system crontab, and all actions to be run a scheduled times can then be defined within Tiki UI. 

!!# How to find it
In the quick admin module, and in the main application menu under "Settings" section ("https://example.org/tiki-admin_schedulers.php").

!!# Overview
You can list scheduled tasks
{img src="display1326" link="display1326" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"}

You can edit one scheduled task
{img src="display1325" link="display1325" width="400" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"}

Syntax for the scheduled run time is similar to the syntax used in system crontabs in GNU/Linux and equivalent operating systems:
{BOX()}
Use CRON format to enter the values in “Run Time”: 
Minute, Hour, Day of Month, Month, Day of Week 
Eg. every 5 minutes: */5 * * * *
{BOX}

See [https://en.wikipedia.org/wiki/Cron] for details on Cron formats. For example:

{CODE()}
* * * * *
| | | | | 
| | | | | 
| | | | +---- Day of the Week   (range: 1-7, 1 = Monday)
| | | +------ Month of the Year (range: 1-12)
| | +-------- Day of the Month  (range: 1-31)
| +---------- Hour              (range: 0-23)
+------------ Minute            (range: 0-59)
{CODE}

!! To set master cron job
!!! Manually
The master cron job must be run quite frequently to check if Tiki Scheduler must launch another operation.

Here are some examples (adjust to your server path and use case)
{CODE(caption="To run every minute")}* * * * * php /var/www/html/console.php scheduler:run{CODE}

{CODE(caption="To run every 30 minutes")}*/30 * * * * php /var/www/html/console.php scheduler:run{CODE}

{REMARKSBOX(type="info" title="Process Ownership")}__NOTE:__ If the tasks set up in your scheduler create cache files (which they often will) then you need to run this cron job as your webserver user, e.g. -+www-data+-, -+apache+-, -+nginx+- etc{REMARKSBOX}

!!! Via Tiki Manager
* ((Manager)) See instance:setup-scheduler-cron

!!! Samples
!!!! Rebuild the Unified-Index with log
Using the Tiki Scheduler and a ((Console)) command, once you have set your master Cron Job (see above) you can automatically rebuild your ((Search and List from Unified Index|Unified Index)) to assure your Tiki freshness. In this sample we also generate logs so we can investigate in case there were an issue.

{img type="fileId" fileId="1838" responsive="y" featured="y" class="border"}

!! Related
* ((Cron))
* ((Cron Job to Rebuild Search Index))
* ((PluginListExecute))
* ((Console))
* Profile: ((pr:Scheduler_presets_20))
* Original feature request: ((dev:cron job handing via Tiki))

-=alias=-
* (alias(Scheduler Management))
        

History

Advanced
Information Version
Bernard Sfez / Tiki Specialist Adding rebuild index sample 19
Adrien 18
Adrien 17
Marc Laporte 16
Jonny Bradley 15
Xavier de Pedro 14
Rick Sapir / Tiki for Smarties added better example of cron formats and info 13
Xavier de Pedro 12
Marc Laporte 11
Xavi (as xavidp - admin) 10
Xavi (as xavidp - admin) Mass search and replace 9
Marc Laporte Edit restored by rescue script 2017-04-24T18:09:12+00:00 8
Marc Laporte Edit restored by rescue script 2017-04-24T18:09:12+00:00 7
Marc Laporte Edit restored by rescue script 2017-04-24T18:09:12+00:00 6
Marc Laporte Edit restored by rescue script 2017-04-24T18:09:12+00:00 5
Marc Laporte Edit restored by rescue script 2017-04-24T18:09:12+00:00 4
Marc Laporte Edit restored by rescue script 2017-04-24T18:09:12+00:00 3
Xavier de Pedro Edit restored by rescue script 2017-04-24T18:09:12+00:00 2
Xavier de Pedro Page created by rescue script 2017-04-24T18:09:12+00:00 1