-
-
Save usuyama/2856705 to your computer and use it in GitHub Desktop.
localから、qsubを投げて終わるのを監視する。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ssh -t -t gw <<EOF | |
qsub test.sh | ruby -ane 'print $F[2]' > "job_id" | |
exit | |
EOF | |
scp gw:job_id ./ | |
job_id=$(cat job_id) | |
sleep 5 | |
while : | |
do | |
ssh -t -t gw <<EOF | |
qstat > "qstat.log" | |
exit | |
EOF | |
scp gw:qstat.log ./ | |
is_exist=$(cat qstat.log | grep $job_id "qstat.log") | |
if [ -z "$is_exist" ];then | |
break | |
fi | |
echo "waiting job" | |
sleep 5 | |
done | |
echo "job fin" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment