-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathseasonCycler.sh
More file actions
96 lines (74 loc) · 2.07 KB
/
Copy pathseasonCycler.sh
File metadata and controls
96 lines (74 loc) · 2.07 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
echo "Set ExpLen as OriginalExpLen"
mv ExpLen.txt OriginalExpLen.txt
echo "OriginalExpLen is"
originalLen=`cat OriginalExpLen.txt`
echo $originalLen
python lenExposureInfo.py
echo "New ExpLen is"
newLen=`cat ExpLen.txt`
echo $newLen
sleep 5s
if [[ $newLen -gt $originalLen ]]
then
echo "Exposure list has grown"
lastExposure=`cat lastExp.txt`
python getExposureInfoNFS.py --lastExp $lastExposure
ARRAY=(postproc_*.ini) #list of postproc_SEASON.ini files
for INIFILE in ${ARRAY[@]}
do
PROPID="$(awk -F "=" '/^propid/{print $NF}' $INIFILE)"
today=`date +%Y%m%d`
yesterday=`date -d "yesterday 13:00" +%Y%m%d`
python getExpWPropIDandNite.py -n $today $yesterday -p $PROPID
done
echo "Sleeping for a bit"
sleep 5s
echo "Running diffimg_setup.sh"
. diffimg_setup.sh
echo "diffimg_setup done."
echo
echo "available .ini files: "${ARRAY[@]}
ELEMENTS=${#ARRAY[@]}
echo $ELEMENTS
if [ $ELEMENTS -gt 1 ];
then
echo $ELEMENTS
for ((count=0;count<$ELEMENTS;count++));
do
INI=${ARRAY[${count}]}
echo $INI
python getSeason.py --ini $INI
SEASON=`cat getSeason.txt`
echo 'SEASON = '$SEASON
#update exposure list in config file
python changeEXPlist.py --season $SEASON --expList curatedExposure.list
python run_postproc.py --season $SEASON > output${SEASON}.txt &
sleep 45s
python run_checker.py --season $SEASON &
done
echo "The deed is done."
else
echo "Only one .ini."
INI=${ARRAY[0]}
echo $INI
python getSeason.py --ini $INI
SEASON=`cat getSeason.txt`
echo 'SEASON = '$SEASON
python run_postproc.py --season $SEASON > output${SEASON}.txt &
sleep 45s
python run_checker.py --season $SEASON
echo "The deed is done."
fi
# for INIFILE in ${ARRAY[@]}
# do
# OUTDIR="$(awk '$1=="outdir" {print $3}' $INI)"
# mv $INIFILE $OUTDIR
# echo "Moved "$INIFILE" to "$OUTDIR
# done
else
echo "Nothing new to see here."
#return
#exit
### If you are exectuting this script, change this `return` to and `exit`
fi