]> code.communitydata.science - covid19.git/blob - cron-wikipedia_views.sh
Merge pull request #20 from makoshark/master
[covid19.git] / cron-wikipedia_views.sh
1 #!/bin/bash -x
2
3 WORKING_DIR="/home/SOC.NORTHWESTERN.EDU/bmh1867/covid19"
4 cd $WORKING_DIR
5
6 TZ="UTC"
7 date_string=${OVERRIDE_DATE_STRING:-$(date +%Y%m%d)}
8
9 view_log="enwp-daily_views-${date_string}.log"
10 ./wikipedia/scripts/wikiproject_scraper.py 2> >(tee wikipedia/logs/${view_log})
11
12 # get the list of files
13 ./wikipedia/scripts/fetch_enwiki_daily_views.py -d "${date_string}" 2> >(tee -a wikipedia/logs/${view_log})
14 mv wikipedia/logs/${view_log} /var/www/covid19/wikipedia/logs/${view_log}
15 mv wikipedia/data/digobs_covid19-wikipedia-enwiki_dailyviews-${date_string}.tsv /var/www/covid19/wikipedia/
16
17 # xz wikipedia/data/digobs_covid19-wikipedia-enwiki_dailyviews-${date_string}.json
18 mv wikipedia/data/digobs_covid19-wikipedia-enwiki_dailyviews-${date_string}.json /var/www/covid19/wikipedia/
19

Community Data Science Collective || Want to submit a patch?