From 47e0c953b313661add1f3cac2eb72f9f377361fd Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Wed, 18 Nov 2015 22:54:13 +0100 Subject: [PATCH] On taginfo server: Keep last planet and change file around after update. --- cookbooks/taginfo/templates/default/update-planet.erb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cookbooks/taginfo/templates/default/update-planet.erb b/cookbooks/taginfo/templates/default/update-planet.erb index 76b7af273..371369b07 100644 --- a/cookbooks/taginfo/templates/default/update-planet.erb +++ b/cookbooks/taginfo/templates/default/update-planet.erb @@ -10,10 +10,12 @@ set -e PLANETDIR="<%= @directory %>/planet" LOGDIR="${PLANETDIR}/log" -PLANETOLD="${PLANETDIR}/planet.pbf" +PLANETPREV="${PLANETDIR}/planet-previous.pbf" +PLANETCURR="${PLANETDIR}/planet.pbf" PLANETNEW="${PLANETDIR}/planet-new.pbf" STATEDIR="${PLANETDIR}/replication" OSCFILE="${PLANETDIR}/$(date +%Y%m%d-%H%M).osc" +OSCFILEPREV="${PLANETDIR}/previous.osc" # start logging @@ -31,12 +33,13 @@ fi # osc file is ready, create new planet file -osmosis --read-xml-change "$OSCFILE" --read-bin "$PLANETOLD" --buffer bufferCapacity=12000 --apply-change --buffer bufferCapacity=12000 --write-pbf file="$PLANETNEW" +osmosis --read-xml-change "$OSCFILE" --read-bin "$PLANETCURR" --buffer bufferCapacity=12000 --apply-change --buffer bufferCapacity=12000 --write-pbf file="$PLANETNEW" # cleanup -mv "$PLANETNEW" "$PLANETOLD" -rm "$OSCFILE" +mv "$PLANETCURR" "$PLANETPREV" +mv "$PLANETNEW" "$PLANETCURR" +mv "$OSCFILE" "$OSCFILEPREV" # expire old logs -- 2.43.2