Files
obitools4/doc/book/wolf_data/download_gb.sh
Eric Coissac c94b2974fb Reorganization of the documentation book directory
Former-commit-id: 095acaf9c8649b0e527c6253dc79330feedac865
2023-02-23 23:41:24 +01:00

30 lines
684 B
Bash
Executable File

#!/bin/bash
URL=https://ftp.ncbi.nlm.nih.gov/genbank/
DIV="bct|inv|mam|phg|pln|pri|rod|vrl|vrt"
GB_Release_Number=$(curl "${URL}GB_Release_Number")
mkdir -p "Release-${GB_Release_Number}"
cd "Release-${GB_Release_Number}"
curl $URL > index.html
for f in $(egrep "gb(${DIV})[0-9]+\.seq\.gz" index.html \
| sed -E 's@^.*<a href="([^"]+)">.*</a>.*$@\1@' ) ; do
echo -n "File : $f"
if [[ -f $f ]] ; then
gzip -t $f && echo " ok" || rm -f $f
fi
while [[ ! -f $f ]] ; do
echo downloading
wget2 --progress bar -v -o - $URL$f
if [[ -f $f ]] ; then
gzip -t $f && echo " ok" || rm -f $f
fi
done
done