Skip to content

Commit aa5d6fa

Browse files
added bash script to automate jules kgo process.
1 parent 7a8809d commit aa5d6fa

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
# Needs to be run as julesadmin 'xsudo -iu julesadmin'
4+
5+
set -e
6+
7+
read -rp "KGO VERSION:" KGO_VERSION
8+
read -rp "USER NAME:" USER_NAME
9+
read -rp "SUITE/RUNX NAME:" SUITE
10+
read -rp "EX ZONE:" EX_ZONE
11+
12+
# Azure spice kgo dir
13+
AZURE_KGO_DIR=/data/users/julesadmin/jules/rose-stem/jules-kgo/$KGO_VERSION
14+
mkdir -p "$AZURE_KGO_DIR"
15+
cp /home/users/"$USER_NAME"/cylc-run/"$SUITE"/work/1/meto_azspice_*/output/* "$AZURE_KGO_DIR"
16+
17+
# select the zone to resync based on user inputted EX_ZONE
18+
if [ "$EX_ZONE" == "exab" ]; then
19+
echo "exab choosen"
20+
EX_ZONE=login.exab.sc
21+
EX_ZONE_RSYNC=login.excd.sc
22+
23+
elif [ "$EX_ZONE" == "excd" ]; then
24+
echo "excd choosen"
25+
EX_ZONE=login.excd.sc
26+
EX_ZONE_RSYNC=login.exab.sc
27+
28+
else
29+
echo "ex zone not entered or incorrect, please enter \"exab\" or \"excd\"."
30+
exit
31+
fi
32+
33+
# EXAB EXCD rsync files
34+
EX_KGO_DIR=/common/internal/jules/rose-stem-kgo/$KGO_VERSION
35+
ssh -Y $EX_ZONE "echo "new kgo dir: "$EX_KGO_DIR""; mkdir -p $EX_KGO_DIR; cp /home/users/$USER_NAME/cylc-run/$SUITE/work/1/meto_ex1a_*/output/* $EX_KGO_DIR; rsync -avz $EX_KGO_DIR $EX_ZONE_RSYNC:/common/internal/jules/rose-stem-kgo/"
36+
37+
exit

0 commit comments

Comments
 (0)