Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
XNAT-Group
DICOM_archive_uploader
Commits
07056392
Commit
07056392
authored
Sep 25, 2014
by
Franziska Koehn
Browse files
shell script for uploading all tar-gz-data in a specific folder
parent
30f70767
Changes
1
Hide whitespace changes
Inline
Side-by-side
many-decom-targz-files-xnat-importer
0 → 100644
View file @
07056392
#!/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
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