Changeset 14632 for trunk/periodic
- Timestamp:
- 11/11/10 00:05:40 (19 months ago)
- File:
-
- 1 edited
-
trunk/periodic/cron.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/periodic/cron.php
r14533 r14632 27 27 require_once(BX_DIRECTORY_PATH_CLASSES . 'BxDolDb.php'); 28 28 29 /* 30 * This file is used for cron jobs. He is started system cron every minute. 31 * The file runs jobs at regular intervals. These jobs are listed in `sys_cron_jobs` table. 32 * 33 * Fields shark_cron_jobs table: 34 * id - key for the table 35 * name - job name to be executed 36 * time - format of entries are five fields of numbers specifying the minute, 37 * hour, day of the month, month and day of the week that a task must be executed. 38 * 39 * * * * * * 40 * | | | | | 41 * | | | | +--- day of week(0-6 with 0=Sunday) 42 * | | | +----- month(1-12) 43 * | | +------- day of month(1-31) 44 * | +--------- hour(0-23) 45 * +----------- minute(0-59) 46 * 47 * class - class name which will run 48 * file - path to class file 49 * eval - source code which will run 50 * 51 * The time numbers can be given as a comma separated list of simple numbers, 52 * ranges("2-5" is the same as "2,3,4,5"). A single "*" can be used in a field to indicate all 53 * valid numbers in that field, so it translates to "always". If a given time is valid in all five 54 * fields then a module function is executed. Here are a few examples that illustrate the possibilities: 55 * 56 * will run at 16:10: 57 * 10 16 58 * will run at 2:00 on saturday: 59 * 0 2 * * 6 60 * will run at midnight on new years: 61 * 0 0 1 1 0 62 * will run every 15 minutes: 63 * *\/15 64 * will run at 22:00 on work weekdays: 65 * 0 22 * * 1-5 66 * will run each 23 minutes, 2:00, 4:00 ..., everyday 67 * 23 0-23/2 68 * 69 * Example add new cron job: 70 * 71 * 1. Create new class inherited from "BxDolCron" and add method "processing" 72 * 73 * class BxDolCronMy extends BxDolCron { 74 * 75 * function processing() 76 * { 77 * // insert code 78 * } 79 * } 80 * 81 * 2. Add record in `sys_cron_jobs` table 82 * 83 * @see an example of BxDolCronNotifies, BxDolCronCupid, BxDolCronCmd. 84 * 85 * 86 * Memberships/ACL: 87 * Doesn't depend on user's membership. 88 * 89 * 90 * Alerts: 91 * no alerts available 92 * 93 */ 29 94 30 function getRange($iLow, $iHigh, $iStep) 95 31 {
Note: See TracChangeset
for help on using the changeset viewer.