source: subversion/applications/utils/mod_tile/update @ 16255

Last change on this file since 16255 was 8646, checked in by jonb, 11 years ago

Add update script which is used to pull in the weekly planet and restart the rendering

  • Property svn:executable set to *
File size: 1.0 KB
Line 
1#!/bin/bash
2
3while (/bin/true)
4do
5  ymd=`date +%y%m%d`
6#  ymd="071031"
7
8  file="planet-${ymd}.osm.gz"
9  name="/home/www/tile/direct/planet/${file}"   
10  url="http://planet.openstreetmap.org/${file}"
11
12  if [ -s "${name}" ]
13  then
14    echo "$name Already exists"
15    exit 1
16  fi
17
18  date
19  echo "Fetching: $file"
20
21  wget -O "${name}" "${url}"
22  if [ $? -ne 0 ]; then
23      echo "failed"
24      sleep 600
25  else 
26      echo "Planet Downloaded OK"
27      killall -w renderd
28      # Some zlib fail with files > 2GB, gzip seems OK
29      gzip -dc "${name}" | time osm2pgsql -m -
30      if [ $? -ne 0 ]; then
31          echo "Problem importing data"
32          exit 1
33      fi
34
35      sleep 5
36
37      /home/jburgess/svn.openstreetmap.org/applications/utils/mod_tile/renderd &
38      touch /tmp/planet-import-complete
39      echo "Rendering restarted OK"
40
41      sleep 5
42
43      cd /home/jburgess/svn.openstreetmap.org/applications/utils/mod_tile/old
44      rm -fR `seq 0 18`
45      mkdir `seq 0 18`
46      ./render_all
47      echo "render_all started"
48      exit 0
49  fi
50done
51exit -1
Note: See TracBrowser for help on using the repository browser.