From: Sarah Hoffmann Date: Tue, 3 Dec 2013 08:00:40 +0000 (+0100) Subject: logrotation for nominatim X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/20470a64f04ff1fc122fc5b214c9fc44b364bcee logrotation for nominatim --- diff --git a/cookbooks/nominatim/recipes/default.rb b/cookbooks/nominatim/recipes/default.rb index dfa2df7c1..6f3394403 100644 --- a/cookbooks/nominatim/recipes/default.rb +++ b/cookbooks/nominatim/recipes/default.rb @@ -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 index 000000000..6a8412ba3 --- /dev/null +++ b/cookbooks/nominatim/templates/default/logrotate.nominatim.erb @@ -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 +} diff --git a/cookbooks/nominatim/templates/default/updater.erb b/cookbooks/nominatim/templates/default/updater.erb index 2f75b4199..beea8c8ac 100644 --- a/cookbooks/nominatim/templates/default/updater.erb +++ b/cookbooks/nominatim/templates/default/updater.erb @@ -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