Merge pull request #343 from elbuit/issue-341

Add option to clean old perf_times table entries #341
This commit is contained in:
Neil Lathwood
2014-11-03 18:50:22 +00:00
3 changed files with 9 additions and 0 deletions

View File

@@ -48,5 +48,12 @@ if ($options['f'] === 'authlog') {
}
}
}
if ($options['f'] === 'perf_times') {
if (is_numeric($config['perf_times_purge'])) {
if (dbDelete('perf_times', "start < UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL ? DAY))", array($config['perf_times_purge'])) ) {
echo 'Performance poller times cleared for entries over ' . $config['perf_times_purge'] . " days\n";
}
}
}
?>

View File

@@ -10,3 +10,4 @@ fi
php daily.php -f syslog
php daily.php -f eventlog
php daily.php -f authlog
php daily.php -f perf_times

View File

@@ -576,6 +576,7 @@ $config['update'] = 1;
$config['syslog_purge'] = 30; # Number in days of how long to keep syslog entries for.
$config['eventlog_purge'] = 30; # Number in days of how long to keep eventlog entries for.
$config['authlog_purge'] = 30; # Number in days of how long to keep authlog entries for.
$config['perf_times_purge'] = 30; # Number in days of how long to keep performace pooling stats entries for.
# Date format for PHP date()s
$config['dateformat']['long'] = "r"; # RFC2822 style