]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/nominatim/templates/default/updater.erb
nominatim: rotate apache logs more often
[chef.git] / cookbooks / nominatim / templates / default / updater.erb
index d8c9666ced65778455c0f0605fe96bc956f47e1f..8a3cf027edf4f2549a835e300d8e5d566afc8c49 100644 (file)
@@ -3,23 +3,24 @@
 # DO NOT EDIT - This file is being maintained by Chef
 
 # Change to Nominatim directory
-DIR="$( cd "$( dirname "$0" )" && pwd )"
-cd $DIR/..
+cd <%= @bindir %>
 
 while [ ! -f "<%= @update_stop_file %>" ]
 do
     # Send output to the log (logrotatable)
-    exec >> <%= node[:nominatim][:logdir] %>/update.log 2>&1
+    exec >> <%= @logfile %> 2>&1
     starttime=`date +%s`
 
     ./utils/update.php --no-npi --import-osmosis
 
+    pushd <%= @srcdir %>
     if git fetch origin; then
       # will trigger recompilation if necessary
-      git merge origin/master
+      git merge origin/<%= @branch %>
     else
       echo "WARNING: git fetch failed."
     fi
+    popd
 
     # sleep a bit if updates take less than a minute
     endtime=`date +%s`