# Check the lock
if [ -f /tmp/planetdump.lock ]; then
if [ "$(ps -p `cat /tmp/planetdump.lock` | wc -l)" -gt 1 ]; then
# Check the lock
if [ -f /tmp/planetdump.lock ]; then
if [ "$(ps -p `cat /tmp/planetdump.lock` | wc -l)" -gt 1 ]; then
# and incron doesn't yet support MAILTO like cron does. The
# command below appears to work in bash as well as dash.
logfile="/tmp/planetdump.log.$$"
# and incron doesn't yet support MAILTO like cron does. The
# command below appears to work in bash as well as dash.
logfile="/tmp/planetdump.log.$$"
- # support doing this in the incrontab.
- /usr/bin/mailx -s "Planet dump output: ${file}" zerebubuth@gmail.com < $logfile
- rm $logfile
+ # support doing this in the incrontab
+ if [[ -s "$logfile" ]]
+ then
+ mailx -s "Planet dump output: ${file}" zerebubuth@gmail.com < "${logfile}"
+ fi
+
+ # Remove the log file
+ rm -f "${logfile}"
time nice -n 19 /opt/planet-dump-ng/planet-dump-ng \
-c "pbzip2 -c" -f "/store/backup/${file}" --dense-nodes=1 \
-C "changesets-${date}.osm.bz2" \
time nice -n 19 /opt/planet-dump-ng/planet-dump-ng \
-c "pbzip2 -c" -f "/store/backup/${file}" --dense-nodes=1 \
-C "changesets-${date}.osm.bz2" \
-x "planet-${date}.osm.bz2" -X "history-${date}.osm.bz2" \
-p "planet-${date}.osm.pbf" -P "history-${date}.osm.pbf"
-x "planet-${date}.osm.bz2" -X "history-${date}.osm.bz2" \
-p "planet-${date}.osm.pbf" -P "history-${date}.osm.pbf"
install_dump "planet" "bz2" "<%= node[:planet][:dump][:xml_directory] %>" "${year}"
install_dump "history" "bz2" "<%= node[:planet][:dump][:xml_history_directory] %>" "${year}"
install_dump "planet" "pbf" "<%= node[:planet][:dump][:pbf_directory] %>"
install_dump "planet" "bz2" "<%= node[:planet][:dump][:xml_directory] %>" "${year}"
install_dump "history" "bz2" "<%= node[:planet][:dump][:xml_history_directory] %>" "${year}"
install_dump "planet" "pbf" "<%= node[:planet][:dump][:pbf_directory] %>"