|
1 ======================= |
|
2 pyams_scheduler package |
|
3 ======================= |
|
4 |
|
5 .. contents:: |
|
6 |
|
7 What is pyams_scheduler? |
|
8 ======================== |
|
9 |
|
10 pyams_scheduler is a package which is part of the PyAMS framework and is targeted to the Pyramid environment. |
|
11 |
|
12 This package allows to define tasks which will be scheduled and run asynchronously on a regular basis. |
|
13 |
|
14 Scheduling is based on the APScheduler package, and tasks can be scheduled using cron-style, "at" or interval |
|
15 based scheduling settings. But tasks definitions are stored in the ZODB and they can be managed easily through |
|
16 a simple web interface; synchronisation between the web process and the scheduler background process is done |
|
17 using ØMQ messages. |
|
18 |
|
19 Tasks can keep an history log in the ZODB; these logs can also be sent by mail, on each run or when errors |
|
20 are detected. |
|
21 |
|
22 |
|
23 Starting scheduler |
|
24 ================== |
|
25 |
|
26 The APScheduler process is started automatically on package include. |
|
27 |
|
28 The only thing you have to do is to create an application setting in your INI file, like this: |
|
29 |
|
30 pyams_scheduler.tcp_handler = 127.0.0.1:5555 |
|
31 |
|
32 This will define the address and port of the listening ØMQ process. Without this setting, the scheduler won't |
|
33 be started. |
|
34 |
|
35 |
|
36 Adding tasks |
|
37 ============ |
|
38 |
|
39 Three task types are defined into PyAMS scheduler package: |
|
40 |
|
41 - an URL caller task, which can be used to call any HTTP based URL |
|
42 |
|
43 - an SSH command task, which can be used to start local or remote commands |
|
44 |
|
45 - a ZODB packing task, which can be used to pack a ZODB. |
|
46 |
|
47 You can also register and add your own tasks, which will be added through PyAMS management interface. |
|
48 |
|
49 Each task as a set of common properties which are used to name the task, define the scheduling mode and reports |
|
50 management and activate and schedule the task, as well as settings specific to the given task. |