3 # DO NOT EDIT - This file is being maintained by Chef
5 date "+%c === Starting Nominatim update cycle"
9 <% if node[:nominatim][:enable_git_updates] -%>
10 if /sbin/runuser -u nominatim -- <%= @bindir %>/nominatim-update-source; then
11 pushd <%= @builddir %>
14 if ! /sbin/runuser -u nominatim -- <%= @bindir %>/nominatim-update-refresh-db; then
15 date "+%c === Database refresh failed. Stopping updates."
21 if ! /sbin/runuser -u nominatim -- <%= @bindir %>/nominatim-update-data; then
22 date "+%c === Data update failed. Stopping updates."
26 date "+%c === Nominatim update cycle finished"
28 # sleep a bit if updates take less than a minute
30 elapsed=$((endtime - starttime))
31 if [[ $elapsed -lt 60 ]]; then
32 sleepy=$((60 - $elapsed))
33 date "+%c === Sleeping for ${sleepy}s..."