remove expiryfile when rendering is disabled, else it grows indefinitely and causes...
authorUser for running Openstreetmap-things <osm@osm.rrze.uni-erlangen.de>
Sun, 5 Jun 2016 20:58:06 +0000 (22:58 +0200)
committerUser for running Openstreetmap-things <osm@osm.rrze.uni-erlangen.de>
Sun, 5 Jun 2016 20:58:06 +0000 (22:58 +0200)
scripts/doosmupdate.sh

index eadb5c894ebc1ae0f4be0e5389ac5108cbbe7962..3ebe00b355c132e22f62e91aa14b527714591c13 100755 (executable)
@@ -12,8 +12,9 @@ WEBSTATEFILE=/var/www/lastdbupdate.txt
 UPDATECMD="/usr/bin/osm2pgsql --slim --cache=8000 --append --database=osm \
            --style=/home.local/osm/dbstyle/osm2pgsql-new.style \
            --flat-nodes=/mnt/database/flatnodes/flatnodes.db \
-           --hstore --multi-geometry --expire-tiles=17-17 \
-           --expire-output=$EXPIRYFILE  $CHANGESFILE"
+           --hstore --multi-geometry \
+           --expire-tiles=17-17 --expire-output=$EXPIRYFILE \
+           $CHANGESFILE"
 
 cleanup()
 {
@@ -70,19 +71,23 @@ grep timestamp $OSMOSISWORKDIR/state.txt | sed -e 's/timestamp=//g' -e 's/T/ /g'
 echo -n "Updated database: now at upstream state of "
 cat $WEBSTATEFILE
 #touch /var/lib/tirex/tiles/planet-import-complete
-if [ -e $EXPIRYFILE -a -e $RERENDEREXPIREDTRIGGERFILE ] ; then
-       echo "Expiryfile exists. Telling tirex to rerender the tiles mentioned there..."
-       echo "Number of lines: `wc -l $EXPIRYFILE`"
-       # Used to be zoom 13-20 but that causes too much load. Reduced to 15-20.
-       # Trying completely without. Lots of load, way too many false positives. -unrz191 2015-09-04
-       cat $EXPIRYFILE | /home.local/osm/bin/osmtilecleanup.pl \
+if [ -e $EXPIRYFILE ] ; then
+       if [ -e $RERENDEREXPIREDTRIGGERFILE ] ; then
+               echo "Expiryfile and triggerfile  exists. Telling tirex to rerender the tiles mentioned there..."
+               echo "Number of lines: `wc -l $EXPIRYFILE`"
+               # Used to be zoom 13-20 but that causes too much load. Reduced to 15-20.
+               # Trying completely without. Lots of load, way too many false positives. -unrz191 2015-09-04
+               cat $EXPIRYFILE | /home.local/osm/bin/osmtilecleanup.pl \
                                    --action rerenderexpiredlist --zoom 15-20 \
                                    --rrs /home.local/osm/bin/osmrerenderwrapper.sh \
                                    /var/lib/tirex/tiles/osm
-       cat $EXPIRYFILE | /home.local/osm/bin/osmtilecleanup.pl \
+               cat $EXPIRYFILE | /home.local/osm/bin/osmtilecleanup.pl \
                                    --action rerenderexpiredlist --zoom 15-20 \
                                    --rrs /home.local/osm/bin/osmrerenderwrapper-osmde.sh \
                                    /var/lib/tirex/tiles/osmde
+       else
+               echo "Expiryfile exists but rerendering is disabled."
+       fi
        rm $EXPIRYFILE
 fi
 echo "Ending update script cleanly: `date`"
This page took 0.092528 seconds and 4 git commands to generate.