Create a gist now

Instantly share code, notes, and snippets.

@hokru /scrdir Secret
Created Feb 13, 2016

What would you like to do?
scrdir () {
tmp=tmp.job.info
JOBID=$1
qstat -j $JOBID > $tmp
JOBNAME=`cat $tmp | grep "job_name:" | awk '{print $2}'`
qstat -u $USER > $tmp
XXX=`cat $tmp | grep " ${JOBNAME:0:10} " | awk '{print $8}'`
YYY=`echo "${XXX%.ibp.cz}"`
node=`echo ${YYY:(-3)}`
echo "NODE: $node"
TMPSCR=/var/autofs/scratch/$node/$USER/$JOBNAME.$JOBID/
echo "changing to scratch dir: $TMPSCR !"
cd $TMPSCR
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment