Merge pull request #29 from scarya/master
Added logrotate to speciallogfiles, fixes #1014
This commit is contained in:
@@ -222,7 +222,7 @@ return Array(
|
|||||||
'cron' => Array(
|
'cron' => Array(
|
||||||
'label' => 'Crond (cronscript)',
|
'label' => 'Crond (cronscript)',
|
||||||
'commands' => Array(
|
'commands' => Array(
|
||||||
'echo "*/5 * * * * root /usr/local/bin/php -q '.makeCorrectDir(dirname(dirname(dirname(__FILE__)))).'scripts/froxlor_master_cronjob.php" >> /etc/crontab'
|
'echo "*/5 * * * * root nice -n 5 /usr/local/bin/php -q '.makeCorrectDir(dirname(dirname(dirname(__FILE__)))).'scripts/froxlor_master_cronjob.php" >> /etc/crontab'
|
||||||
),
|
),
|
||||||
'restart' => Array(
|
'restart' => Array(
|
||||||
'/etc/rc.d/cron restart'
|
'/etc/rc.d/cron restart'
|
||||||
|
|||||||
@@ -228,6 +228,38 @@ while($row = $db->fetch_array($result))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// logrotate speciallogfiles
|
||||||
|
if(isset($speciallogfile_domainlist[$row['customerid']])
|
||||||
|
&& is_array($speciallogfile_domainlist[$row['customerid']])
|
||||||
|
&& count($speciallogfile_domainlist[$row['customerid']]) != 0)
|
||||||
|
{
|
||||||
|
reset($speciallogfile_domainlist[$row['customerid']]);
|
||||||
|
foreach($speciallogfile_domainlist[$row['customerid']] as $domainid => $domain)
|
||||||
|
{
|
||||||
|
$fh = fopen($logrotatefile, 'w');
|
||||||
|
|
||||||
|
$logconf = '# ' . basename($logrotatefile) . "\n" . '# Created ' . date('d.m.Y H:i') . "\n" .
|
||||||
|
$settings['system']['logfiles_directory'] . $row['loginname'] .'-' . $domain . '-access.log ' .
|
||||||
|
$settings['system']['logfiles_directory'] . $row['loginname'] .'-' . $domain . '-error.log {' . "\n" .
|
||||||
|
$settings['system']['logrotate_interval'] . "\n" .
|
||||||
|
'missingok' . "\n" .
|
||||||
|
'rotate ' . $settings['system']['logrotate_keep'] . "\n" .
|
||||||
|
'compress' . "\n" .
|
||||||
|
'delaycompress' . "\n" .
|
||||||
|
'notifempty' . "\n" .
|
||||||
|
'create' . "\n" .
|
||||||
|
'}' . "\n";
|
||||||
|
|
||||||
|
fwrite($fh, $logconf);
|
||||||
|
fclose($fh);
|
||||||
|
|
||||||
|
safe_exec(escapeshellcmd($settings['system']['logrotate_binary']) . ' ' . $logrotatefile);
|
||||||
|
|
||||||
|
fwrite($debugHandler, ' apache::reload: reloading apache' . "\n");
|
||||||
|
safe_exec(escapeshellcmd($settings['system']['apachereload_command']));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
reset($domainlist[$row['customerid']]);
|
reset($domainlist[$row['customerid']]);
|
||||||
|
|
||||||
if($settings['system']['mod_log_sql'] == 1)
|
if($settings['system']['mod_log_sql'] == 1)
|
||||||
|
|||||||
@@ -5,4 +5,4 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|||||||
#
|
#
|
||||||
# Regular cron jobs for the froxlor package
|
# Regular cron jobs for the froxlor package
|
||||||
#
|
#
|
||||||
*/5 * * * * root /usr/bin/php5 -q <BASE_PATH>scripts/froxlor_master_cronjob.php
|
*/5 * * * * root nice -n 5 /usr/bin/php5 -q <BASE_PATH>scripts/froxlor_master_cronjob.php
|
||||||
|
|||||||
@@ -5,4 +5,4 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|||||||
#
|
#
|
||||||
# Regular cron jobs for the froxlor package
|
# Regular cron jobs for the froxlor package
|
||||||
#
|
#
|
||||||
*/5 * * * * root /usr/bin/php5 -q <BASE_PATH>scripts/froxlor_master_cronjob.php
|
*/5 * * * * root nice -n 5 /usr/bin/php5 -q <BASE_PATH>scripts/froxlor_master_cronjob.php
|
||||||
|
|||||||
@@ -7,4 +7,4 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
|||||||
#
|
#
|
||||||
# Please check that all following paths are correct
|
# Please check that all following paths are correct
|
||||||
#
|
#
|
||||||
*/5 * * * * root /usr/bin/php -q <BASE_PATH>scripts/froxlor_master_cronjob.php
|
*/5 * * * * root nice -n 5 /usr/bin/php -q <BASE_PATH>scripts/froxlor_master_cronjob.php
|
||||||
|
|||||||
@@ -5,4 +5,4 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|||||||
#
|
#
|
||||||
# Regular cron jobs for the froxlor package
|
# Regular cron jobs for the froxlor package
|
||||||
#
|
#
|
||||||
*/5 * * * * root /usr/bin/php5 -q <BASE_PATH>scripts/froxlor_master_cronjob.php
|
*/5 * * * * root nice -n 5 /usr/bin/php5 -q <BASE_PATH>scripts/froxlor_master_cronjob.php
|
||||||
|
|||||||
@@ -5,4 +5,4 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|||||||
#
|
#
|
||||||
# Regular cron jobs for the froxlor package
|
# Regular cron jobs for the froxlor package
|
||||||
#
|
#
|
||||||
*/5 * * * * root /usr/bin/php5 -q <BASE_PATH>scripts/froxlor_master_cronjob.php
|
*/5 * * * * root nice -n 5 /usr/bin/php5 -q <BASE_PATH>scripts/froxlor_master_cronjob.php
|
||||||
|
|||||||
@@ -5,4 +5,4 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|||||||
#
|
#
|
||||||
# Regular cron jobs for the froxlor package
|
# Regular cron jobs for the froxlor package
|
||||||
#
|
#
|
||||||
*/5 * * * * root /usr/bin/php5 -q <BASE_PATH>scripts/froxlor_master_cronjob.php
|
*/5 * * * * root nice -n 5 /usr/bin/php5 -q <BASE_PATH>scripts/froxlor_master_cronjob.php
|
||||||
|
|||||||
@@ -5,4 +5,4 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|||||||
#
|
#
|
||||||
# Regular cron jobs for the froxlor package
|
# Regular cron jobs for the froxlor package
|
||||||
#
|
#
|
||||||
*/5 * * * * root /usr/bin/php5 -q <BASE_PATH>scripts/froxlor_master_cronjob.php
|
*/5 * * * * root nice -n 5 /usr/bin/php5 -q <BASE_PATH>scripts/froxlor_master_cronjob.php
|
||||||
|
|||||||
Reference in New Issue
Block a user