-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-checksum.sh
executable file
·41 lines (31 loc) · 863 Bytes
/
test-checksum.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
#SBATCH -p debug
#SBATCH -t 00:30:00
#SBATCH -n 15
#SBATCH -A Evaluating-Identifie
#SBATCH -J test-checksum
#SBATCH -o test-checksum.o%j
export PATH=$PATH:"$HOME/.aspera/connect/bin"
# get UUID and SRA number
UUID="4181808582778351130-242ac1110-0001-012"
# SRA_NUM="SRR292241"
SRA_NUM="ERR650315"
STORE_PATH="./SRA/"
# Downloading file
./bin/aspera.sh ${SRA_NUM} ${STORE_PATH}
# Running checksum and update metadata
if [ $? -eq 0 ]; then
SRA_FILE="${STORE_PATH}${SRA_NUM}.sra"
else
exit 1
fi
if [ ! -f "${SRA_FILE}" ]; then
echo 'SRA file not found! Please confirm the path.'
exit 1
fi
md5=($(md5sum ${SRA_FILE}))
lastChecksumUpdated=$(date '+%Y-%m-%d %X')
# post the checksum to webhook
curl -k --data "UUID=${UUID}&checksum=${md5}&lastChecksumUpdated=${lastChecksumUpdated}" http://requestb.in/1a7963p1
rm -rf SRA
exit 0