Switch taginfo to expire logs manually and drop logrotate
authorTom Hughes <tom@compton.nu>
Sun, 23 Feb 2014 19:30:21 +0000 (19:30 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 23 Feb 2014 19:32:33 +0000 (19:32 +0000)
cookbooks/taginfo/recipes/default.rb
cookbooks/taginfo/templates/default/update-planet.erb
cookbooks/taginfo/templates/default/update-taginfo.erb
cookbooks/taginfo/templates/default/update.erb

index e0b6d34c24843be9cf089a93fb3f83c00fe706b1..a0a4091961cc86764a781338cdca87b4025b79b4 100644 (file)
@@ -63,11 +63,8 @@ directory "/var/log/taginfo" do
   mode 0755
 end
 
-template "/etc/logrotate.d/taginfo" do
-  source "logrotate.erb"
-  owner "root"
-  group "root"
-  mode 0644
+file "/etc/logrotate.d/taginfo" do
+  action :delete
 end
 
 node[:taginfo][:sites].each do |site|
@@ -234,7 +231,7 @@ node[:taginfo][:sites].each do |site|
     owner "taginfo"
     group "taginfo"
     mode 0755
-    variables :directory => directory
+    variables :name => name, :directory => directory
   end
 
   apache_site name do
index a728ac1bfd7aed70322a10d2b38f35153697b56d..311c7703e6230cb1b47c15716d66e066ecc6d74c 100644 (file)
@@ -37,3 +37,7 @@ osmosis --read-xml-change "$OSCFILE" --read-bin "$PLANETOLD" --buffer bufferCapa
 
 mv "$PLANETNEW" "$PLANETOLD"
 rm "$OSCFILE"
+
+# expire old logs
+
+find "${LOGDIR}" -mtime +28 -delte
index 84d033a5375d28bbe8399bf41df11a5399437c9e..417c30b8614918775ed2eee6c081c5d0e96565ff 100644 (file)
@@ -20,3 +20,5 @@ mv $ROOT/sources/taginfo-*.db $ROOT/sources/*/taginfo-*.db $ROOT/data
 mv $ROOT/sources/download/* $ROOT/download
 
 touch $ROOT/taginfo/web/tmp/restart.txt
+
+find $ROOT/sources/log -mtime +28 -delete
index 7050d161764c6cb9cbfbb80b3066cf1f41a4d849..be76ae99754fedd911c6f12ee5daa70e64d8da4e 100644 (file)
@@ -4,3 +4,5 @@
 
 <%= @directory %>/bin/update-planet
 <%= @directory %>/bin/update-taginfo
+
+find "/var/log/taginfo/<%= @name %>" -mtime +28 -delete