6 DATE=$(date -u -d "1 day ago" "+%Y-%m-%d")
7 YEAR=$(date -u -d "1 day ago" "+%Y")
10 OUTDIR="<%= @output_dir %>"
11 TMPDIR=$(mktemp -d -t tilelog.XXXXXXXXX)
15 export AWS_ACCESS_KEY_ID="AKIASQUXHPE7JFCFMOUP"
16 export AWS_SECRET_ACCESS_KEY="<%= @aws_key %>"
17 export AWS_REGION="eu-west-1"
19 TILEFILE="tiles-${DATE}.txt.xz"
20 HOSTFILE="hosts-${DATE}.csv"
21 APPFILE="apps-${DATE}.csv"
22 COUNTRYFILE="countries-${DATE}.csv"
24 nice -n 19 /opt/tilelog/bin/tilelog --date "${DATE}" \
25 --generate-success --generate-minimise --generate-location \
26 --tile "${TILEFILE}" --host "${HOSTFILE}" --app "${APPFILE}" --country "${COUNTRYFILE}"
28 mv "${TILEFILE}" "${HOSTFILE}" "${APPFILE}" "${COUNTRYFILE}" "${OUTDIR}"
30 /opt/awscli/v2/current/bin/aws --profile=osm-pds-upload s3 cp --storage-class=INTELLIGENT_TIERING --no-progress "${OUTDIR}/${TILEFILE}" "s3://osm-planet-eu-central-1/tile_logs/standard_layer/tiles/${YEAR}/${TILEFILE}"
31 /opt/awscli/v2/current/bin/aws --profile=osm-pds-upload s3 cp --storage-class=INTELLIGENT_TIERING --no-progress "${OUTDIR}/${HOSTFILE}" "s3://osm-planet-eu-central-1/tile_logs/standard_layer/hosts/${YEAR}/${HOSTFILE}"
32 /opt/awscli/v2/current/bin/aws --profile=osm-pds-upload s3 cp --storage-class=INTELLIGENT_TIERING --no-progress "${OUTDIR}/${APPFILE}" "s3://osm-planet-eu-central-1/tile_logs/standard_layer/apps/${YEAR}/${APPFILE}"
33 /opt/awscli/v2/current/bin/aws --profile=osm-pds-upload s3 cp --storage-class=INTELLIGENT_TIERING --no-progress "${OUTDIR}/${COUNTRYFILE}" "s3://osm-planet-eu-central-1/tile_logs/standard_layer/countries/${YEAR}/${COUNTRYFILE}"