From: Grant Slater Date: Thu, 9 Jul 2020 00:22:18 +0000 (+0100) Subject: tilecache: compress old curl time records X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/99de8efe8964e72593996423f1854379c1d5781d?hp=fc2ca30e571cbfebaf13589bd7f4c09dd57ed404 tilecache: compress old curl time records --- diff --git a/cookbooks/tilecache/recipes/default.rb b/cookbooks/tilecache/recipes/default.rb index 16a8af1be..22272b3aa 100644 --- a/cookbooks/tilecache/recipes/default.rb +++ b/cookbooks/tilecache/recipes/default.rb @@ -206,8 +206,11 @@ template "/srv/tilecache/tilecache-curl-time" do variables :caches => tilecaches, :renders => tilerenders end -file "/srv/tilecache/tilecache-fastest-peers" do - action :delete +template "/srv/tilecache/tilecache-curl-time-cleanup" do + source "tilecache-curl-time-cleanup.erb" + owner "root" + group "root" + mode 0o755 end ohai_plugin "tilecache" do diff --git a/cookbooks/tilecache/templates/default/cron.erb b/cookbooks/tilecache/templates/default/cron.erb index f510ad735..ab8ad8397 100644 --- a/cookbooks/tilecache/templates/default/cron.erb +++ b/cookbooks/tilecache/templates/default/cron.erb @@ -2,3 +2,4 @@ 0 * * * * root /usr/local/bin/nginx_generate_tilecache_qos_map * * * * * www-data /srv/tilecache/tilecache-curl-time +15 0 * * * www-data /srv/tilecache/tilecache-curl-time-cleanup diff --git a/cookbooks/tilecache/templates/default/tilecache-curl-time-cleanup.erb b/cookbooks/tilecache/templates/default/tilecache-curl-time-cleanup.erb new file mode 100644 index 000000000..3be4267dc --- /dev/null +++ b/cookbooks/tilecache/templates/default/tilecache-curl-time-cleanup.erb @@ -0,0 +1,3 @@ +#/bin/bash +set -eu +/usr/bin/find /srv/tilecache/data/ -type f -iname '*.txt' -mtime +7 -print0 | /usr/bin/xargs -0 -n 12 --no-run-if-empty -P 2 /usr/bin/xz -9e