]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/taginfo/templates/default/update-planet.erb
Remove cmd line options on osmium call not needed for current version.
[chef.git] / cookbooks / taginfo / templates / default / update-planet.erb
index a728ac1bfd7aed70322a10d2b38f35153697b56d..7f55c078ccb2ddb6d3a27da3215588f741b08721 100644 (file)
@@ -10,10 +10,14 @@ 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"
+
+OSMIUM=<%= @directory %>/osmium-tool/build/src/osmium
 
 # start logging
 
@@ -31,9 +35,15 @@ 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"
+$OSMIUM apply-changes --verbose --fsync --output=$PLANETNEW $PLANETCURR $OSCFILE
 
 # cleanup
 
-mv "$PLANETNEW" "$PLANETOLD"
-rm "$OSCFILE"
+mv "$PLANETCURR" "$PLANETPREV"
+mv "$PLANETNEW" "$PLANETCURR"
+mv "$OSCFILE" "$OSCFILEPREV"
+
+# expire old logs
+
+find "${LOGDIR}" -mtime +28 -delete