#!/bin/sh

# DO NOT EDIT - This file is being maintained by Chef

# setup

PLANETDIR="<%= @directory %>/planet"
LOGDIR="${PLANETDIR}/log"
PLANETPREV="${PLANETDIR}/planet-previous.pbf"
PLANETCURR="${PLANETDIR}/planet.pbf"
PLANETNEW="${PLANETDIR}/planet-new.pbf"

# start logging

exec > "${LOGDIR}/$(date +%Y%m%d-%H%M).log" 2>&1

retval=1
while [ $retval -eq 1 ]; do
    pyosmium-up-to-date -o $PLANETNEW $PLANETCURR
    retval=$?
done

if [ $retval -ne 0 ]; then
  exit $retval
fi

# cleanup

mv "$PLANETCURR" "$PLANETPREV"
mv "$PLANETNEW" "$PLANETCURR"

# expire old logs

find "${LOGDIR}" -mtime +28 -delete

#!/bin/sh

# DO NOT EDIT - This file is being maintained by Chef

# setup

PLANETDIR="<%= @directory %>/planet"
LOGDIR="${PLANETDIR}/log"
PLANETPREV="${PLANETDIR}/planet-previous.pbf"
PLANETCURR="${PLANETDIR}/planet.pbf"
PLANETNEW="${PLANETDIR}/planet-new.pbf"

# start logging

exec > "${LOGDIR}/$(date +%Y%m%d-%H%M).log" 2>&1

retval=1
while [ $retval -eq 1 ]; do
    pyosmium-up-to-date -v -o $PLANETNEW $PLANETCURR
    retval=$?
done

if [ $retval -ne 0 ]; then
  exit $retval
fi

# cleanup

mv "$PLANETCURR" "$PLANETPREV"
mv "$PLANETNEW" "$PLANETCURR"

# expire old logs

find "${LOGDIR}" -mtime +28 -delete

Use verbose option on pyosmium-up-to-date command for taginfo.
Use verbose option on pyosmium-up-to-date command for taginfo.
