Skip to content

Commit

Permalink
Make PubMed fetch incremental and idempotent
Browse files Browse the repository at this point in the history
  • Loading branch information
dspinellis committed Feb 1, 2024
1 parent 7b43f05 commit 7f677b3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/common/fetch-pubmed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -eu

BASE=https://ftp.ncbi.nlm.nih.gov/pubmed/baseline/

mkdir pubmed-data
mkdir -p pubmed-data
cd pubmed-data

# Obtain last baseline file from README.txt
Expand All @@ -18,5 +18,7 @@ last=$(curl --silent https://ftp.ncbi.nlm.nih.gov/pubmed/baseline/README.txt |
for n in $(seq 1 $last) ; do
file_name=$(printf 'pubmed24n%04d.xml.gz' $n)

test -r $file_name && continue

curl --silent $BASE/$file_name >$file_name
done

0 comments on commit 7f677b3

Please sign in to comment.