From 4e0a61be7ea612c04acfe0162a085938a6ef685b Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 22 Sep 2015 12:56:29 +0100 Subject: [PATCH] Improve rails tmp dir cleanup script --- cookbooks/web/templates/default/rails.cron.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbooks/web/templates/default/rails.cron.erb b/cookbooks/web/templates/default/rails.cron.erb index 7945c3dea..35256a2ce 100644 --- a/cookbooks/web/templates/default/rails.cron.erb +++ b/cookbooks/web/templates/default/rails.cron.erb @@ -1,4 +1,4 @@ #!/bin/sh # Cleanup temporary directory -find <%= @directory %>/tmp -mtime +28 -print0 | xargs -0r rm +find <%= @directory %>/tmp \( \( -type f -mtime +28 \) -o \( -type d -empty \) \) -delete -- 2.39.5