]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/planet/templates/default/planet-update.erb
planet: do not keep previous planet around.
[chef.git] / cookbooks / planet / templates / default / planet-update.erb
index 73a778bbaaa812c9bd33455683f0e05b0b41d3d7..fbfc6592fce5979226f4ebbde4140d4453916b6b 100644 (file)
@@ -11,11 +11,14 @@ PLANETPREV="${PLANETDIR}/planet-previous.${SUFFIX}"
 PLANETCURR="${PLANETDIR}/planet.${SUFFIX}"
 PLANETNEW="${PLANETDIR}/planet-new.${SUFFIX}"
 
+rm -f "$PLANETPREV"
+
 pyosmium-up-to-date -vvv -o "$PLANETNEW" "$PLANETCURR"
 retval=$?
 
 while [ $retval -eq 1 ]; do
     mv "$PLANETCURR" "$PLANETPREV"
+    rm -f "$PLANETPREV"
     mv "$PLANETNEW" "$PLANETCURR"
     pyosmium-up-to-date -vvv -o "$PLANETNEW" "$PLANETCURR"
     retval=$?
@@ -28,4 +31,5 @@ fi
 # cleanup
 
 mv "$PLANETCURR" "$PLANETPREV"
+rm -f "$PLANETPREV"
 mv "$PLANETNEW" "$PLANETCURR"