]> git.openstreetmap.org Git - chef.git/blob - cookbooks/tilelog/templates/default/tilelog.erb
mediawiki: Use master branch for QuickInstantCommons
[chef.git] / cookbooks / tilelog / templates / default / tilelog.erb
1 #!/bin/sh
2 set -e
3
4 if [ -z "$DATE" ]
5 then
6   DATE=$(date -d "1 day ago" "+%Y-%m-%d")
7 fi
8
9 OUTDIR="<%= @output_dir %>"
10 TMPDIR=$(mktemp -d -t tilelog.XXXXXXXXX)
11
12 cd "$TMPDIR"
13
14 export AWS_ACCESS_KEY_ID="AKIASQUXHPE7JFCFMOUP"
15 export AWS_SECRET_ACCESS_KEY="<%= @aws_key %>"
16 export AWS_REGION="eu-west-1"
17
18 TILEFILE="tiles-${DATE}.txt.xz"
19 HOSTFILE="hosts-${DATE}.csv"
20
21 nice -n 19 /opt/tilelog/bin/tilelog --date "${DATE}" --generate-success \
22   --tile "${TILEFILE}" --host "${HOSTFILE}"
23
24 mv "${TILEFILE}" "${HOSTFILE}" "${OUTDIR}"
25
26 rm -rf "$TMPDIR"