]> git.openstreetmap.org Git - chef.git/commitdiff
Improve rails tmp dir cleanup script
authorTom Hughes <tom@compton.nu>
Tue, 22 Sep 2015 11:56:29 +0000 (12:56 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 22 Sep 2015 11:56:29 +0000 (12:56 +0100)
cookbooks/web/templates/default/rails.cron.erb

index 7945c3dea22b22d6c5adc7a6d34690e8272dcb93..35256a2cebf89a3f3b11c71182791d63b337b507 100644 (file)
@@ -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