Skip to content
Snippets Groups Projects
Select Git revision
  • 4a353b8be2f42a195815dd059946f930f8c113f8
  • master default protected
  • optimize_workflow
  • poppy_integration_v50
  • poppy_integration
  • releases/v5.0 protected
  • use-versioned-releases
  • releases/v5.0rc2 protected
  • releases/v5.0rc1 protected
  • releases/ldv_v407_atdb protected
  • ldv_v407_debug
  • releases/ldv_v406_debug protected
  • releases/ldv_v405 protected
  • releases/ldv_v404 protected
  • v5.0
  • v5.0rc2
  • v5.0rc1
  • ldv_v406_debug
  • ldv_v405_debug
  • ldv_v404
  • ldv_v403
  • ldv_v402
  • v4.0
  • ldv_v401
  • ldv_v40
  • ldv_v031
  • ldv_v03
  • ldv_v01
28 results

fetch_data.cwl

Blame
  • 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