mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-04-17 01:01:39 +08:00
pt-stalk - removed -warn from find for FreeeBSD portability - lp1494082
This commit is contained in:
@@ -1237,13 +1237,13 @@ purge_samples() {
|
|||||||
local retention_time="$2"
|
local retention_time="$2"
|
||||||
|
|
||||||
# Delete collect files which more than --retention-time days old.
|
# Delete collect files which more than --retention-time days old.
|
||||||
find "$dir" -warn -type f -mtime +$retention_time -exec rm -f '{}' \;
|
find "$dir" -type f -mtime +$retention_time -exec rm -f '{}' \;
|
||||||
|
|
||||||
local oprofile_dir="/var/lib/oprofile/samples"
|
local oprofile_dir="/var/lib/oprofile/samples"
|
||||||
if [ -d "$oprofile_dir" ]; then
|
if [ -d "$oprofile_dir" ]; then
|
||||||
# "pt_collect_" here needs to match $CMD_OPCONTROL --save=pt_collect_$p
|
# "pt_collect_" here needs to match $CMD_OPCONTROL --save=pt_collect_$p
|
||||||
# in collect(). TODO: fix this
|
# in collect(). TODO: fix this
|
||||||
find "$oprofile_dir" -warn -depth -type d -name 'pt_collect_*' \
|
find "$oprofile_dir" -depth -type d -name 'pt_collect_*' \
|
||||||
-mtime +$retention_time -exec rm -rf '{}' \;
|
-mtime +$retention_time -exec rm -rf '{}' \;
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user