-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
52 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,25 +50,31 @@ mkdir -p $outputdir | |
# Run microarchiver. | ||
|
||
logfile=$outputdir/run.log | ||
debugfile=$outputdir/debug.log | ||
csvfile=$outputdir/report.csv | ||
|
||
echo "Starting at $now" >> $logfile | ||
|
||
echo "" >> $logfile | ||
echo "=== Running microarchiver ===" >> $logfile | ||
microarchiver -C -o $outputdir -d $lastrun -r $outputdir/report.csv >> $logfile 2>&1 | ||
microarchiver -C -d $lastrun -o $outputdir -r $csvfile -@ $debugfile >> $logfile 2>&1 | ||
|
||
# Write out the date stamp, for next time. | ||
echo $today > $datestampfile | ||
|
||
# If we have new articles, ftp them to Portico. | ||
if ! grep -Fxq "Total articles: 0" $logfile; then | ||
archivefile=$outputdir/micropublication-org.zip | ||
if [[ ! -e $archivefile ]]; then | ||
echo "Microarchiver failed to create archive file" | ||
exit 1 | ||
fi | ||
|
||
if grep -Fxq "Total articles: 0" $logfile; then | ||
exit 0 | ||
echo "" >> $logfile | ||
echo "=== FTP'ing file using curl ===" >> $logfile | ||
curl -T $archivefile ftp://ftp.portico.org --user $FTP_USER:$FTP_PASS >> $logfile 2>&1 | ||
fi | ||
|
||
archivefile=$outputdir/micropublication-org.zip | ||
if [[ ! -e $archivefile ]]; then | ||
echo "Microarchiver failed to create archive file" | ||
exit 1 | ||
fi | ||
|
||
echo "" >> $logfile | ||
echo "=== FTP'ing file using curl ===" >> $logfile | ||
curl -T $archivefile ftp://ftp.portico.org --user $FTP_USER:$FTP_PASS >> $logfile 2>&1 | ||
# Always send mail with the results. | ||
grep -F "Total articles" $logfile | \ | ||
mail -s"Portico archiving results for $today" -a $csvfile -a $logfile [email protected] |