X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/8323b6a7e371e288c06626e5e7bf80e440fe9d19..699e157e3d708f38064eea9072aa210fe5ccac30:/cookbooks/web/templates/default/rails.cron.erb diff --git a/cookbooks/web/templates/default/rails.cron.erb b/cookbooks/web/templates/default/rails.cron.erb index e34880f36..4fe3bf99a 100644 --- a/cookbooks/web/templates/default/rails.cron.erb +++ b/cookbooks/web/templates/default/rails.cron.erb @@ -1,7 +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 -/usr/local/bin/cleanup-rails-assets <%= @directory %> +if [ -x /usr/local/bin/cleanup-rails-assets ] +then + /usr/local/bin/cleanup-rails-assets <%= @directory %> +fi