3 # DO NOT EDIT - This file is being maintained by Chef
6 # Vaccum all tables with indices on integer arrays.
7 # Agressive vacuuming seems to help against index bloat.
8 psql -q -d nominatim -c 'VACUUM ANALYSE search_name'
9 psql -q -d nominatim -c 'VACUUM ANALYSE search_name_country'
11 for i in `seq 0 246`; do
12 psql -q -d nominatim -c "VACUUM ANALYSE search_name_${i}"
15 # Cleanup archive directory
18 for fl in <% @streaming_clients %>; do
19 lastupdate=`wget -O - -q http://$fl/last_update.php`
20 if [[ "$?" != "0" ]]; then
24 epoch=`date +%s -d "$lastupdate"`
25 if [[ "$epoch" -lt "$oldest" ]]; then
32 if [[ "$oldest" != "0" ]]; then
34 timeago=$(( ( $now - $oldest ) / 60 + 180 ))
35 if [[ "$timeago" -le "180" ]]; then
36 echo "Oldest is in the future, something is wrong."
40 echo "find -L <%= @archive_dir %> -mmin +$timeago -print0 | xargs -0r rm"
43 diskfree=`df --output=pcent <%= @archive_dir %> | tail -n 1 | sed s:[^0-9.]::g
45 if [[ "$diskfree" -lt 10 ]]; then
46 echo "WAL archives running out of space. Stopping updates."
47 touch <%= @update_stop_file %>