23
23
#
24
24
# 6. A log file is written to the output directory and named "run.log".
25
25
#
26
- # 7. Successful results are uploaded to ftp.portico.org using ftp credentials
27
- # that are passed via environment variables PMC_USER and PMC_PASS.
26
+ # 7. Archived articles are uploaded to ftp://ftp-private.ncbi.nlm.nih.gov/
27
+ # using ftp credentials that are passed via environment variables
28
+ # PMC_USER and PMC_PASS.
28
29
#
29
30
# 8. Outcomes are emailed to the comma-separated addresses in environment
30
31
# variable $EMAIL_SUCCESS or $EMAIL_FAILURE, depending on whether
39
40
mainscript=${BASH_SOURCE[0]}
40
41
41
42
# The file recording the results of the most recent run is stored at the
42
- # level of the directory indicatd by $PORTICO_OUTPUT , because this
43
+ # level of the directory indicatd by $PMC_OUTPUT , because this
43
44
# information is carried across runs.
44
45
today=$( date +%Y-%m-%d)
45
46
datestampfile=$PMC_OUTPUT /last-run-date
@@ -56,9 +57,14 @@ report=$outputdir/report.csv
56
57
debuglog=$outputdir /debug.log
57
58
58
59
60
+ # Set up Python environment ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61
+
62
+ CWD=" $( cd -P -- " $( dirname -- " $mainscript " ) " && pwd -P) "
63
+ source $CWD /env/bin/activate
64
+
65
+
59
66
# Read helper functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60
67
61
- CWD=" $( cd -P -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " && pwd -P) "
62
68
source $CWD /helpers.sh
63
69
64
70
@@ -92,7 +98,7 @@ run_microarchiver -s pmc -C -d $afterdate -o $outputdir -r $report -@ $debuglog
92
98
# Did we have validation failures? Notify someone specifically about that.
93
99
lines=$( grep validation $report | wc -l)
94
100
if [[ $lines -gt 0 ]]; then
95
- mail -s" PMC upload stopped $today due to errors in $lines articles" \
101
+ mail -s " PMC upload stopped $today due to errors in $lines articles" \
96
102
-a $report -a $log $EMAIL_FAILURE
97
103
98
104
run_slack chat send --channel $SLACK_CHANNEL --color " #ff0000" \
118
124
119
125
# Send email about the results.
120
126
grep -F " Total articles" $log | \
121
- mail -s" PMC upload results for $today " -a $report -a $log $EMAIL_SUCCESS
127
+ mail -s " PMC upload results for $today " -a $report -a $log $EMAIL_SUCCESS
122
128
123
129
# Post the report to Slack.
124
130
0 commit comments