-
Notifications
You must be signed in to change notification settings - Fork 0
/
collectanalysis
executable file
·46 lines (38 loc) · 1023 Bytes
/
collectanalysis
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
# Bash executable
#!/bin/bash
# collectanalysis.sh:
# Collects analysis jobs form run directory.
RunDirPath=/scratch/Users/mist7261/McHydro
HomeDir=`pwd`
DirStrName='Analyzed'
### Display the job context
echo "Starting run"
echo Running on host `hostname`
echo Time is `date`
echo Directory is `pwd`
echo "Collecting Data and deleting temporary directories"
cd $RunDirPath
echo "In dir `pwd` "
# Enable nullglob to short files in an array to see in
# ./runfiles is empty
for i in `ls | grep ^${DirStrName}`;
do
cd $i
echo "In dir `pwd` "
# Check is there are files in ./runfiles.
# if there are it's, not done
# Store them in an array
filesinrun=(./runfiles/*.mat);
#If there is nothing in there, collect
if [ "${#files[@]}" -eq "0" ]; then
echo "Run finished. Collecting outputs"
mv ./msdfiles/* $HomeDir/msdfiles
cd ../
rm -rf $i
else
echo "Still Running. Not collecting"
cd ../
fi
done
echo "Collected all finished data and deleted temporary directories"
exit