3 echo "Daily maintenance starting: `date`"
4 # Delete tiles in zoomlevel 13-14 that are older than 336 hours = 14 days
5 sudo -u tirex -- /home.local/osm/bin/osmtilecleanup.pl --zoom 13-14 --action delete --rmemptydirs --minage 336 /var/lib/tirex/tiles/osm
6 sudo -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
8 sudo -u tirex -- /home.local/osm/bin/osmtilecleanup.pl --zoom 15-20 --action delete --rmemptydirs --minage 168 /var/lib/tirex/tiles/osm
9 sudo -u tirex -- /home.local/osm/bin/osmtilecleanup.pl --zoom 15-20 --action delete --rmemptydirs --minage 168 /var/lib/tirex/tiles/osmde
10 # Regenerate a part of zoomlevel 0-12 tiles. There are at most 350000 such tiles.
11 # At 5000 a day, it'll take 70 days to regenerate all. As they hardly ever change, that should be fine.
12 /home.local/osm/bin/osmtilecleanup.pl --zoom 0-12 --action rerender \
13 --limit 5000 --rrs /home.local/osm/bin/osmrerenderwrapper.sh /var/lib/tirex/tiles/osm
14 /home.local/osm/bin/osmtilecleanup.pl --zoom 0-12 --action rerender \
15 --limit 5000 --rrs /home.local/osm/bin/osmrerenderwrapper-osmde.sh /var/lib/tirex/tiles/osmde
16 # Update tile stats for munin
17 tirex-tiledir-check --stats=/var/lib/tirex/stats/tiles-osm.stats osm
18 tirex-tiledir-check --stats=/var/lib/tirex/stats/tiles-osmde.stats osmde
21 if [ "$DOW" == "6" -o "$DOW" == "3" ] ; then
22 echo "Time to vacuum the databse... This will take a few hours."
23 # Vacuum the database. This can take hours. Possibly better just once per week?
24 time psql --dbname=osm -c 'vacuum verbose analyze'
27 # Rerender Erlangen / Nuernberg. Around 4000 tiles, takes around 30 minutes.
28 tirex-batch --prio=22 --expire=+14400 map=osm bbox=10.93,49.37,11.14,49.63 z=13-19
29 tirex-batch --prio=22 --expire=+14400 map=osmde bbox=10.93,49.37,11.14,49.63 z=13-19
31 echo "Daily maintenance finished: `date`"