Commit 07056392 authored by Franziska Koehn's avatar Franziska Koehn
Browse files

shell script for uploading all tar-gz-data in a specific folder

parent 30f70767
#!/bin/sh
USER=admin
PASSWORD=admin
HOST=http://192.168.56.103:8080
PROJECT=proj1608-i
DIRECTORY=../brain_database/12212.df/*.tar.gz
echo "the size of your data is"
du -s $DIRECTORY
echo "continue (1/2)?"
select yn in "Yes" "No"; do
case $yn in
Yes ) break;;
No ) exit;;
esac
done
for FILE in $DIRECTORY
do
result=`curl -X POST -u $USER:$PASSWORD "$HOST/data/services/import?format=json" -F project=$PROJECT -F prearchive_code=1 -F auto-archive=true -F quarantine=false -F "image_archive=@$FILE" | grep "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.10"`
if [ -z "$result" ]; then
echo "Successfully uploaded!"
else
echo "ERROR: Session already exists with matching files.Your data may be available in the prearchive for your review."
fi
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment