Skip to content
Snippets Groups Projects
Commit 7a246f03 authored by Marc's avatar Marc
Browse files

add script 'download_databases_from_s3bucket'

parent 3fd9f365
No related branches found
No related tags found
No related merge requests found
#! /bin/bash
LOGFILE=$1
DATADIR=$2
#s3 bucket from which the databases are downloaded
S3BUCKET='psot-databases'
# list of database folders, downloaded as tar-archives
list='ghostx uniprot pfam-31'
function test_datadir () {
if ! [[ -e $DATADIR && -d $DATADIR ]]; then
mkdir $DATADIR
sync_data
elif [ -z "$(ls -A $DATADIR)" ]; then
sync_data
fi
}
function sync_data () {
echo "Could not find databases in config given path"
echo "Download databases... "
cd $DATADIR
for ele in $list; do
wget -q "https://${S3BUCKET}.s3.computational.bio.uni-giessen.de/${ele}.tar.gz"
tar -zxf "${ele}.tar.gz"
rm "${ele}.tar.gz"
done
ln -s 'pfam-31/' 'pfam'
echo "[$(date)] psot (PID $$) downloaded databases to $DATADIR" >> $LOGFILE
}
if [[ -e $LOGFILE ]]; then
test_datadir
else
echo "[$(date)] logfile created from psot (PID $$)" > $LOGFILE
test_datadir
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment