-
Notifications
You must be signed in to change notification settings - Fork 27
/
resume.sh
executable file
·27 lines (22 loc) · 810 Bytes
/
resume.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
#!/bin/bash
#
# Resumes an already running remote sbatch job.
# Sample usage: bash resume.sh
if [ ! -f params.sh ]
then
echo "Need to configure params before first run, run setup.sh!"
exit
fi
source params.sh
NAME="${1}"
# The user is required to specify port
echo "ssh ${RESOURCE} squeue --name=$NAME --user=$FORWARD_USERNAME -o "%N" -h"
MACHINE=`ssh ${RESOURCE} squeue --name=$NAME --user=$FORWARD_USERNAME -o "%N" -h`
if $ISOLATEDCOMPUTENODE
then
echo "ssh -L $PORT:localhost:$PORT ${RESOURCE} ssh -L $PORT:localhost:$PORT -N $MACHINE &"
ssh -L $PORT:localhost:$PORT ${RESOURCE} ssh -L $PORT:localhost:$PORT -N $MACHINE &
else
echo "ssh $DOMAINNAME -l $FORWARD_USERNAME -K -L $PORT:$MACHINE:$PORT -N &"
ssh "$DOMAINNAME" -l $FORWARD_USERNAME -K -L $PORT:$MACHINE:$PORT -N &
fi