mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 18:38:25 +00:00
Merge pull request #3925 from murrant/purge-fix
Do not delete directories recursively, only files.
This commit is contained in:
commit
f621bf5175
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user