Select Git revision
-
Eric Kooistra authoredEric Kooistra authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
fetch_data.cwl 1.11 KiB
id: fetchdata
label: fetch_data
class: CommandLineTool
cwlVersion: v1.2
inputs:
- id: surl_link
type: string
inputBinding:
position: 0
outputs:
- id: uncompressed
type: Directory
outputBinding:
glob: 'out/*'
baseCommand:
- 'bash'
- 'fetch.sh'
doc: 'Fetch a file from surl and uncompresses it'
requirements:
InitialWorkDirRequirement:
listing:
- entryname: 'fetch.sh'
entry: |
#!/bin/bash
mkdir out
if [[ "$1" == *"lta-head.lofar.psnc.pl"* ]]; then
wget --no-check-certificate --read-timeout=5 --timeout 5 https://lta-download.lofar.psnc.pl/lofigrid/SRMFifoGet.py\?surl\=$1
cd out
tar -xvf ../*.tar
else
cd out
turl=`echo $1 | awk '{gsub("srm://srm.grid.sara.nl[:0-9]*","gsiftp://gridftp.grid.sara.nl"); print}'`
turl=`echo $turl | awk '{gsub("srm://lofar-srm.fz-juelich.de[:0-9]*","gsiftp://lofar-gridftp.fz-juelich.de:2811"); print}'`
echo "Downloading $turl"
globus-url-copy $turl - | tar -xvf -
fi