Merged fix-942114-bad-find-usage

This commit is contained in:
Brian Fraser fraserb@gmail.com
2012-08-27 13:12:20 -03:00
2 changed files with 27 additions and 7 deletions

View File

@@ -1034,14 +1034,14 @@ purge_samples() {
local retention_time="$2"
# Delete collect files which more than --retention-time days old.
find "$dir" -type f -mtime +$retention_time -exec rm -f '{}' \;
find "$dir" -warn -type f -mtime +$retention_time -exec rm -f '{}' \;
local oprofile_dir="/var/lib/oprofile/samples"
if [ -d "$oprofile_dir" ]; then
# "pt_collect_" here needs to match $CMD_OPCONTROL --save=pt_collect_$p
# in collect(). TODO: fix this
find "$oprofile_dir" -type d -name 'pt_collect_*' \
-depth -mtime +$retention_time -exec rm -rf '{}' \;
find "$oprofile_dir" -warn -depth -type d -name 'pt_collect_*' \
-mtime +$retention_time -exec rm -rf '{}' \;
fi
}