-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcron.php
96 lines (79 loc) · 2.4 KB
/
cron.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
/**
* Executes all cron tabs and cron jobs as a standalone process
*
* Example usage:
* /usr/local/bin/php -q /home/YOUR_USERNAME/public_html/modules/core/cron.php
*
* Optional command line parameters
* j: job execution limit
* s: cron execution time limit in seconds
* q: job que name to execute. NULL for all, 0 for none.
* t: process cron tabs . 1 or 0
*
* Example usage with parameters:
* /usr/local/bin/php -q /home/YOUR_USERNAME/public_html/modules/core/cron.php -j5 -s3600 -qpriority -t0
*/
chdir(dirname(__FILE__));
$APP_CONF = array();
$Phpr_InitOnly = true;
include '../../index.php';
//Defaults
$process_tabs = true;
$process_que = true;
Core_Cron::$execute_cron_time_limit_seconds = 4500;
//Command line params
$params = getopt("j:s:q:t:");
$job_limit = isset($params['j']) ? $params['j'] : null;
$time_limit = isset($params['s']) ? $params['s'] : null;
$que = isset($params['q']) ? $params['q'] : null;
$tabs = isset($params['t']) ? $params['t'] : null;
if(is_numeric($job_limit)) {
Core_Cron::$cronjob_batch_size = $job_limit;
}
if(is_numeric($time_limit) ) {
Core_Cron::$execute_cron_time_limit_seconds = $time_limit;
@set_time_limit($time_limit); // script limit
}
if($tabs !== null) {
$process_tabs = $tabs ? true : false;
}
if($que !== null){
$process_que = $que ? $que : false;
}
Core_Cron::execute_cron($process_tabs,$process_que);
/*
* WARNING: DO NOT EDIT THIS FILE.
* Changes to the script will be reset by future updates.
* Set up custom cron executions by copying this file to a new filename.
* Eg.
* File: /modules/core/cron_x.php
* Usage: /usr/local/bin/php -q /home/YOUR_USERNAME/public_html/modules/core/cron_x.php
*
* Execution examples below.
*/
/*
* EXECUTE CRON JOBS ONLY
*/
//Core_Cron::$cronjob_batch_size = 10;
//Core_Cron::$cronjob_batch_shuffle = false;
//Core_Cron::$tracelog_events = true;
//$process_tabs = false;
//$process_que = true;
//Core_Cron::execute_cron($process_tabs, $process_que);
/*
* EXECUTE CRON JOBS IN SPECIFIC QUE NAME
*/
//Core_Cron::$cronjob_batch_size = 100;
//Core_Cron::$cronjob_batch_shuffle = true;
//Core_Cron::$tracelog_events = true;
//$process_tabs = false;
//$process_que = 'notifications';
//Core_Cron::execute_cron($process_tabs, $process_que);
/*
* EXECUTE CRON TAB ONLY
*/
//Core_Cron::$tracelog_events = true;
//$process_tabs = true;
//$process_jobs = false;
//Core_Cron::execute_cron($process_tabs, $process_jobs);