]> git.openstreetmap.org Git - chef.git/blob - cookbooks/taginfo/templates/default/update.erb
overpass: only download sources when missing
[chef.git] / cookbooks / taginfo / templates / default / update.erb
1 #!/bin/sh
2
3 # DO NOT EDIT - This file is being maintained by Chef
4
5 set -e
6
7 ROOT="<%= @directory %>"
8
9 cd $ROOT/taginfo/sources
10
11 if [ -f "$ROOT/data/taginfo-history.db" ]
12 then
13     cp $ROOT/data/taginfo-history.db $ROOT/sources
14 fi
15
16 $ROOT/taginfo/sources/update_all.sh $ROOT/sources
17
18 ln -f $ROOT/data/taginfo-* $ROOT/data/old
19 mv -f $ROOT/sources/taginfo-*.db $ROOT/sources/*/taginfo-*.db $ROOT/data
20 mv $ROOT/sources/download/* $ROOT/download
21
22 PASSENGER_INSTANCE_REGISTRY_DIR=<%= node[:passenger][:instance_registry_dir] %> /usr/bin/passenger-config restart-app $ROOT/taginfo/web > /dev/null
23
24 find $ROOT/sources/log -mtime +28 -delete
25
26 find "/var/log/taginfo/<%= @name %>" -mtime +28 -delete