logrotation for nominatim
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 3 Dec 2013 08:00:40 +0000 (09:00 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Tue, 3 Dec 2013 08:00:40 +0000 (09:00 +0100)
cookbooks/nominatim/recipes/default.rb
cookbooks/nominatim/templates/default/logrotate.nominatim.erb [new file with mode: 0644]
cookbooks/nominatim/templates/default/updater.erb

index dfa2df7c118ee3c3ddcb391ccb052472b4c94d40..6f3394403a5271971066a0040938eddec689a49c 100644 (file)
@@ -93,6 +93,14 @@ directory "/var/log/nominatim" do
   mode 0755
 end
 
+template "/etc/logrotate.d/nominatim" do
+  source "logrotate.nominatim.erb"
+  owner "root"
+  group "root"
+  mode 0644
+end
+
+
 package "osmosis"
 package "gcc"
 package "proj-bin"
diff --git a/cookbooks/nominatim/templates/default/logrotate.nominatim.erb b/cookbooks/nominatim/templates/default/logrotate.nominatim.erb
new file mode 100644 (file)
index 0000000..6a8412b
--- /dev/null
@@ -0,0 +1,11 @@
+# DO NOT EDIT - This file is being maintained by Chef
+
+/var/log/nominatim/update.log {
+  weekly
+  missingok
+  rotate 12
+  compress
+  delaycompress
+  notifempty
+  create 640 root adm
+}
index 2f75b4199638af23c8e9fb23e631ef587716f27b..beea8c8ac5e896cd99a25dfc0b9d086e3bb21c48 100644 (file)
@@ -2,15 +2,14 @@
 
 # DO NOT EDIT - This file is being maintained by Chef
 
-# Send output to the log
-exec >> /var/log/nominatim/update.log 2>&1
-
 # Change to Nominatim directory
 DIR="$( cd "$( dirname "$0" )" && pwd )"
 cd $DIR/..
 
 while true
 do
+    # Send output to the log (logrotatable)
+    exec >> /var/log/nominatim/update.log 2>&1
     starttime=`date +%s`
 
     ./utils/update.php --no-npi --import-osmosis