forked from openstreetmap/mod_tile
-
Notifications
You must be signed in to change notification settings - Fork 31
/
update_tiles.sh
executable file
·29 lines (29 loc) · 1.1 KB
/
update_tiles.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
echo
echo "update_tiles.sh run:" `date`
#
if ! command -v osm2pgsql-replication &> /dev/null
then
echo "osm2pgsql-replication could not be found"
exit 1
fi
#
if [[ -f /var/cache/renderd/update_tiles.sh.running ]]
then
echo "update_tiles.sh already running; /var/cache/renderd/update_tiles.sh.running exists"
exit 1
else
touch /var/cache/renderd/update_tiles.sh.running
fi
#
if ! osm2pgsql-replication update -d gis --post-processing /usr/local/sbin/expire_tiles.sh --max-diff-size 20 -- --multi-geometry --tag-transform-script /home/renderaccount/src/openstreetmap-carto/openstreetmap-carto.lua -C 2500 --number-processes 2 -S /home/renderaccount/src/openstreetmap-carto/openstreetmap-carto.style --expire-tiles=1-20 --expire-output=/var/cache/renderd/dirty_tiles.txt > /var/cache/renderd/osm2pgsql-replication.$$ 2>&1
then
echo "osm2pgsql-replication error"
cat /var/cache/renderd/osm2pgsql-replication.$$
else
grep Backlog /var/cache/renderd/osm2pgsql-replication.$$ | tail -1
rm /var/cache/renderd/osm2pgsql-replication.$$
fi
#
rm /var/cache/renderd/update_tiles.sh.running
#