]> git.openstreetmap.org Git - chef.git/blob - cookbooks/tilecache/templates/default/logrotate.squid.erb
Fix logrotate for squid 4.11
[chef.git] / cookbooks / tilecache / templates / default / logrotate.squid.erb
1 # DO NOT EDIT - This file is being maintained by Chef
2
3 /var/log/squid/*.log {
4   daily
5   compress
6   compresscmd /usr/bin/xz
7   compressoptions --threads=<%= [ node[:cpu][:total] / 2, 1 ].max.ceil %>
8   uncompresscmd /usr/bin/unxz
9   compressext .xz
10   rotate 2
11   missingok
12   nocreate
13   sharedscripts
14   postrotate
15 <% if node[:lsb][:release].to_f < 20.04 -%>
16     test ! -e /var/run/squid.pid || /usr/sbin/squid -k rotate
17 <% else -%>
18     test ! -e /run/squid/squid.pid || /usr/sbin/squid -k rotate
19 <% end -%>
20   endscript
21   lastaction
22     /usr/bin/rsync --preallocate /var/log/squid/access.log.1.xz ironbelly::logs/tile.openstreetmap.org/<%= node[:hostname] %>-`date -d "-1 days" +%Y-%m-%d`.xz || true
23   endscript
24 }