[aiaiai v3] aiaiai-email-lda: allow reaping of series directories

Jacob Keller jacob.e.keller at intel.com
Wed Aug 26 13:39:53 PDT 2015

reap_old did not remove series directories, because "rm -f" does not
remove directories. However, adding just "-r" to the rm command results
in extraneous "directory does not exist" because find will be searching
more than one depth. Change reap_old to have a max depth of 1 so that it
doesn't descend into directories and will happily remove series
directories created inside of queue.

Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
 email/aiaiai-email-lda | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/email/aiaiai-email-lda b/email/aiaiai-email-lda
index 0ac9f0b4cd09..d3582adcaf01 100755
--- a/email/aiaiai-email-lda
+++ b/email/aiaiai-email-lda
@@ -454,7 +454,7 @@ reap_old()
 	local min="$1"; shift
 	verbose "Reaping files older than \"$min\" minutes in \"$dir\""
-	find "$dir" -mindepth 1 -mmin +"$min" -exec rm $verbose -f -- "{}" ";" >&2
+	find "$dir" -mindepth 1 -maxdepth 1 -mmin +"$min" -exec rm $verbose -r -f -- "{}" ";" >&2

More information about the aiaiai mailing list