From: Grant Slater Date: Tue, 1 Oct 2013 14:10:52 +0000 (+0100) Subject: tilecache: rsync logs to ironbelly on logrotate X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/5cffb5b0ddf35b84074a81929f05982d76a13008?ds=sidebyside tilecache: rsync logs to ironbelly on logrotate --- diff --git a/cookbooks/tilecache/recipes/default.rb b/cookbooks/tilecache/recipes/default.rb index 7feb45fc9..4015f9941 100644 --- a/cookbooks/tilecache/recipes/default.rb +++ b/cookbooks/tilecache/recipes/default.rb @@ -48,3 +48,11 @@ squid_fragment "tilecache" do template "squid.conf.erb" variables :caches => tilecaches end + +template "/etc/logrotate.d/squid" do + source "logrotate.squid.erb" + owner "root" + group "root" + mode 0644 +end + diff --git a/cookbooks/tilecache/templates/default/logrotate.squid.erb b/cookbooks/tilecache/templates/default/logrotate.squid.erb new file mode 100644 index 000000000..80953e840 --- /dev/null +++ b/cookbooks/tilecache/templates/default/logrotate.squid.erb @@ -0,0 +1,15 @@ +# DO NOT EDIT - This file is being maintained by Chef + +/var/log/squid/*.log { + daily + compress + delaycompress + 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 + endscript +}