source: subversion/applications/utils/planet.osm/planet.sh @ 4173

Last change on this file since 4173 was 4173, checked in by spaetz, 12 years ago

add updated planet.sh, which includes planet diff generation.

  • Property svn:executable set to *
File size: 989 bytes
Line 
1#!/bin/bash
2cur_date=`date +%y%m%d`
3cur_planet=planet-${cur_date}.osm
4planet_dir=/var/www/planet.openstreetmap.org/
5
6export PATH='/usr/local/bin:/usr/bin:/bin:/usr/bin/X11'
7cd /home/steve/bin
8./planet.rb > ${cur_planet}
9#7zr a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on  planet-`date +%y%m%d.osm`.7z  ${cur_planet}
10#chmod a+r ${cur_planet}.7z
11#mv ${cur_planet}.7z ${planet_dir}
12bzip2 ${cur_planet}
13mv ${cur_planet}.bz2 ${planet_dir}
14
15cd ${planet_dir}
16
17#link planet latest to the new file
18ln -fs ${cur_planet}.bz2 planet-latest.osm.bz2
19
20#next, create the planet diff from last week to this week
21
22CURPLANETDATE=`echo ${cur_planet}|sed -e 's/\w*-\([0-9]*\).*/\1/'`
23PREVPLANETDATE=`ls *.osm.bz2|grep -B1 ${cur_planet}|head -n1|sed -e 's/\w*-\([0-9]*\).*/\1/'`
24PREVPLANETBZ=planet-${PREVPLANETDATE}.osm.bz2
25TMPFILE=`mktemp`
26
27planetdiff ${PREVPLANETBZ} ${cur_planet}.bz2 | bzip2 > ${TMPFILE}
28chmod +r ${TMPFILE}
29mv ${TMPFILE} ${planet_dir}/planet-${PREVPLANETDATE}-${CURPLANETDATE}.diff.xml.bz2
Note: See TracBrowser for help on using the repository browser.