From: Grant Slater Date: Sat, 11 Jan 2014 15:48:30 +0000 (+0000) Subject: tilecache: use xz for logrotate X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/91519a02764b8a075676b05e3bfb1932dc3afac5 tilecache: use xz for logrotate --- diff --git a/cookbooks/tilecache/recipes/default.rb b/cookbooks/tilecache/recipes/default.rb index aec517025..647e0dc07 100644 --- a/cookbooks/tilecache/recipes/default.rb +++ b/cookbooks/tilecache/recipes/default.rb @@ -23,6 +23,8 @@ include_recipe "ssl" include_recipe "squid" include_recipe "nginx" +package "xz-utils" + tilecaches = search(:node, "roles:tilecache").sort_by { |n| n[:hostname] } tilerenders = search(:node, "roles:tile").sort_by { |n| n[:hostname] } diff --git a/cookbooks/tilecache/templates/default/logrotate.squid.erb b/cookbooks/tilecache/templates/default/logrotate.squid.erb index 061cc8e45..87cafabd4 100644 --- a/cookbooks/tilecache/templates/default/logrotate.squid.erb +++ b/cookbooks/tilecache/templates/default/logrotate.squid.erb @@ -3,12 +3,15 @@ /var/log/squid/*.log { daily compress + compresscmd /usr/bin/xz + uncompresscmd /usr/bin/unxz + compressext .xz rotate 2 missingok nocreate sharedscripts postrotate test ! -e /var/run/squid.pid || /usr/sbin/squid -k rotate - /usr/bin/rsync /var/log/squid/zere.log.2.gz ironbelly::logs/tile.openstreetmap.org/<%= node[:hostname] %>-`date -d "-2 days" +%Y-%m-%d`.gz + /usr/bin/rsync /var/log/squid/zere.log.2.xz ironbelly::logs/tile.openstreetmap.org/<%= node[:hostname] %>-`date -d "-2 days" +%Y-%m-%d`.xz endscript }