Page MenuHomePhabricator
Paste P10138

(An Untitled Masterwork)
ActivePublic

Authored by Addshore on Jan 13 2020, 7:32 PM.
Tags
None
Referenced Files
F31511155: raw.txt
Jan 13 2020, 7:32 PM
Subscribers
None
tools.wikidata-analysis@tools-sgebastion-07:~$ cat map.sh
#!/bin/bash
# @author Addshore
# Pass in a list of date stamps to run for (as arguments)
cd ~
for date in "$@"
do
# Run everything pointing at a tmp public_html directory... (so we don't publish partial stuff)
echo "Running for $date"
java -Xmx6g -jar /data/project/wikidata-analysis/toolkit-analyzer-build/toolkit-analyzer.jar --processors Map --store /data/project/wikidata-analysis/public_html_tmp --date $date
# Get the latest generated date directory, and use that date from now on
date="$(ls -1 /data/project/wikidata-analysis/public_html_tmp | grep -v dumpfiles | tail -n 1)"
source /data/project/wikidata-analysis/python/bin/activate
python /data/project/wikidata-analysis/toolkit-analyzer/geo2png.py /data/project/wikidata-analysis/public_html_tmp/$date/
# Move the output dir to the real public space
mv /data/project/wikidata-analysis/public_html_tmp/$date /data/project/wikidata-analysis/public_html/
# Moving a specific date doesn't work as we use "latest", so move all 20* folders instead
#mv /data/project/wikidata-analysis/public_html_tmp/20* /data/project/wikidata-analysis/public_html/
# Cleanup
echo "Cleaning up empty public_html dirs"
find ~/public_html -type d -empty -print
find ~/public_html -type d -empty -delete
done