-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnfs-clients.sh
executable file
·35 lines (31 loc) · 1023 Bytes
/
nfs-clients.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
#!/bin/bash
# mounting /usr only for the R installation, but that also requires /etc/R!
declare -a workers=(vm3-8core vm4-8core vm5-8core vm6-8core vm7-8core vm8-8core vm9-8core vm10-8core)
# declare -a workers=(vm6-8core vm7-8core vm8-8core vm9-8core vm10-8core)
for i in "${workers[@]}"
do
echo "going to worker $i now"
ssh root@"$i" /bin/bash << 'EOT'
echo "These commands will be run on: $( uname -n )"
apt-get --yes install nfs-common
echo "mounting now"
mount 10.20.35.20:/home/ /home/
mount 10.20.35.20:/usr /usr
mkdir -p /etc/R
mount 10.20.35.20:/etc/R /etc/R
mkdir -p /opt/R
mount 10.20.35.20:/opt/R /opt/R
mkdir -p /apps
mount 10.20.35.20:/apps /apps
sleep 1
echo "done mounting. "
# echo "adding to /etc/ftabs"
# echo "10.20.35.20:/root /root nfs rw,auto 0 0" | cat >> /etc/fstab
# echo "10.20.35.20:/usr/local /usr/local nfs rw,auto 0 0" | cat >> /etc/fstab
# echo "10.20.35.20:/apps /apps nfs rw,auto 0 0" | cat >> /etc/fstab
echo "done with $i "
echo " "
echo " "
sleep 1
EOT
done