my bad, it is -maxdepth that would require an argument, -depth does not. Simply moving -depth before -type does the right thing:
--- /usr/bin/pt-stalk 2012-08-24 06:46:38.000000000 -0300 +++ pt-stalk 2012-08-24 07:00:00.000000000 -0300 @@ -1037,8 +1037,8 @@ 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" -depth -type d -name 'pt_collect_*' \ + -mtime +$retention_time -exec rm -rf '{}' \; fi }
my bad, it is -maxdepth that would require an argument, -depth does not. Simply moving -depth before -type does the right thing:
--- /usr/bin/pt-stalk 2012-08-24 06:46:38.000000000 -0300 pt_collect_ $p
+++ pt-stalk 2012-08-24 07:00:00.000000000 -0300
@@ -1037,8 +1037,8 @@
if [ -d "$oprofile_dir" ]; then
# "pt_collect_" here needs to match $CMD_OPCONTROL --save=
# in collect(). TODO: fix this
- find "$oprofile_dir" -type d -name 'pt_collect_*' \
- -depth -mtime +$retention_time -exec rm -rf '{}' \;
+ find "$oprofile_dir" -depth -type d -name 'pt_collect_*' \
+ -mtime +$retention_time -exec rm -rf '{}' \;
fi
}