]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/planet/templates/default/logrotate.apache.erb
Manage rotation of planet logs with archiving
[chef.git] / cookbooks / planet / templates / default / logrotate.apache.erb
diff --git a/cookbooks/planet/templates/default/logrotate.apache.erb b/cookbooks/planet/templates/default/logrotate.apache.erb
new file mode 100644 (file)
index 0000000..e7d9e3c
--- /dev/null
@@ -0,0 +1,21 @@
+# DO NOT EDIT - This file is being maintained by Chef
+
+/var/log/apache2/*.log {
+       weekly
+       missingok
+       rotate 52
+       compress
+       delaycompress
+       notifempty
+       create 640 root adm
+       sharedscripts
+       postrotate
+               /etc/init.d/apache2 reload > /dev/null
+               rsync /var/log/apache2/planet.openstreetmap.org-access.log.2.gz horntail::logs/planet.openstreetmap.org/`date -d "-7 days" +%Y-%m-%d`.gz
+       endscript
+       prerotate
+               if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
+                       run-parts /etc/logrotate.d/httpd-prerotate; \
+               fi; \
+       endscript
+}