Updated as per pr comments

This commit is contained in:
laf 2016-07-31 23:39:45 +01:00
parent 1741231ebc
commit 5a7a606abd
2 changed files with 4 additions and 3 deletions

View File

@ -46,8 +46,9 @@ $config['auth_mechanism'] = "mysql"; # default, other options: ldap, http-auth
$config['poller-wrapper']['alerter'] = FALSE;
# Uncomment the next line to disable daily updates
#$config['update'] = 0;
$config['rrd_purge'] = 90;
// Number in days of how long to keep old rrd files.
# Number in days of how long to keep old rrd files. 0 disables this feature
$config['rrd_purge'] = 0;
# Uncomment to submit callback stats via proxy
#$config['callback_proxy'] = "hostname:port";

View File

@ -32,7 +32,7 @@ if ($options['f'] === 'update') {
}
if ($options['f'] === 'rrd_purge') {
if (is_numeric($config['rrd_purge'])) {
if (is_numeric($config['rrd_purge']) && $config['rrd_purge'] > 0) {
$cmd = "find ".$config['rrd_dir']." -mtime +".$config['rrd_purge']." -exec rm -Rf {} \;";
$purge = `$cmd`;
echo 'purged old rrd files';