X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/ceca7e797914afd20ce466420f5896338e7144c2..128b54ff815f5de7498e6ea22cae37cec36e3eeb:/cookbooks/taginfo/templates/default/update-planet.erb diff --git a/cookbooks/taginfo/templates/default/update-planet.erb b/cookbooks/taginfo/templates/default/update-planet.erb deleted file mode 100644 index 2eaf6fbb3..000000000 --- a/cookbooks/taginfo/templates/default/update-planet.erb +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh - -# DO NOT EDIT - This file is being maintained by Chef - -# abort on error - -set -e - -# setup - -PLANETDIR="<%= @directory %>/planet" -LOGDIR="${PLANETDIR}/log" -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" - -OSMIUM=<%= @directory %>/osmium-tool/build/src/osmium - -# start logging - -exec > "${LOGDIR}/$(date +%Y%m%d-%H%M).log" 2>&1 - -# if there are old .osc files, they have to be taken into account - -OLDFILE="$(find "${PLANETDIR}" -name "2*-*.osc" -print)" -if [ -z "$OLDFILE" ] -then - osmosis --rri "$STATEDIR" --simc --write-xml-change "$OSCFILE" -else - osmosis --rxc "$OLDFILE" --rri "$STATEDIR" --mc --simc --write-xml-change "$OSCFILE" && rm "$OLDFILE" -fi - -# osc file is ready, create new planet file - -#osmosis --read-xml-change "$OSCFILE" --read-bin "$PLANETCURR" --buffer bufferCapacity=12000 --apply-change --buffer bufferCapacity=12000 --write-pbf file="$PLANETNEW" -$OSMIUM apply-changes --verbose --remove-deleted --simplify --fsync --output=$PLANETNEW $PLANETCURR $OSCFILE - -# cleanup - -mv "$PLANETCURR" "$PLANETPREV" -mv "$PLANETNEW" "$PLANETCURR" -mv "$OSCFILE" "$OSCFILEPREV" - -# expire old logs - -find "${LOGDIR}" -mtime +28 -delete