-
Notifications
You must be signed in to change notification settings - Fork 0
/
cronjob_Galaxy_Array.sh
executable file
·73 lines (42 loc) · 1.82 KB
/
cronjob_Galaxy_Array.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash -l
conda activate root_env
echo "Running environment at ${CONDA_PREFIX}"
#if [-z "$(ls -A /data/cmsdaq/DimensionBench/Arrays/ArrayData)" ] && echo "Not Empty" || echo "Empty"
#if [ -z "$(ls -A /data/cmsdaq/DimensionBench/Arrays/ArrayData)" ]
#begin=$(date +%s)
begin=$SECONDS
if [ -z "$(ls -A /data/cmsdaq/DimensionBench/Arrays/ArrayData_tmp)" ]
then
echo "++++++++++++++++++++++++++++++"
echo "No raw data in this directory"
echo "++++++++++++++++++++++++++++++"
else
echo "+++++++++++++++++++++++++++++++"
echo "New raw data in this directory"
echo "+++++++++++++++++++++++++++++++"
# Added this part to move files from ArrayData_tmp to ArrayData and run cronjob smoothly
for file in /data/cmsdaq/DimensionBench/Arrays/ArrayData_tmp/*-*.TXT; do
mv "$file" "/data/cmsdaq/DimensionBench/Arrays/ArrayData/$(basename "$file")"
echo "+++++++++++++++++++++++++++++++++++++++++++++++"
echo "$file moved to ArrayData directory!"
echo "Executing Galaxy analysis code ..."
echo "+++++++++++++++++++++++++++++++++++++++++++++++"
cd /home/cmsdaq/GalaxyAnalysis/
echo "++++++++++++++++++++++++++++++++++++"
echo " Adding Run Number to raw data file"
echo "++++++++++++++++++++++++++++++++++++"
python3 AddRunNumb-Galaxy-Array.py
echo "++++++++++++++++++++++++++++++"
echo " Starting LYSO Array Analysis"
echo "++++++++++++++++++++++++++++++"
python3 runAll_Galaxy_Array.py --inputdir /data/cmsdaq/DimensionBench/Arrays/ArrayData/
#end=$(date +%s)
#tottime=$(expr $end - $begin)
tottime=$(($SECONDS - $begin))
echo "+++++++++++++++++++++++++++++++++++++++++++"
echo "Execution time for 1 LYSO Array is: $(($tottime/60)) min $(($tottime%60)) sec"
echo "+++++++++++++++++++++++++++++++++++++++++++"
done
conda deactivate
cd ~/
fi