From: Tom Hughes Date: Wed, 5 Oct 2016 07:36:06 +0000 (+0100) Subject: Only cleanup rails temporary directory if it exists X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/b28584a7d5e39423ed786caab72ac2d0990277b2?hp=9885862c273a16c5aae35c0c600035a2f8a804c9 Only cleanup rails temporary directory if it exists --- diff --git a/cookbooks/web/templates/default/rails.cron.erb b/cookbooks/web/templates/default/rails.cron.erb index b28eed753..4fe3bf99a 100644 --- a/cookbooks/web/templates/default/rails.cron.erb +++ b/cookbooks/web/templates/default/rails.cron.erb @@ -1,7 +1,10 @@ #!/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 ]