#!/bin/bash
#PBS -l walltime=24:00:00
#PBS -l ncpus=1,mem=4gb
#PBS -q uv2000
#PBS -N aspera
#PBS -j oe

source $TRANSFER_INFO_FILE

/home/u035/u035/shared/software/aspera/connect/bin/ascp \
  -T -P 33001 -O 33001 -l 500M -k2 --overwrite=diff \
  $ASPERA_SCP_USER@transfer.genomics.ed.ac.uk:$PROJECT \
  /scratch/u035/u035/shared/trio_whole_exome/data

cd /scratch/u035/u035/shared/trio_whole_exome/data/$PROJECT/raw_data

rm ../md5_check.txt 2> /dev/null
for DATE in 20*[0-9]
do
  cd $DATE
  md5sum --check md5sums.txt >> ../../md5_check.txt
  cd ..
done
