Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SOaAS
psot.repository
Commits
7a246f03
Commit
7a246f03
authored
Feb 20, 2019
by
Marc
Browse files
add script 'download_databases_from_s3bucket'
parent
3fd9f365
Changes
1
Hide whitespace changes
Inline
Side-by-side
psot/helpers/download_databases_from_s3bucket.sh
0 → 100755
View file @
7a246f03
#! /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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment