Page MenuHomePhabricator
Paste P10138

(An Untitled Masterwork)

Authored by Addshore on Mon, Jan 13, 7:32 PM.
tools.wikidata-analysis@tools-sgebastion-07:~$ cat
# @author Addshore
# Pass in a list of date stamps to run for (as arguments)
cd ~
for date in "$@"
# 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/ /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

Event Timeline

Addshore created this paste.Mon, Jan 13, 7:32 PM