Skip to content

Commit df09183

Browse files
committed
Do not add redirection when the command already does that itself.
1 parent 5a5dc30 commit df09183

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

server/plugins-available/cron_plugin.inc.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,13 @@ function _write_crontab() {
259259

260260
$command .= "\t";
261261
//if($job['type'] != 'chrooted' && substr($job['command'], 0, 1) != "/") $command .= $this->parent_domain['document_root'].'/';
262-
$command .= $job['command'] . " " . $log_target;
262+
263+
$command .= $job['command'];
264+
265+
// Add a default log target when no redirection is included in the command.
266+
if (!preg_match('/>/', $job['command'])) {
267+
$command .= " " . $log_target;
268+
}
263269
}
264270

265271
if($job['type'] == 'chrooted') {

0 commit comments

Comments
 (0)