X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/4e0a61be7ea612c04acfe0162a085938a6ef685b..412d3c00f9079b30ef1bb45955f8fac48ed1ada9:/cookbooks/web/templates/default/rails.cron.erb?ds=inline diff --git a/cookbooks/web/templates/default/rails.cron.erb b/cookbooks/web/templates/default/rails.cron.erb index 35256a2ce..4fe3bf99a 100644 --- a/cookbooks/web/templates/default/rails.cron.erb +++ b/cookbooks/web/templates/default/rails.cron.erb @@ -1,4 +1,13 @@ #!/bin/sh # Cleanup temporary directory -find <%= @directory %>/tmp \( \( -type f -mtime +28 \) -o \( -type d -empty \) \) -delete +if [ -d <%= @directory %>/tmp ] +then + find <%= @directory %>/tmp \( \( -type f -mtime +28 \) -o \( -type d -empty \) \) -delete +fi + +# Cleanup assets +if [ -x /usr/local/bin/cleanup-rails-assets ] +then + /usr/local/bin/cleanup-rails-assets <%= @directory %> +fi