-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgrab_queue_files.sh
executable file
·46 lines (30 loc) · 1.42 KB
/
grab_queue_files.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
#!/bin/bash
#CRC info;
pword="CRC-PASSWORD GOES HERE!!!!"
usename="CRC-USERNAME GOES HERE!!!"
dest="crcfe01.crc.nd.edu" #You can change this to which-ever front end you want
afs_path="PATH TO DIR OF PYTHON DAEMON" #(don't need last '/')
#local info:
pswd="LOCAL(SERVER) PASSWORD HERE!!!"
desired_path="DESIRED PATH FOR SERVER HERE!" #typicaly /var/www/html (you don't need the last '/')
#Gathering files from CRCFE
sshpass -p "$pword" scp $usename@$dest:$afs_path/index-long.html $(pwd)/index-long.html
sshpass -p "$pword" scp $usename@$dest:$afs_path/index-debug.html $(pwd)/index-debug.html
sshpass -p "$pword" scp $usename@$dest:$afs_path/sub-debug.tar.gz $(pwd)/sub-debug.tar.gz
sshpass -p "$pword" scp $usename@$dest:$afs_path/sub-long.tar.gz $(pwd)/sub-long.tar.gz
sshpass -p "$pword" scp $usename@$dest:$afs_path/pending.html $(pwd)/pending_content.html
#Moving the files once on the web-server to proper locations
echo $pswd | sudo -S mv index-long.html $desired_path/Long/index-long.html
echo $pswd | sudo -S mv index-debug.html $desired_path/Debug/index-debug.html
echo $pswd | sudo -S mv pending_content.html $desired_path/Pending/pending_content.html
#Setting up node files:
tar -xzf sub-debug.tar.gz
for i in debug@*;
do
echo $pswd | sudo -S mv $i $desired_path/Debug/$i/sub-index.html
done
tar -xzf sub-long.tar.gz
for j in d6copt*;
do
echo $pswd | sudo -S mv $j $desired_path/Long/$j/sub-index.html
done