From 218c4e6b524928ebe1e149c000aaeac01e75e32f Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Mon, 1 Aug 2016 13:24:25 -0500 Subject: [PATCH] Do not delete directories, only files. --- daily.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daily.php b/daily.php index 2e6ae27597..4f3292ec8a 100644 --- a/daily.php +++ b/daily.php @@ -33,10 +33,10 @@ if ($options['f'] === 'update') { if ($options['f'] === 'rrd_purge') { if (is_numeric($config['rrd_purge']) && $config['rrd_purge'] > 0) { - $cmd = "find ".$config['rrd_dir']." -mtime +".$config['rrd_purge']." -print -exec rm -Rf {} \;"; + $cmd = "find ".$config['rrd_dir']." -type f -mtime +".$config['rrd_purge']." -print -exec rm -f {} +"; $purge = `$cmd`; if (!empty($purge)) { - echo "Purged the following RRD files due to old age (over ".$config['rrd_purge']." days old)"; + echo "Purged the following RRD files due to old age (over ".$config['rrd_purge']." days old):\n"; echo $purge; } }