]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/nominatim/templates/default/nominatim-daily-maintenance.erb
nominatim: complete rework of the setup
[chef.git] / cookbooks / nominatim / templates / default / nominatim-daily-maintenance.erb
diff --git a/cookbooks/nominatim/templates/default/nominatim-daily-maintenance.erb b/cookbooks/nominatim/templates/default/nominatim-daily-maintenance.erb
new file mode 100644 (file)
index 0000000..837f4af
--- /dev/null
@@ -0,0 +1,15 @@
+# DO NOT EDIT - This file is being maintained by Chef
+
+nominatim refresh --postcodes --word-tokens --threads 4 -v
+
+<% if node[:nominatim][:enable_qa_tiles] -%>
+pushd <%= @qabindir %>
+if python3 cli.py --execute-all; then
+  rm -rf "<%= @qadatadir %>/old"
+  if [ -d "<%= @qadatadir %>/current" ]; then
+    mv "<%= @qadatadir %>/current" "<%= @qadatadir %>/old"
+  fi
+  mv "<%= @qadatadir %>/new" "<%= @qadatadir %>/current"
+fi
+popd
+<% end -%>