From: Tom Hughes Date: Tue, 22 Sep 2015 11:56:29 +0000 (+0100) Subject: Improve rails tmp dir cleanup script X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/4e0a61be7ea612c04acfe0162a085938a6ef685b Improve rails tmp dir cleanup script --- 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