better stats for touching files
[osmrrze.git] / scripts / dailymaint.sh
CommitLineData
1ef97ffe 1#!/bin/bash
5203e8e5
UO
2
3echo "Daily maintenance starting: `date`"
4# Delete tiles in zoomlevel 13-14 that are older than 336 hours = 14 days
5sudo -u tirex -- /home.local/osm/bin/osmtilecleanup.pl --zoom 13-14 --action delete --rmemptydirs --minage 336 /var/lib/tirex/tiles/osm
6sudo -u tirex -- /home.local/osm/bin/osmtilecleanup.pl --zoom 13-14 --action delete --rmemptydirs --minage 336 /var/lib/tirex/tiles/osmde
7# Delete tiles in zoomlevel 15-20 that are older than 168 hours = 7 days
8sudo -u tirex -- /home.local/osm/bin/osmtilecleanup.pl --zoom 15-20 --action delete --rmemptydirs --minage 168 /var/lib/tirex/tiles/osm
9sudo -u tirex -- /home.local/osm/bin/osmtilecleanup.pl --zoom 15-20 --action delete --rmemptydirs --minage 168 /var/lib/tirex/tiles/osmde
91afa24c 10# Delete all tiles in our bicycle/lecture hall overlay that are older
11# than 24 hours as these are REALLY cheap to regenerate on the fly.
12sudo -u tirex -- /home.local/osm/bin/osmtilecleanup.pl --zoom 10-20 --action delete --rmemptydirs --minage 24 /var/lib/tirex/tiles/rrze-ovl
5203e8e5
UO
13# Regenerate a part of zoomlevel 0-12 tiles. There are at most 350000 such tiles.
14# At 5000 a day, it'll take 70 days to regenerate all. As they hardly ever change, that should be fine.
1ef97ffe 15export PRIO=31
f24c9c17 16# unrz191 2015-09-11: reduce number of 5000 because we have deleted a lot of tiles that are cheap to rerender.
5203e8e5 17/home.local/osm/bin/osmtilecleanup.pl --zoom 0-12 --action rerender \
f24c9c17 18 --limit 2000 --rrs /home.local/osm/bin/osmrerenderwrapper.sh /var/lib/tirex/tiles/osm
5203e8e5 19/home.local/osm/bin/osmtilecleanup.pl --zoom 0-12 --action rerender \
f24c9c17 20 --limit 2000 --rrs /home.local/osm/bin/osmrerenderwrapper-osmde.sh /var/lib/tirex/tiles/osmde
1ef97ffe
UO
21# Regenerate (part of) zoomlevel 13-14 tiles. Some of these are pretty expensive, so
22# we rather rerender them scheduled than when they change (usually they really don't,
23# it is 99 percent false alerts).
24/home.local/osm/bin/osmtilecleanup.pl --zoom 13-14 --action rerender \
25 --limit 1000 --rrs /home.local/osm/bin/osmrerenderwrapper.sh /var/lib/tirex/tiles/osm
26/home.local/osm/bin/osmtilecleanup.pl --zoom 13-14 --action rerender \
27 --limit 1000 --rrs /home.local/osm/bin/osmrerenderwrapper-osmde.sh /var/lib/tirex/tiles/osmde
5203e8e5
UO
28# Update tile stats for munin
29tirex-tiledir-check --stats=/var/lib/tirex/stats/tiles-osm.stats osm
30tirex-tiledir-check --stats=/var/lib/tirex/stats/tiles-osmde.stats osmde
f24c9c17 31tirex-tiledir-check --stats=/var/lib/tirex/stats/tiles-osmhd.stats osmhd
5203e8e5
UO
32
33DOW=`/bin/date '+%w'`
34if [ "$DOW" == "6" -o "$DOW" == "3" ] ; then
35 echo "Time to vacuum the databse... This will take a few hours."
36 # Vacuum the database. This can take hours. Possibly better just once per week?
37 time psql --dbname=osm -c 'vacuum verbose analyze'
38fi
39
40# Rerender Erlangen / Nuernberg. Around 4000 tiles, takes around 30 minutes.
1ef97ffe
UO
41tirex-batch --prio=${PRIO} --expire=+14400 map=osm bbox=10.93,49.37,11.14,49.63 z=13-19
42tirex-batch --prio=${PRIO} --expire=+14400 map=osmde bbox=10.93,49.37,11.14,49.63 z=13-19
5203e8e5
UO
43
44echo "Daily maintenance finished: `date`"
45
This page took 0.096353 seconds and 4 git commands to generate.