]> git.openstreetmap.org Git - chef.git/blob - cookbooks/web/templates/default/logrotate.web.erb
b0028af87d90318f976b13effa1b7ae6234658e5
[chef.git] / cookbooks / web / templates / default / logrotate.web.erb
1 # DO NOT EDIT - This file is being maintained by Chef
2
3 <%= node[:web][:log_directory] %>/*.log {
4   daily
5   missingok
6   rotate 7
7   compress
8   delaycompress
9   notifempty
10   create 0660 rails rails
11   sharedscripts
12   postrotate
13 <% if File.directory?("#{node[:web][:base_directory]}/rails") -%>
14     PASSENGER_INSTANCE_REGISTRY_DIR=<%= node[:passenger][:instance_registry_dir] %> /usr/bin/passenger-config restart-app --ignore-app-not-running <%= node[:web][:base_directory] %>/rails > /dev/null
15 <% if node[:recipes].include?("logstash::forwarder") -%>
16     /etc/init.d/logstash-forwarder restart > /dev/null
17 <% end -%>
18 <% end -%>
19 <% if File.directory?("#{node[:web][:base_directory]}/gpx-import") -%>
20     /bin/systemctl try-reload-or-restart gpx-import
21 <% end -%>
22 <% if File.directory?("#{node[:web][:base_directory]}/cgimap") -%>
23     /bin/systemctl reload cgimap
24     /usr/bin/rsync --preallocate <%= node[:web][:log_directory] %>/cgimap.log.2.gz ironbelly::logs/www.openstreetmap.org/cgimap-<%= node[:hostname] %>-`date -d "-2 days" +%Y-%m-%d`.gz
25 <% end -%>
26   endscript
27 }