X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/ffdc1400431395dfad46e36c05f79466109d36b6..6270f0b685e414b82dd311ad99fe4df0c3e2bfd6:/cookbooks/nginx/templates/default/nginx-old-cache-cleanup.erb diff --git a/cookbooks/nginx/templates/default/nginx-old-cache-cleanup.erb b/cookbooks/nginx/templates/default/nginx-old-cache-cleanup.erb index bb1cf8f36..a67931bff 100644 --- a/cookbooks/nginx/templates/default/nginx-old-cache-cleanup.erb +++ b/cookbooks/nginx/templates/default/nginx-old-cache-cleanup.erb @@ -1,10 +1,10 @@ #!/bin/bash set -e -/usr/bin/renice -n 19 $$ -/usr/bin/ionice -c 3 -p $$ -[[ -d "/var/cache/nginx/fastcgi-cache" ]] && /usr/bin/find /var/cache/nginx/fastcgi-cache/?/??/ -maxdepth 1 -type f -delete || true +/usr/bin/renice -n 19 $$ >/dev/null +/usr/bin/ionice -c 3 -p $$ >/dev/null +[[ -d "/var/cache/nginx/fastcgi-cache" ]] && /usr/bin/find /var/cache/nginx/fastcgi-cache/?/??/ -maxdepth 1 -type f -delete 2>/dev/null || /bin/true [[ -d "/var/cache/nginx/fastcgi-cache" ]] && /usr/bin/find /var/cache/nginx/fastcgi-cache/ -maxdepth 2 -mindepth 2 -type d -wholename '*/?/??' -delete [[ -d "/var/cache/nginx/fastcgi-cache" ]] && /usr/bin/find /var/cache/nginx/fastcgi-cache/ -maxdepth 1 -mindepth 1 -type d -wholename '*/?' -delete -[[ -d "/var/cache/nginx/proxy-cache" ]] && /usr/bin/find /var/cache/nginx/proxy-cache/?/??/ -maxdepth 1 -type f -delete || true +[[ -d "/var/cache/nginx/proxy-cache" ]] && /usr/bin/find /var/cache/nginx/proxy-cache/?/??/ -maxdepth 1 -type f -delete 2>/dev/null || /bin/true [[ -d "/var/cache/nginx/proxy-cache" ]] && /usr/bin/find /var/cache/nginx/proxy-cache/ -maxdepth 2 -mindepth 2 -type d -wholename '*/?/??' -delete [[ -d "/var/cache/nginx/proxy-cache" ]] && /usr/bin/find /var/cache/nginx/proxy-cache/ -maxdepth 1 -mindepth 1 -type d -wholename '*/?' -delete