how to check if something is in the queue of torque?
- by kloop
I want to re-run some jobs that completed prematurely under torque.
These jobs are run through .job scripts (using qsub). However, I don't want to re-run a job which is already in the queue.
Given a script filename, how can I know whether it is already in torque's queue (using qstat?) or not? I prefer to do it programmatically, of course, so any oneliner that searches for a given script name would be great.
I will note that I can grep submit_args in qstat -f, but I can't get it to display the whole script name when it is too long. This is crucial.
EDIT:
I managed to solve it using the following command:
qstat -x | perl -pi -e 's/\<\//\n/g' | grep job$ | grep -v submit_args | perl -pi -e 's/Job_Id\>\<Job_Name\>//'
works because all my scripts end in the string "job".