-
Notifications
You must be signed in to change notification settings - Fork 1
/
pull_results_from_openmind.sh
71 lines (61 loc) · 1.67 KB
/
pull_results_from_openmind.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
#!/bin/bash
declare -a arr=(
"bead/20180328/registration"
)
#"bead/20180328/registration_20180520_170824"
#declare -a arr=(
#"bead/20170915/registration"
#"bead/20171011/registration"
#"bead/20180109/registration"
#"bead/20180227/registration"
#"bead/20180302/registration"
#"bead/20180319/registration"
#"fish/20171202/interpolate"
#"fish/20171221/interpolate"
#"fish/20180123/interpolate"
#"fish/20180227/vid1/interpolate"
#"fish/20180227/vid2/interpolate"
#"worm/20170720/interpolate"
#"worm/20171012/interpolate"
#"worm/20171114/registration"
#"worm/20171117/registration"
#"worm/20171215/interpolate"
#"worm/20180103/registration"
#)
if [[ $(hostname -s) = willis ]]; then
echo 'this is willis'
LPATH=/home/jkinney/Desktop/DDLFM
elif [[ $(hostname -s) = *Justins-Mac* ]]; then
echo 'this is mac air'
LPATH=/Users/justin/Desktop/DDLFM
else
echo unknown
exit
fi
#[email protected]:/om/scratch/Mon/jkinney
[email protected]:/om/user/jkinney/DLFM
for i in "${arr[@]}"; do
echo "##"
echo "## $i"
echo "##"
# split string at '/'
DEST=$LPATH
IFS='/' read -ra ADDR <<< "$i"
for j in "${ADDR[@]}"; do
DEST="$DEST/$j"
# check if folders exist
if [ ! -d "$DEST" ]; then
echo ""
echo $DEST
echo 'Folder does not exist. Creating now.'
mkdir $DEST
fi
done
# pull results from openmind
echo ""
#rsync -av --delete --exclude '*.mat' --exclude '*.tif' $RPATH/$i/ $LPATH/$i/
rsync -av --exclude '*.mat' --exclude '*.tif' $RPATH/$i/ $LPATH/$i/
#rsync -av --delete --exclude '*.tif' $RPATH/$i/ $LPATH/$i/
echo ""
echo ""
done