Skip to content

Commit d3687ad

Browse files
committed
Cron plugin update for @reboot support.
1 parent 3fd6591 commit d3687ad

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

server/plugins-available/cron_plugin.inc.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,12 @@ function _write_crontab() {
194194
$cron_jobs = $app->db->queryAllRecords("SELECT `run_min`, `run_hour`, `run_mday`, `run_month`, `run_wday`, `command`, `type` FROM `cron` WHERE `parent_domain_id` = ".intval($this->parent_domain["domain_id"]) . " AND `active` = 'y'");
195195
if($cron_jobs && count($cron_jobs) > 0) {
196196
foreach($cron_jobs as $job) {
197-
$command = "{$job['run_min']}\t{$job['run_hour']}\t{$job['run_mday']}\t{$job['run_month']}\t{$job['run_wday']}";
198-
$command .= "\t{$this->parent_domain['system_user']}"; //* running as user
197+
if($job['run_month'] == '@reboot') {
198+
$command = "@reboot";
199+
} else {
200+
$command = "{$job['run_min']}\t{$job['run_hour']}\t{$job['run_mday']}\t{$job['run_month']}\t{$job['run_wday']}";
201+
}
202+
$command .= "\t{$this->parent_domain['system_user']}"; //* running as user
199203
if($job['type'] == 'url') {
200204
$command .= "\t{$cron_config['wget']} -q -O /dev/null " . escapeshellarg($job['command']) . " >/dev/null 2>&1";
201205
} else {

0 commit comments

Comments
 (0)