From 5a7a606abd6ab3ecf497eb7c6560d0f60496f17e Mon Sep 17 00:00:00 2001 From: laf Date: Sun, 31 Jul 2016 23:39:45 +0100 Subject: [PATCH] Updated as per pr comments --- config.php.default | 5 +++-- daily.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config.php.default b/config.php.default index 85c5de25b0..c8ac44a2bf 100755 --- a/config.php.default +++ b/config.php.default @@ -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"; diff --git a/daily.php b/daily.php index d8579761f7..c4e207e4e6 100644 --- a/daily.php +++ b/daily.php @@ -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';